pcap_packet_source.h

Class

class PcapPacketSource : public ouster::core::PacketSource, private ouster::impl::PacketSourceBuilder<ouster::core::IoType::PCAP, PcapPacketSource>

PacketSource that produces packets from a given PCAP file.

Public Functions

PcapPacketSource(const std::string &file, const std::function<void(PcapPacketSourceOptions&)> &options = {})

open_source compatible constructor

Parameters:
  • file – [in] pcap file to open

  • options – [in] scan source options

PcapPacketSource(const std::string &file, PcapPacketSourceOptions options)

open source compatible constructor

Parameters:
  • file – [in] pcap file to open

  • options – [in] scan source options

virtual ouster::core::PacketIterator begin() const override

Get begin iterator for container. Provides each scan from all sensors in time order

Returns:

iterator to first item in source

virtual const std::vector<std::shared_ptr<ouster::sensor::sensor_info>> &sensor_info() const override

Get the sensor_info for each sensor in the source

Returns:

info about each sensor

virtual bool is_live() const override

Indicates if the source is streaming from a device, such as a sensor

Returns:

if live or not

uint64_t id_error_count() const

Get number of id errors that occurred while retrieving packets

Returns:

numer of id errors

uint64_t size_error_count() const

Get number of size errors that occurred while retrieving packets

Returns:

numer of size errors

Structs

struct PcapPacketSourceOptions : private ouster::PacketSourceOptions

Options for PcapPacketSource.

Functions

std::vector<std::string> ouster::pcap::resolve_metadata_multi(const std::string &data_path)

Finds associated metadata json files for the given data source filename

Parameters:

data_path – <[in] path to find metadata for

Returns:

list of metadata filenames