EncodedStreamPacket Struct Reference

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

Functions

byte[] GetData ()
 Copies the encoded payload into a managed byte array. More...
 

Attributes

IntPtr data
 Annex-B NAL units. SDK-owned, see GetData(). More...
 
ulong size
 Length of data in bytes. More...
 
ulong timestampNS
 Capture timestamp, in nanoseconds. More...
 
STREAMING_CODEC codec
 H264 or H265. More...
 
bool isKeyframe
 True if this packet is an IDR (key frame). More...
 
ENCODED_STREAM_SOURCE source
 Which path produced this packet. More...
 

Detailed Description

Single encoded video packet retrieved from a camera source.

The payload is laid out as Annex-B NAL units. The first packet handed back on a given source is always an IDR, with SPS/PPS (and VPS for HEVC) inlined in front, so writing successive packets to a .h264 / .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 RetrieveEncodedStreamPacket() on the same source, or until the camera is closed. Other calls do not invalidate the buffer. Use GetData() to copy the bytes out if you need them longer.

Functions

◆ GetData()

byte [] GetData ( )
inline

Copies the encoded payload into a managed byte array.

Returns
The Annex-B payload, or an empty array if the packet holds no data.

Variables

◆ data

IntPtr data

Annex-B NAL units. SDK-owned, see GetData().

Referenced by EncodedStreamPacket.GetData().

◆ size

ulong size

Length of data in bytes.

Referenced by EncodedStreamPacket.GetData().

◆ timestampNS

ulong timestampNS

Capture timestamp, in nanoseconds.

◆ codec

H264 or H265.

◆ isKeyframe

bool isKeyframe

True if this packet is an IDR (key frame).

◆ source

Which path produced this packet.