Data Structures | |
struct | gavl_compression_info_t |
Compression format. More... | |
struct | gavl_packet_t |
Packet structure. More... | |
Defines | |
#define | GAVL_COMPRESSION_HAS_P_FRAMES (1<<0) |
Not all frames are keyframes. | |
#define | GAVL_COMPRESSION_HAS_B_FRAMES (1<<1) |
Frames don't appear in presentation order. | |
#define | GAVL_COMPRESSION_HAS_FIELD_PICTURES (1<<2) |
Packets can consist of 2 consecutive fields. | |
#define | GAVL_COMPRESSION_SBR (1<<3) |
Samplerate got doubled by decoder, format and sample counts are for the upsampled rate. | |
#define | GAVL_PACKET_TYPE_I 'I' |
Packet is an I-frame. | |
#define | GAVL_PACKET_TYPE_P 'P' |
Packet is a P-frame. | |
#define | GAVL_PACKET_TYPE_B 'B' |
Packet is a B-frame. | |
#define | GAVL_PACKET_TYPE_MASK 0xff |
Mask for frame type. | |
#define | GAVL_PACKET_KEYFRAME (1<<8) |
Packet is a keyframe. | |
#define | GAVL_PACKET_LAST (1<<9) |
Packet is the last in the stream (only Xiph codecs need this flag). | |
Enumerations | |
enum | gavl_codec_id_t { GAVL_CODEC_ID_NONE = 0, GAVL_CODEC_ID_ALAW = 1, GAVL_CODEC_ID_ULAW, GAVL_CODEC_ID_MP2, GAVL_CODEC_ID_MP3, GAVL_CODEC_ID_AC3, GAVL_CODEC_ID_AAC, GAVL_CODEC_ID_VORBIS, GAVL_CODEC_ID_JPEG = 0x10000, GAVL_CODEC_ID_PNG, GAVL_CODEC_ID_TIFF, GAVL_CODEC_ID_TGA, GAVL_CODEC_ID_MPEG1, GAVL_CODEC_ID_MPEG2, GAVL_CODEC_ID_MPEG4_ASP, GAVL_CODEC_ID_H264, GAVL_CODEC_ID_THEORA, GAVL_CODEC_ID_DIRAC, GAVL_CODEC_ID_DV } |
Functions | |
GAVL_PUBLIC void | gavl_compression_info_free (gavl_compression_info_t *info) |
Free all dynamically allocated memory of a compression info. | |
GAVL_PUBLIC void | gavl_compression_info_dump (const gavl_compression_info_t *info) |
Dump a compression info to stderr. | |
GAVL_PUBLIC const char * | gavl_compression_get_extension (gavl_codec_id_t id, int *separate) |
Get the file extension of the corresponding raw format. | |
GAVL_PUBLIC int | gavl_compression_need_pixelformat (gavl_codec_id_t id) |
Check if the compression supports multiple pixelformats. | |
GAVL_PUBLIC void | gavl_packet_alloc (gavl_packet_t *p, int len) |
Allocate memory for a packet. | |
GAVL_PUBLIC void | gavl_packet_free (gavl_packet_t *p) |
Free memory of a packet. | |
GAVL_PUBLIC void | gavl_packet_dump (const gavl_packet_t *p) |
Dump a packet to stderr. | |
Variables | |
gavl_codec_id_t | gavl_compression_info_t::id |
Codec ID. | |
uint8_t * | gavl_compression_info_t::global_header |
Global header. | |
int | gavl_compression_info_t::global_header_len |
Length of global header. | |
int | gavl_compression_info_t::bitrate |
Needed by some codecs, negative values mean VBR. | |
int | gavl_compression_info_t::palette_size |
Size of the embedded palette for image codecs. | |
int | gavl_packet_t::data_len |
Length of data. | |
int | gavl_packet_t::data_alloc |
How many bytes got allocated. | |
int | gavl_packet_t::flags |
ORed combination of GAVL_PACKET_* flags. | |
int64_t | gavl_packet_t::pts |
Presentation time. | |
int64_t | gavl_packet_t::duration |
Duration of the contained frame. | |
int | gavl_packet_t::field2_offset |
Offset of field 2 for field pictures. | |
int | gavl_packet_t::header_size |
Size of a repeated global header (or 0). | |
int | gavl_packet_t::sequence_end_pos |
Position of sequence end code if any. |
gavl provides some structures and functions for handling compressed data packets. It is a completely independent API layer and has nothing to do with the uncompressed video and audio API. In particular the conversion between compressed and uncompressed data (i.e. codecs) are outside the scope of gavl. These are implemented in gmerlin-avdecoder and gmerlin encoding plugins.
#define GAVL_COMPRESSION_HAS_P_FRAMES (1<<0) |
Not all frames are keyframes.
#define GAVL_COMPRESSION_HAS_B_FRAMES (1<<1) |
Frames don't appear in presentation order.
#define GAVL_COMPRESSION_HAS_FIELD_PICTURES (1<<2) |
Packets can consist of 2 consecutive fields.
#define GAVL_COMPRESSION_SBR (1<<3) |
Samplerate got doubled by decoder, format and sample counts are for the upsampled rate.
#define GAVL_PACKET_TYPE_I 'I' |
Packet is an I-frame.
#define GAVL_PACKET_TYPE_P 'P' |
Packet is a P-frame.
#define GAVL_PACKET_TYPE_B 'B' |
Packet is a B-frame.
#define GAVL_PACKET_TYPE_MASK 0xff |
Mask for frame type.
#define GAVL_PACKET_KEYFRAME (1<<8) |
Packet is a keyframe.
#define GAVL_PACKET_LAST (1<<9) |
Packet is the last in the stream (only Xiph codecs need this flag).
enum gavl_codec_id_t |
GAVL_PUBLIC void gavl_compression_info_free | ( | gavl_compression_info_t * | info | ) |
Free all dynamically allocated memory of a compression info.
info | A compression info |
GAVL_PUBLIC void gavl_compression_info_dump | ( | const gavl_compression_info_t * | info | ) |
Dump a compression info to stderr.
info | A compression info |
GAVL_PUBLIC const char* gavl_compression_get_extension | ( | gavl_codec_id_t | id, | |
int * | separate | |||
) |
Get the file extension of the corresponding raw format.
id | A codec ID | |
separate | If non-null returns 1 if each packet should be in a separate file |
Not all compression formats have a suitable elementary stream format, in this case NULL is returned for the extension. Most prominent examples are Vorbis and Theora, which can hardly exist outside an OGG container.
GAVL_PUBLIC int gavl_compression_need_pixelformat | ( | gavl_codec_id_t | id | ) |
Check if the compression supports multiple pixelformats.
id | A codec ID |
GAVL_PUBLIC void gavl_packet_alloc | ( | gavl_packet_t * | p, | |
int | len | |||
) |
Allocate memory for a packet.
p | A packet | |
len | Number of bytes you want to store in the packet |
GAVL_PUBLIC void gavl_packet_free | ( | gavl_packet_t * | p | ) |
Free memory of a packet.
p | A packet |
GAVL_PUBLIC void gavl_packet_dump | ( | const gavl_packet_t * | p | ) |
Dump a packet to stderr.
p | A packet |
gavl_codec_id_t gavl_compression_info_t::id [inherited] |
Codec ID.
uint8_t* gavl_compression_info_t::global_header [inherited] |
Global header.
int gavl_compression_info_t::global_header_len [inherited] |
Length of global header.
int gavl_compression_info_t::bitrate [inherited] |
Needed by some codecs, negative values mean VBR.
int gavl_compression_info_t::palette_size [inherited] |
Size of the embedded palette for image codecs.
int gavl_packet_t::data_len [inherited] |
Length of data.
int gavl_packet_t::data_alloc [inherited] |
How many bytes got allocated.
int gavl_packet_t::flags [inherited] |
ORed combination of GAVL_PACKET_* flags.
int64_t gavl_packet_t::pts [inherited] |
Presentation time.
int64_t gavl_packet_t::duration [inherited] |
Duration of the contained frame.
int gavl_packet_t::field2_offset [inherited] |
Offset of field 2 for field pictures.
int gavl_packet_t::header_size [inherited] |
Size of a repeated global header (or 0).
int gavl_packet_t::sequence_end_pos [inherited] |
Position of sequence end code if any.