CVB++ 15.0
Packet Class Referencefinal

A packet that holds encoded data frame data. More...

#include <cvb/codec_bridge/packet.hpp>

Public Member Functions

size_t Size () const
 Get the size of the packet. More...
 
void * BasePtr () const
 Get the pointer to the packet content. More...
 
Cvb::optional< int > StreamIndex () const
 Get the stream index this packet belongs to, if any. More...
 
int64_t PresentationTimeStamp () const
 Get the presentation time stamp for this packet. More...
 
Rational TimeBase () const
 Get time base that was used for encoding this packet. More...
 

Detailed Description

A packet that holds encoded data frame data.

Member Function Documentation

◆ BasePtr()

void * BasePtr ( ) const
inline

Get the pointer to the packet content.

Returns
The base pointer.
Exceptions
Anyexception derived from std::exception including CvbException.

The memory of a packet is always contiguous.

◆ PresentationTimeStamp()

int64_t PresentationTimeStamp ( ) const
inline

Get the presentation time stamp for this packet.

Returns
The presentation time stamp.
Exceptions
Anyexception derived from std::exception including CvbException.

The presentation time stamp can be used to for streaming encoded data, to ensure proper timing on the receiver side.

◆ Size()

size_t Size ( ) const
inline

Get the size of the packet.

Returns
Packet size in bytes.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ StreamIndex()

Cvb::optional< int > StreamIndex ( ) const
inline

Get the stream index this packet belongs to, if any.

Returns
The stream index of this packet.
Exceptions
Anyexception derived from std::exception including CvbException.

Packets that are read from container files have a stream index. The index can be used to sort out packets that contain audio or subtitle data as such packets have a different index that the video stream.

◆ TimeBase()

Rational TimeBase ( ) const
inline

Get time base that was used for encoding this packet.

Returns
The time base.
Exceptions
Anyexception derived from std::exception including CvbException.