EncodedStreamPacket Struct Reference

Single encoded video packet retrieved from a Camera source. More...

Attributes

const unsigned char * data = nullptr
 Annex-B NAL units. SDK-owned. More...
 
size_t size = 0
 Length of data in bytes. More...
 
Timestamp timestamp
 Capture timestamp (ns). More...
 
STREAMING_CODEC codec = STREAMING_CODEC::H265
 H264 or H265. More...
 
bool is_keyframe = false
 True if this packet is an IDR. More...
 
ENCODED_STREAM_SOURCE source = ENCODED_STREAM_SOURCE::RECEIVING
 Which path produced it. More...
 

Detailed Description

Single encoded video packet retrieved from a Camera source.

The payload is laid out as Annex-B NAL units. Every packet returned to user code is preceded (within the same byte stream history) by SPS/PPS (and VPS for HEVC), so writing successive packets to a .h264 or .hevc file produces a stream playable by any standard player.

Note
data is owned by the SDK and remains valid until the next call to Camera::retrieveEncodedStreamPacket() on the same source, or until Camera::close(). Other API calls — Camera::grab(), retrieves on other sources, or disabling the source via Camera::disableStreaming() / Camera::disableRecording() — do not invalidate the buffer. Copy the bytes out if you need them longer.

Variables

◆ data

const unsigned char* data = nullptr

Annex-B NAL units. SDK-owned.

◆ size

size_t size = 0

Length of data in bytes.

◆ timestamp

Timestamp timestamp

Capture timestamp (ns).

◆ codec

H264 or H265.

◆ is_keyframe

bool is_keyframe = false

True if this packet is an IDR.

◆ source

Which path produced it.