gmerlin-avdecoder
Functions
Read compressed media packets

Functions

BGAV_PUBLIC int bgav_get_audio_compression_info (bgav_t *bgav, int stream, gavl_compression_info_t *info)
 Get audio compression info. More...
 
BGAV_PUBLIC int bgav_get_video_compression_info (bgav_t *bgav, int stream, gavl_compression_info_t *info)
 Get video compression info. More...
 
BGAV_PUBLIC int bgav_get_overlay_compression_info (bgav_t *bgav, int stream, gavl_compression_info_t *info)
 Get overlay compression info. More...
 
BGAV_PUBLIC int bgav_read_audio_packet (bgav_t *bgav, int stream, gavl_packet_t *p)
 Read compressed audio packet. More...
 
BGAV_PUBLIC gavl_packet_source_t * bgav_get_audio_packet_source (bgav_t *bgav, int stream)
 Get a packet source for an audio stream. More...
 
BGAV_PUBLIC int bgav_read_video_packet (bgav_t *bgav, int stream, gavl_packet_t *p)
 Read compressed video packet. More...
 
BGAV_PUBLIC gavl_packet_source_t * bgav_get_video_packet_source (bgav_t *bgav, int stream)
 Get a packet source for a video stream. More...
 
BGAV_PUBLIC gavl_packet_source_t * bgav_get_text_packet_source (bgav_t *bgav, int stream)
 Get a packet source for a text subtitle stream. More...
 
BGAV_PUBLIC gavl_packet_source_t * bgav_get_overlay_packet_source (bgav_t *bgav, int stream)
 Get a packet source for an overlay stream. More...
 

Detailed Description

This API layer allows you to read compressed media packets from the stream bypassing the codecs. You can read some streams of a file as compressed packets while decoding others. You can however not mix read calls for compressed packets and decompressed frames in a single stream. Reading compressed packets is supported only for a subset of codecs, which are defined by the gavl_codec_id_t. If your application supports compressed packets, you can first get the compression info with bgav_get_audio_compression_info or bgav_get_video_compression_info. If you support this compression, set the stream mode to BGAV_STREAM_READRAW. Before reading you must call bgav_start. Packets are then read with bgav_read_audio_packet and bgav_read_video_packet.

Function Documentation

◆ bgav_get_audio_compression_info()

BGAV_PUBLIC int bgav_get_audio_compression_info ( bgav_t bgav,
int  stream,
gavl_compression_info_t info 
)

Get audio compression info.

Parameters
bgavA decoder instance
streamStream index (starting with 0)
infoReturns the compression info
Returns
1 if a compression info was returned, 0 else

This function must be called after bgav_select_track. Before selecting the track the compression info might not be complete. Free the returned compression info with gavl_compression_info_free.

◆ bgav_get_video_compression_info()

BGAV_PUBLIC int bgav_get_video_compression_info ( bgav_t bgav,
int  stream,
gavl_compression_info_t info 
)

Get video compression info.

Parameters
bgavA decoder instance
streamStream index (starting with 0)
infoReturns the compression info
Returns
1 if a compression info was returned, 0 else

This function must be called after bgav_select_track. Before selecting the track the compression info might not be complete. Free the returned compression info with gavl_compression_info_free.

◆ bgav_get_overlay_compression_info()

BGAV_PUBLIC int bgav_get_overlay_compression_info ( bgav_t bgav,
int  stream,
gavl_compression_info_t info 
)

Get overlay compression info.

Parameters
bgavA decoder instance
streamStream index (starting with 0)
infoReturns the compression info
Returns
1 if a compression info was returned, 0 else

This function must be called after bgav_select_track. Before selecting the track the compression info might not be complete. Free the returned compression info with gavl_compression_info_free.

◆ bgav_read_audio_packet()

BGAV_PUBLIC int bgav_read_audio_packet ( bgav_t bgav,
int  stream,
gavl_packet_t p 
)

Read compressed audio packet.

Parameters
bgavA decoder instance
streamStream index (starting with 0)
pReturns the packet
Returns
1 if a packet was read, 0 else

You can pass the same packet multiple times to a read fuction. Use gavl_packet_free when it's no longer used.

◆ bgav_get_audio_packet_source()

BGAV_PUBLIC gavl_packet_source_t* bgav_get_audio_packet_source ( bgav_t bgav,
int  stream 
)

Get a packet source for an audio stream.

Parameters
bgavA decoder instance
streamStream index (starting with 0)
Returns
The packet source

Use this as an alternative for bgav_read_audio_packet

◆ bgav_read_video_packet()

BGAV_PUBLIC int bgav_read_video_packet ( bgav_t bgav,
int  stream,
gavl_packet_t p 
)

Read compressed video packet.

Parameters
bgavA decoder instance
streamStream index (starting with 0)
pReturns the packet
Returns
1 if a packet was read, 0 else

You can pass the same packet multiple times to a read fuction. Use gavl_packet_free when it's no longer used.

◆ bgav_get_video_packet_source()

BGAV_PUBLIC gavl_packet_source_t* bgav_get_video_packet_source ( bgav_t bgav,
int  stream 
)

Get a packet source for a video stream.

Parameters
bgavA decoder instance
streamStream index (starting with 0)
Returns
The packet source

Use this as an alternative for bgav_read_video_packet

◆ bgav_get_text_packet_source()

BGAV_PUBLIC gavl_packet_source_t* bgav_get_text_packet_source ( bgav_t bgav,
int  stream 
)

Get a packet source for a text subtitle stream.

Parameters
bgavA decoder instance
streamStream index (starting with 0)
Returns
The packet source

Use this as an alternative for bgav_read_subtitle_text

◆ bgav_get_overlay_packet_source()

BGAV_PUBLIC gavl_packet_source_t* bgav_get_overlay_packet_source ( bgav_t bgav,
int  stream 
)

Get a packet source for an overlay stream.

Parameters
bgavA decoder instance
streamStream index (starting with 0)
Returns
The packet source