22#ifndef GAVL_COMPRESSION_H_INCLUDED
23#define GAVL_COMPRESSION_H_INCLUDED
25#include <gavl/gavldefs.h>
45#define GAVL_COMPRESSION_HAS_P_FRAMES (1<<0)
46#define GAVL_COMPRESSION_HAS_B_FRAMES (1<<1)
47#define GAVL_COMPRESSION_HAS_FIELD_PICTURES (1<<2)
48#define GAVL_COMPRESSION_SBR (1<<3)
172#define GAVL_PACKET_TYPE_I 'I'
173#define GAVL_PACKET_TYPE_P 'P'
174#define GAVL_PACKET_TYPE_B 'B'
175#define GAVL_PACKET_TYPE_MASK 0xff
177#define GAVL_PACKET_KEYFRAME (1<<8)
178#define GAVL_PACKET_LAST (1<<9)
GAVL_PUBLIC void gavl_compression_info_dump(const gavl_compression_info_t *info)
Dump a compression info to stderr.
GAVL_PUBLIC void gavl_packet_dump(const gavl_packet_t *p)
Dump a packet to stderr.
GAVL_PUBLIC int gavl_compression_need_pixelformat(gavl_codec_id_t id)
Check if the compression supports multiple pixelformats.
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_codec_id_t
Codec ID.
Definition: compression.h:56
GAVL_PUBLIC void gavl_packet_free(gavl_packet_t *p)
Free memory of a packet.
GAVL_PUBLIC void gavl_packet_alloc(gavl_packet_t *p, int len)
Allocate memory for a packet.
GAVL_PUBLIC void gavl_compression_info_copy(gavl_compression_info_t *dst, const gavl_compression_info_t *src)
Copy a compression info.
GAVL_PUBLIC int gavl_compression_constant_frame_samples(gavl_codec_id_t id)
Check if an audio compression constant frame samples.
GAVL_PUBLIC void gavl_compression_info_free(gavl_compression_info_t *info)
Free all dynamically allocated memory of a compression info.
@ GAVL_CODEC_ID_VORBIS
Vorbis (segmented extradata and packets)
Definition: compression.h:65
@ GAVL_CODEC_ID_MPEG1
MPEG-1 video.
Definition: compression.h:73
@ GAVL_CODEC_ID_DV
DV (several variants)
Definition: compression.h:79
@ GAVL_CODEC_ID_AC3
AC3.
Definition: compression.h:63
@ GAVL_CODEC_ID_DIRAC
Complete DIRAC frames, sequence end code appended to last packet.
Definition: compression.h:78
@ GAVL_CODEC_ID_TGA
TGA image.
Definition: compression.h:72
@ GAVL_CODEC_ID_MPEG2
MPEG-2 video.
Definition: compression.h:74
@ GAVL_CODEC_ID_AAC
AAC as stored in quicktime/mp4.
Definition: compression.h:64
@ GAVL_CODEC_ID_MPEG4_ASP
MPEG-4 ASP (a.k.a. Divx4)
Definition: compression.h:75
@ GAVL_CODEC_ID_JPEG
JPEG image.
Definition: compression.h:69
@ GAVL_CODEC_ID_H264
H.264 (Annex B)
Definition: compression.h:76
@ GAVL_CODEC_ID_MP2
MPEG-1 audio layer II.
Definition: compression.h:61
@ GAVL_CODEC_ID_TIFF
TIFF image.
Definition: compression.h:71
@ GAVL_CODEC_ID_FLAC
Flac (extradata contain a file header without comment and seektable)
Definition: compression.h:66
@ GAVL_CODEC_ID_THEORA
Theora (segmented extradata)
Definition: compression.h:77
@ GAVL_CODEC_ID_MP3
MPEG-1/2 audio layer 3 CBR/VBR.
Definition: compression.h:62
@ GAVL_CODEC_ID_PNG
PNG image.
Definition: compression.h:70
@ GAVL_CODEC_ID_ALAW
alaw 2:1
Definition: compression.h:59
@ GAVL_CODEC_ID_NONE
Unknown/unsupported compression format.
Definition: compression.h:57
@ GAVL_CODEC_ID_ULAW
mu-law 2:1
Definition: compression.h:60
Compression format.
Definition: compression.h:93
gavl_codec_id_t id
Codec ID.
Definition: compression.h:95
uint8_t * global_header
Global header.
Definition: compression.h:97
int flags
ORed combination of GAVL_COMPRESSION_* flags.
Definition: compression.h:94
int global_header_len
Length of global header.
Definition: compression.h:98
int bitrate
Needed by some codecs, negative values mean VBR.
Definition: compression.h:100
int palette_size
Size of the embedded palette for image codecs.
Definition: compression.h:101
Packet structure.
Definition: compression.h:194
int data_len
Length of data.
Definition: compression.h:196
int header_size
Size of a repeated global header (or 0)
Definition: compression.h:205
uint8_t * data
Data.
Definition: compression.h:195
int64_t pts
Presentation time.
Definition: compression.h:201
int sequence_end_pos
Position of sequence end code if any.
Definition: compression.h:206
int flags
ORed combination of GAVL_PACKET_* flags.
Definition: compression.h:199
int64_t duration
Duration of the contained frame.
Definition: compression.h:202
int field2_offset
Offset of field 2 for field pictures.
Definition: compression.h:204
int data_alloc
How many bytes got allocated.
Definition: compression.h:197