Functions | |
BGAV_PUBLIC int | bgav_get_audio_compression_info (bgav_t *bgav, int stream, gavl_compression_info_t *info) |
Get audio compression info. | |
BGAV_PUBLIC int | bgav_get_video_compression_info (bgav_t *bgav, int stream, gavl_compression_info_t *info) |
Get video compression info. | |
BGAV_PUBLIC int | bgav_read_audio_packet (bgav_t *bgav, int stream, gavl_packet_t *p) |
Read compressed audio packet. | |
BGAV_PUBLIC int | bgav_read_video_packet (bgav_t *bgav, int stream, gavl_packet_t *p) |
Read compressed video packet. |
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.
BGAV_PUBLIC int bgav_get_audio_compression_info | ( | bgav_t * | bgav, | |
int | stream, | |||
gavl_compression_info_t * | info | |||
) |
Get audio compression info.
bgav | A decoder instance | |
stream | Stream index (starting with 0) | |
info | Returns the compression info |
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_PUBLIC int bgav_get_video_compression_info | ( | bgav_t * | bgav, | |
int | stream, | |||
gavl_compression_info_t * | info | |||
) |
Get video compression info.
bgav | A decoder instance | |
stream | Stream index (starting with 0) | |
info | Returns the compression info |
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_PUBLIC int bgav_read_audio_packet | ( | bgav_t * | bgav, | |
int | stream, | |||
gavl_packet_t * | p | |||
) |
Read compressed audio packet.
bgav | A decoder instance | |
stream | Stream index (starting with 0) | |
p | Returns the packet |
You can pass the same packet multiple times to a read fuction. Use gavl_packet_free when it's no longer used.
BGAV_PUBLIC int bgav_read_video_packet | ( | bgav_t * | bgav, | |
int | stream, | |||
gavl_packet_t * | p | |||
) |
Read compressed video packet.
bgav | A decoder instance | |
stream | Stream index (starting with 0) | |
p | Returns the packet |
You can pass the same packet multiple times to a read fuction. Use gavl_packet_free when it's no longer used.