gavl

compression.h
1/*****************************************************************
2 * gavl - a general purpose audio/video processing library
3 *
4 * Copyright (c) 2001 - 2024 Members of the Gmerlin project
5 * http://github.com/bplaum
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 * *****************************************************************/
20
21
22
23#ifndef GAVL_COMPRESSION_H_INCLUDED
24#define GAVL_COMPRESSION_H_INCLUDED
25
26#include <gavl/gavldefs.h>
27#include <gavl/value.h>
28
29
30#ifdef __cplusplus
31 extern "C" {
32#endif
33
34 typedef struct gavl_io_s gavl_io_t;
35
36
37
50
51
53
54#define GAVL_COMPRESSION_HAS_P_FRAMES (1<<0)
55
57#define GAVL_COMPRESSION_HAS_B_FRAMES (1<<1)
58
60#define GAVL_COMPRESSION_HAS_FIELD_PICTURES (1<<2)
61
63#define GAVL_COMPRESSION_SBR (1<<3)
64
66#define GAVL_COMPRESSION_BIG_ENDIAN (1<<4)
67
68#define GAVL_MK_FOURCC(a, b, c, d) ((a<<24)|(b<<16)|(c<<8)|d)
69
70 typedef struct gavl_compression_info_s gavl_compression_info_t;
71
72
77
78 typedef enum
79 {
80
84 GAVL_CODEC_ID_NONE = 0,
85 /* Audio */
86 GAVL_CODEC_ID_ALAW = 1,
87 GAVL_CODEC_ID_ULAW,
88 GAVL_CODEC_ID_MP2,
89 GAVL_CODEC_ID_MP3,
90 GAVL_CODEC_ID_AC3,
91 GAVL_CODEC_ID_AAC,
92 GAVL_CODEC_ID_VORBIS,
93 GAVL_CODEC_ID_FLAC,
94 GAVL_CODEC_ID_OPUS,
95 GAVL_CODEC_ID_SPEEX,
96 GAVL_CODEC_ID_DTS,
97
98 /* Video */
99 GAVL_CODEC_ID_JPEG = 0x10000,
100 GAVL_CODEC_ID_PNG,
101 GAVL_CODEC_ID_TIFF,
102 GAVL_CODEC_ID_TGA,
103 GAVL_CODEC_ID_MPEG1,
104 GAVL_CODEC_ID_MPEG2,
105 GAVL_CODEC_ID_MPEG4_ASP,
106 GAVL_CODEC_ID_H264,
107 GAVL_CODEC_ID_THEORA,
108 GAVL_CODEC_ID_DIRAC,
109 GAVL_CODEC_ID_DV,
110 GAVL_CODEC_ID_VP8,
111 GAVL_CODEC_ID_DIV3,
112
113 /* Subtitle (some video codecs can handle subtitles also */
114 GAVL_CODEC_ID_DVDSUB = 0x20000,
115 GAVL_CODEC_ID_EXTENDED = 0xffffffff,
116
117 } gavl_codec_id_t;
118
119#define GAVL_BITRATE_VBR -1
120#define GAVL_BITRATE_LOSSLESS -2
121
131
132 struct gavl_compression_info_s
133 {
134 int flags;
135 gavl_codec_id_t id;
136
137 gavl_buffer_t codec_header;
138
139 int bitrate;
140 int palette_size;
141 int pre_skip;
142
143 int video_buffer_size;
144 uint32_t codec_tag;
145 int block_align; // Needed by MS audio codecs
146 };
147
154
155GAVL_PUBLIC
156 void gavl_compression_info_init(gavl_compression_info_t * info);
157
161
162GAVL_PUBLIC
163 void gavl_compression_info_free(gavl_compression_info_t* info);
164
170
171GAVL_PUBLIC
172 void gavl_compression_info_dump(const gavl_compression_info_t * info);
173
181
182GAVL_PUBLIC
183 void gavl_compression_info_dumpi(const gavl_compression_info_t * info, int num);
184
190
191GAVL_PUBLIC
192 void gavl_compression_info_copy(gavl_compression_info_t * dst,
193 const gavl_compression_info_t * src);
194
195
196GAVL_PUBLIC
197 void gavl_compression_info_set_global_header(gavl_compression_info_t * dst,
198 const uint8_t * data, int len);
199
200
201GAVL_PUBLIC
202 void gavl_compression_info_append_global_header(gavl_compression_info_t * dst,
203 const uint8_t * data, int len);
204
205
212
213GAVL_PUBLIC
214 void gavl_append_xiph_header(gavl_buffer_t * codec_header,
215 uint8_t * header,
216 int header_len);
217
225
226GAVL_PUBLIC
227uint8_t * gavl_extract_xiph_header(gavl_buffer_t * codec_header,
228 int idx,
229 int * header_len);
230
231
246
247GAVL_PUBLIC
248 const char * gavl_compression_get_extension(gavl_codec_id_t id, int * separate);
249
258
259GAVL_PUBLIC
260 int gavl_compression_need_pixelformat(gavl_codec_id_t id);
261
266
267 const char * gavl_compression_get_mimetype(const gavl_compression_info_t * ci);
268
274
275GAVL_PUBLIC
276 int gavl_compression_constant_frame_samples(gavl_codec_id_t id);
277
282
283GAVL_PUBLIC
284 int gavl_compression_get_sample_size(gavl_codec_id_t id);
285
290
291GAVL_PUBLIC const char *
292 gavl_compression_get_long_name(gavl_codec_id_t id);
293
298
299GAVL_PUBLIC const char *
300 gavl_compression_get_short_name(gavl_codec_id_t id);
301
306
307GAVL_PUBLIC gavl_codec_id_t
308 gavl_compression_from_short_name(const char * name);
309
316
317GAVL_PUBLIC
318 int gavl_num_compressions(void);
319
327
328GAVL_PUBLIC
329 gavl_codec_id_t gavl_get_compression(int index);
330
331#define GAVL_PACKET_TYPE_I 0x01
332#define GAVL_PACKET_TYPE_P 0x02
333#define GAVL_PACKET_TYPE_B 0x03
334#define GAVL_PACKET_TYPE_MASK 0x03
335
336#define GAVL_PACKET_KEYFRAME (1<<2)
337#define GAVL_PACKET_LAST (1<<3)
338#define GAVL_PACKET_EXT (1<<4)
339#define GAVL_PACKET_REF (1<<5)
340#define GAVL_PACKET_NOOUTPUT (1<<6)
341
342#define GAVL_PACKET_HAS_FDS (1<<7)
343
344#define GAVL_PACKET_FIELD_PIC (1<<8)
345#define GAVL_PACKET_SKIP (1<<9)
346
347
348#define GAVL_PACKET_FLAG_PRIV (1<<16)
349#define GAVL_PACKET_FLAG_PUBLIC_MASK 0x0000ffff
350#define GAVL_PACKET_FLAG_PRIVATE_MASK 0xffff0000
351
352#define GAVL_PACKET_PADDING 32
353
354GAVL_PUBLIC
355 const char * gavl_coding_type_to_string(int flags);
356
357/* Extra data which can carried within a packet */
358
359 typedef enum
360 {
361 GAVL_PACKET_EXTRADATA_NONE = 0,
362 GAVL_PACKET_EXTRADATA_PALETTE,
363 GAVL_PACKET_EXTRADATA_FDS,
364 } gavl_packet_extradata_type_t;
365
366#define GAVL_PACKET_MAX_EXTRADATA 2
367
368 typedef struct
369 {
370 int fds[GAVL_MAX_PLANES];
371 int num_fds;
372 } gavl_packet_fds_t;
373
374 typedef struct
375 {
376 uint16_t r;
377 uint16_t g;
378 uint16_t b;
379 uint16_t a;
380 }
381 gavl_palette_entry_t;
382
383 typedef struct
384 {
385 gavl_palette_entry_t * entries;
386 int num_entries;
387 } gavl_palette_t;
388
389GAVL_PUBLIC gavl_palette_t *
390gavl_palette_create(void);
391
392GAVL_PUBLIC void
393gavl_palette_alloc(gavl_palette_t * pal, int num_colors);
394
395GAVL_PUBLIC void
396gavl_palette_init(gavl_palette_t * pal);
397
398GAVL_PUBLIC void
399gavl_palette_free(gavl_palette_t * pal);
400
401GAVL_PUBLIC void
402gavl_palette_destroy(gavl_palette_t * pal);
403
404GAVL_PUBLIC void
405gavl_palette_move(gavl_palette_t * dst, gavl_palette_t * src);
406
407 typedef struct
408 {
409 gavl_packet_extradata_type_t type;
410 void * data;
411 } gavl_packet_extradata_t;
412
425
426
427 typedef struct gavl_packet_s
428 {
429 gavl_buffer_t buf;
430
431 uint32_t flags;
432
433 int64_t position;
434
435 int64_t pts;
436 int64_t dts;
437 int64_t pes_pts;
438
439 int64_t duration;
440
441 uint32_t field2_offset;
442 uint32_t header_size;
443 uint32_t sequence_end_pos;
444
445 gavl_interlace_mode_t interlace_mode;
446 gavl_timecode_t timecode;
447
448 gavl_rectangle_i_t src_rect;
449 int32_t dst_x;
450 int32_t dst_y;
451
452 int32_t id;
453 int buf_idx;
454
455 gavl_packet_extradata_t ext_data[GAVL_PACKET_MAX_EXTRADATA];
456
457 // int fds[GAVL_MAX_PLANES];
458 // int num_fds;
459 } gavl_packet_t;
460
465
466GAVL_PUBLIC
467 void gavl_packet_init(gavl_packet_t * p);
468
469GAVL_PUBLIC
470gavl_packet_t * gavl_packet_create(void);
471
472
473
474GAVL_PUBLIC
475 void gavl_packet_destroy(gavl_packet_t * p);
476
477
485
486GAVL_PUBLIC
487 void gavl_packet_alloc(gavl_packet_t * p, int len);
488
492
493GAVL_PUBLIC
494 void gavl_packet_free(gavl_packet_t * p);
495
496GAVL_PUBLIC
497 void * gavl_packet_add_extradata(gavl_packet_t * p, gavl_packet_extradata_type_t type);
498
499GAVL_PUBLIC
500 void * gavl_packet_get_extradata(gavl_packet_t * p, gavl_packet_extradata_type_t type);
501
502/* Merge two consecutive fields into one */
503GAVL_PUBLIC
504 void gavl_packet_merge_field2(gavl_packet_t * p, const gavl_packet_t * field2);
505
506
511
512GAVL_PUBLIC
513 void gavl_packet_copy(gavl_packet_t * dst,
514 const gavl_packet_t * src);
515
525
526GAVL_PUBLIC
527 void gavl_packet_copy_metadata(gavl_packet_t * dst,
528 const gavl_packet_t * src);
529
530
536
537GAVL_PUBLIC
538 void gavl_packet_reset(gavl_packet_t * p);
539
540
546
547GAVL_PUBLIC
548 void gavl_packet_dump(const gavl_packet_t * p);
549
556
557GAVL_PUBLIC
558 void gavl_packet_save(const gavl_packet_t * p,
559 const char * filename);
560
561
562
563 typedef struct
564 {
565 int32_t size_min;
566 int32_t size_max;
567 int64_t duration_min;
568 int64_t duration_max;
569 int64_t pts_start;
570 int64_t pts_end;
571
572 int64_t total_bytes; // For average bitrate
573 int64_t total_packets; // For average framerate
574
575 } gavl_stream_stats_t;
576
577GAVL_PUBLIC
578 void gavl_stream_stats_init(gavl_stream_stats_t*);
579
580GAVL_PUBLIC
581 void gavl_stream_stats_dump(const gavl_stream_stats_t*, int indent);
582
583GAVL_PUBLIC
584 void gavl_stream_stats_update(gavl_stream_stats_t*,const gavl_packet_t*p);
585
586GAVL_PUBLIC
587 void gavl_stream_stats_update_end(gavl_stream_stats_t * f, const gavl_packet_t * p);
588
589GAVL_PUBLIC
590 void gavl_stream_stats_update_params(gavl_stream_stats_t * f,
591 int64_t pts, int64_t duration, int data_len,
592 int flags);
593
594
595GAVL_PUBLIC
596 void gavl_stream_stats_apply_audio(gavl_stream_stats_t * f,
597 const gavl_audio_format_t * fmt,
598 gavl_compression_info_t * ci,
599 gavl_dictionary_t * m);
600
601GAVL_PUBLIC
602 void gavl_stream_stats_apply_video(gavl_stream_stats_t * f,
603 gavl_video_format_t * fmt,
604 gavl_compression_info_t * ci,
605 gavl_dictionary_t * m);
606
607GAVL_PUBLIC
608 void gavl_stream_stats_apply_subtitle(gavl_stream_stats_t * f,
609 gavl_dictionary_t * m);
610
611GAVL_PUBLIC
612 void gavl_stream_stats_apply_generic(gavl_stream_stats_t * f,
613 gavl_compression_info_t * ci,
614 gavl_dictionary_t * m);
615
616
617GAVL_PUBLIC
618 int gavl_stream_get_stats(const gavl_dictionary_t * s, gavl_stream_stats_t * stats);
619
620GAVL_PUBLIC
621 void gavl_stream_set_stats(gavl_dictionary_t * s, const gavl_stream_stats_t * stats);
622
623/* PTS Cache */
624
625 typedef struct gavl_packet_pts_cache_s gavl_packet_pts_cache_t;
626
627GAVL_PUBLIC
628gavl_packet_pts_cache_t * gavl_packet_pts_cache_create(int size);
629
630GAVL_PUBLIC
631 void gavl_packet_pts_cache_destroy(gavl_packet_pts_cache_t *);
632
633GAVL_PUBLIC
634 void gavl_packet_pts_cache_push_packet(gavl_packet_pts_cache_t *m, const gavl_packet_t * pkt);
635
636GAVL_PUBLIC
637 void gavl_packet_pts_cache_push_frame(gavl_packet_pts_cache_t *m, const gavl_video_frame_t * f);
638
639GAVL_PUBLIC
640 int gavl_packet_pts_cache_get_first(gavl_packet_pts_cache_t *m, gavl_video_frame_t * f);
641
642GAVL_PUBLIC
643 int gavl_packet_pts_cache_get_by_pts(gavl_packet_pts_cache_t *m, gavl_packet_t * pkt,
644 int64_t pts);
645
646GAVL_PUBLIC
647 void gavl_packet_pts_cache_clear(gavl_packet_pts_cache_t *m);
648
649
650
654
655#ifdef __cplusplus
656}
657#endif
658
659
660#endif // GAVL_COMPRESSION_H_INCLUDED
gavl_compression_info_dump
GAVL_PUBLIC void gavl_compression_info_dump(const gavl_compression_info_t *info)
Dump a compression info to stderr.
gavl_packet_dump
GAVL_PUBLIC void gavl_packet_dump(const gavl_packet_t *p)
Dump a packet to stderr.
gavl_compression_need_pixelformat
GAVL_PUBLIC int gavl_compression_need_pixelformat(gavl_codec_id_t id)
Check if the compression supports multiple pixelformats.
gavl_compression_info_dumpi
GAVL_PUBLIC void gavl_compression_info_dumpi(const gavl_compression_info_t *info, int num)
Dump a compression info to stderr.
gavl_num_compressions
GAVL_PUBLIC int gavl_num_compressions(void)
Get the number of compression formats.
gavl_get_compression
GAVL_PUBLIC gavl_codec_id_t gavl_get_compression(int index)
Get a compression format for a specified index.
gavl_packet_copy_metadata
GAVL_PUBLIC void gavl_packet_copy_metadata(gavl_packet_t *dst, const gavl_packet_t *src)
Copy metadata of a packet.
gavl_packet_reset
GAVL_PUBLIC void gavl_packet_reset(gavl_packet_t *p)
Reset a packet.
gavl_compression_get_extension
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
gavl_codec_id_t
Codec ID.
Definition compression.h:79
gavl_compression_info_init
GAVL_PUBLIC void gavl_compression_info_init(gavl_compression_info_t *info)
Initialize a compression info.
gavl_compression_get_sample_size
GAVL_PUBLIC int gavl_compression_get_sample_size(gavl_codec_id_t id)
Check if an audio compression size for each samples.
gavl_packet_free
GAVL_PUBLIC void gavl_packet_free(gavl_packet_t *p)
Free memory of a packet.
gavl_packet_alloc
GAVL_PUBLIC void gavl_packet_alloc(gavl_packet_t *p, int len)
Allocate memory for a packet.
gavl_packet_copy
GAVL_PUBLIC void gavl_packet_copy(gavl_packet_t *dst, const gavl_packet_t *src)
Copy a packet.
gavl_compression_from_short_name
GAVL_PUBLIC gavl_codec_id_t gavl_compression_from_short_name(const char *name)
Get a compression from the short name.
gavl_compression_info_copy
GAVL_PUBLIC void gavl_compression_info_copy(gavl_compression_info_t *dst, const gavl_compression_info_t *src)
Copy a compression info.
gavl_packet_save
GAVL_PUBLIC void gavl_packet_save(const gavl_packet_t *p, const char *filename)
Save a packet to a file.
gavl_extract_xiph_header
GAVL_PUBLIC uint8_t * gavl_extract_xiph_header(gavl_buffer_t *codec_header, int idx, int *header_len)
Extract a Xiph packet to a global header.
gavl_compression_get_long_name
GAVL_PUBLIC const char * gavl_compression_get_long_name(gavl_codec_id_t id)
Return the long name of the compression.
gavl_compression_constant_frame_samples
GAVL_PUBLIC int gavl_compression_constant_frame_samples(gavl_codec_id_t id)
Check if an audio compression constant frame samples.
gavl_packet_init
GAVL_PUBLIC void gavl_packet_init(gavl_packet_t *p)
Initialize a packet.
gavl_append_xiph_header
GAVL_PUBLIC void gavl_append_xiph_header(gavl_buffer_t *codec_header, uint8_t *header, int header_len)
Append a Xiph packet to a global header.
gavl_compression_info_free
GAVL_PUBLIC void gavl_compression_info_free(gavl_compression_info_t *info)
Free all dynamically allocated memory of a compression info.
gavl_compression_get_short_name
GAVL_PUBLIC const char * gavl_compression_get_short_name(gavl_codec_id_t id)
Return the short name of the compression.
gavl_compression_get_mimetype
const char * gavl_compression_get_mimetype(const gavl_compression_info_t *ci)
Get the mimetype for the corresponding elementary format.
GAVL_CODEC_ID_VORBIS
@ GAVL_CODEC_ID_VORBIS
Vorbis (segmented extradata and packets).
Definition compression.h:92
GAVL_CODEC_ID_SPEEX
@ GAVL_CODEC_ID_SPEEX
Speex.
Definition compression.h:95
GAVL_CODEC_ID_DTS
@ GAVL_CODEC_ID_DTS
DTS.
Definition compression.h:96
GAVL_CODEC_ID_MPEG1
@ GAVL_CODEC_ID_MPEG1
MPEG-1 video.
Definition compression.h:103
GAVL_CODEC_ID_DV
@ GAVL_CODEC_ID_DV
DV (several variants).
Definition compression.h:109
GAVL_CODEC_ID_AC3
@ GAVL_CODEC_ID_AC3
AC3.
Definition compression.h:90
GAVL_CODEC_ID_DIRAC
@ GAVL_CODEC_ID_DIRAC
Complete DIRAC frames, sequence end code appended to last packet.
Definition compression.h:108
GAVL_CODEC_ID_TGA
@ GAVL_CODEC_ID_TGA
TGA image.
Definition compression.h:102
GAVL_CODEC_ID_MPEG2
@ GAVL_CODEC_ID_MPEG2
MPEG-2 video.
Definition compression.h:104
GAVL_CODEC_ID_AAC
@ GAVL_CODEC_ID_AAC
AAC as stored in quicktime/mp4.
Definition compression.h:91
GAVL_CODEC_ID_VP8
@ GAVL_CODEC_ID_VP8
VP8 (as used in webm).
Definition compression.h:110
GAVL_CODEC_ID_MPEG4_ASP
@ GAVL_CODEC_ID_MPEG4_ASP
MPEG-4 ASP (a.k.a. Divx4).
Definition compression.h:105
GAVL_CODEC_ID_JPEG
@ GAVL_CODEC_ID_JPEG
JPEG image.
Definition compression.h:99
GAVL_CODEC_ID_H264
@ GAVL_CODEC_ID_H264
H.264 (Annex B).
Definition compression.h:106
GAVL_CODEC_ID_MP2
@ GAVL_CODEC_ID_MP2
MPEG-1 audio layer II.
Definition compression.h:88
GAVL_CODEC_ID_TIFF
@ GAVL_CODEC_ID_TIFF
TIFF image.
Definition compression.h:101
GAVL_CODEC_ID_FLAC
@ GAVL_CODEC_ID_FLAC
Flac (extradata contain a file header without comment and seektable).
Definition compression.h:93
GAVL_CODEC_ID_THEORA
@ GAVL_CODEC_ID_THEORA
Theora (segmented extradata).
Definition compression.h:107
GAVL_CODEC_ID_DIV3
@ GAVL_CODEC_ID_DIV3
Old style Divx (aka MSMPEG4V3).
Definition compression.h:111
GAVL_CODEC_ID_MP3
@ GAVL_CODEC_ID_MP3
MPEG-1/2 audio layer 3 CBR/VBR.
Definition compression.h:89
GAVL_CODEC_ID_DVDSUB
@ GAVL_CODEC_ID_DVDSUB
DVD subtitles, palette is in header.
Definition compression.h:114
GAVL_CODEC_ID_PNG
@ GAVL_CODEC_ID_PNG
PNG image.
Definition compression.h:100
GAVL_CODEC_ID_ALAW
@ GAVL_CODEC_ID_ALAW
alaw 2:1
Definition compression.h:86
GAVL_CODEC_ID_NONE
@ GAVL_CODEC_ID_NONE
Unknown/unsupported compression format. In gavf files this signals that the stream consists of uncomp...
Definition compression.h:84
GAVL_CODEC_ID_OPUS
@ GAVL_CODEC_ID_OPUS
Opus.
Definition compression.h:94
GAVL_CODEC_ID_EXTENDED
@ GAVL_CODEC_ID_EXTENDED
Separate compression id.
Definition compression.h:115
GAVL_CODEC_ID_ULAW
@ GAVL_CODEC_ID_ULAW
mu-law 2:1
Definition compression.h:87
gavl_timecode_t
uint64_t gavl_timecode_t
Typedef for timecodes.
Definition timecode.h:44
gavl_video_format_t
struct gavl_video_format_s gavl_video_format_t
Video format.
Definition gavl.h:102
gavl_interlace_mode_t
gavl_interlace_mode_t
Interlace mode.
Definition gavl.h:2331
GAVL_MAX_PLANES
#define GAVL_MAX_PLANES
Definition gavl.h:1433
gavl_audio_format_t
Audio Format.
Definition gavl.h:273
gavl_compression_info_s
Compression format.
Definition compression.h:133
gavl_compression_info_s::pre_skip
int pre_skip
Samples to skip at the start.
Definition compression.h:141
gavl_compression_info_s::id
gavl_codec_id_t id
Codec ID.
Definition compression.h:135
gavl_compression_info_s::bitrate
int bitrate
Needed by some codecs, negative values mean VBR.
Definition compression.h:139
gavl_compression_info_s::codec_header
gavl_buffer_t codec_header
Global header.
Definition compression.h:137
gavl_compression_info_s::palette_size
int palette_size
Size of the embedded palette for image codecs.
Definition compression.h:140
gavl_compression_info_s::video_buffer_size
int video_buffer_size
VBV buffer size for video (in BYTES).
Definition compression.h:143
gavl_compression_info_s::flags
int flags
ORed combination of GAVL_COMPRESSION_* flags.
Definition compression.h:134
gavl_packet_extradata_t
Definition compression.h:408
gavl_packet_fds_t
Definition compression.h:369
gavl_packet_s
Packet structure.
Definition compression.h:428
gavl_packet_s::dts
int64_t dts
Decoding time.
Definition compression.h:436
gavl_packet_s::pes_pts
int64_t pes_pts
PTS from the PES stream (probably in another scale).
Definition compression.h:437
gavl_packet_s::timecode
gavl_timecode_t timecode
Timecode.
Definition compression.h:446
gavl_packet_s::sequence_end_pos
uint32_t sequence_end_pos
Position of sequence end code if any.
Definition compression.h:443
gavl_packet_s::src_rect
gavl_rectangle_i_t src_rect
Rectangle to take from a video frame.
Definition compression.h:448
gavl_packet_s::position
int64_t position
Position of the packet in the file. The exact meaning is format dependent.
Definition compression.h:433
gavl_packet_s::pts
int64_t pts
Presentation time.
Definition compression.h:435
gavl_packet_s::id
int32_t id
ID of the gavf stream where this packet belongs.
Definition compression.h:452
gavl_packet_s::dst_y
int32_t dst_y
Y-coordinate in the destination frame (for overlays).
Definition compression.h:450
gavl_packet_s::buf
gavl_buffer_t buf
Data.
Definition compression.h:429
gavl_packet_s::dst_x
int32_t dst_x
X-coordinate in the destination frame (for overlays).
Definition compression.h:449
gavl_packet_s::interlace_mode
gavl_interlace_mode_t interlace_mode
Interlace mode for mixed interlacing.
Definition compression.h:445
gavl_packet_s::flags
uint32_t flags
ORed combination of GAVL_PACKET_* flags.
Definition compression.h:431
gavl_packet_s::header_size
uint32_t header_size
Size of a repeated global header (or 0).
Definition compression.h:442
gavl_packet_s::field2_offset
uint32_t field2_offset
Offset of field 2 for field pictures.
Definition compression.h:441
gavl_packet_s::duration
int64_t duration
Duration of the contained frame.
Definition compression.h:439
gavl_palette_entry_t
Definition compression.h:375
gavl_palette_t
Definition compression.h:384
gavl_rectangle_i_t
Integer rectangle.
Definition gavl.h:1446
gavl_stream_stats_t
Definition compression.h:564