gavl
gavl.h
Go to the documentation of this file.
1/*****************************************************************
2 * gavl - a general purpose audio/video processing library
3 *
4 * Copyright (c) 2001 - 2012 Members of the Gmerlin project
5 * gmerlin-general@lists.sourceforge.net
6 * http://gmerlin.sourceforge.net
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 * *****************************************************************/
21
27#ifndef GAVL_H_INCLUDED
28#define GAVL_H_INCLUDED
29
30#include <inttypes.h>
31
32#include <gavl/gavldefs.h>
33#include <gavl/gavltime.h>
34#include <gavl/timecode.h>
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40 /* Forward declarations */
41
48typedef struct gavl_video_source_s gavl_video_source_t;
49
56typedef struct gavl_audio_source_s gavl_audio_source_t;
57
64typedef struct gavl_packet_source_s gavl_packet_source_t;
65
72typedef struct
73gavl_audio_sink_s gavl_audio_sink_t;
74
81typedef struct
82gavl_video_sink_s gavl_video_sink_t;
83
90typedef struct
91gavl_packet_sink_s gavl_packet_sink_t;
92
115typedef void (*gavl_video_process_func)(void * data, int start, int end);
116
131 void * gavl_data,
132 int start, int end,
133 void * client_data, int thread);
134
143typedef void (*gavl_video_stop_func)(void * client_data, int thread);
144
154
155
156/* Quality levels */
157
181#define GAVL_QUALITY_FASTEST 1
182
189#define GAVL_QUALITY_BEST 5
190
197#define GAVL_QUALITY_DEFAULT 2
198
210#define GAVL_ACCEL_MMX (1<<0)
211#define GAVL_ACCEL_MMXEXT (1<<1)
212#define GAVL_ACCEL_SSE (1<<2)
213#define GAVL_ACCEL_SSE2 (1<<3)
214#define GAVL_ACCEL_SSE3 (1<<4)
215#define GAVL_ACCEL_3DNOW (1<<5)
216#define GAVL_ACCEL_3DNOWEXT (1<<6)
217#define GAVL_ACCEL_SSSE3 (1<<7)
218
223GAVL_PUBLIC int gavl_accel_supported();
224
233/* Sample formats: all multibyte numbers are native endian */
234
247#define GAVL_MAX_CHANNELS 128
248
255typedef enum
256 {
266
272typedef enum
273 {
278
286typedef enum
287 {
302
311typedef struct
312 {
314 uint32_t samplerate;
315 uint32_t num_channels;
325
326
327/* Audio format -> string conversions */
328
336GAVL_PUBLIC
338
347GAVL_PUBLIC
349
355GAVL_PUBLIC
357
364GAVL_PUBLIC
366
373GAVL_PUBLIC
375
376
383GAVL_PUBLIC
385
392GAVL_PUBLIC
394
407GAVL_PUBLIC
408void gavl_audio_format_dumpi(const gavl_audio_format_t * format, int indent);
409
418GAVL_PUBLIC
420
427GAVL_PUBLIC
429
436GAVL_PUBLIC
438
445GAVL_PUBLIC
447
454GAVL_PUBLIC
456
457
458
465GAVL_PUBLIC
467
475GAVL_PUBLIC
477 const gavl_audio_format_t * src);
478
487GAVL_PUBLIC
489 const gavl_audio_format_t * format_2);
490
502GAVL_PUBLIC
504
511GAVL_PUBLIC
513
524GAVL_PUBLIC
525int gavl_nearest_samplerate(int in_rate, const int * supported);
526
527
542typedef union
543 {
544 uint8_t * u_8;
545 int8_t * s_8;
547 uint16_t * u_16;
548 int16_t * s_16;
550 uint32_t * u_32;
551 int32_t * s_32;
553 float * f;
554 double * d;
556
562typedef union
563 {
564 uint8_t * u_8[GAVL_MAX_CHANNELS];
565 int8_t * s_8[GAVL_MAX_CHANNELS];
567 uint16_t * u_16[GAVL_MAX_CHANNELS];
568 int16_t * s_16[GAVL_MAX_CHANNELS];
570 uint32_t * u_32[GAVL_MAX_CHANNELS];
571 int32_t * s_32[GAVL_MAX_CHANNELS];
574 double * d[GAVL_MAX_CHANNELS];
577
594typedef struct
595 {
599 int64_t timestamp;
602
614GAVL_PUBLIC
616
628GAVL_PUBLIC
630
640GAVL_PUBLIC
642
652GAVL_PUBLIC
654 const gavl_audio_format_t * format);
655
666GAVL_PUBLIC
668 const gavl_audio_format_t * format,
669 int num_samples);
670
671
672
683GAVL_PUBLIC
685 const gavl_audio_format_t * format,
686 int channel);
687
708GAVL_PUBLIC
710 gavl_audio_frame_t * dst,
711 const gavl_audio_frame_t * src,
712 int dst_pos,
713 int src_pos,
714 int dst_size,
715 int src_size);
716
729GAVL_PUBLIC
731 gavl_audio_frame_t * dst,
732 const gavl_audio_frame_t * src);
733
751GAVL_PUBLIC
753 gavl_audio_frame_t * src,
754 gavl_audio_frame_t * dst,
755 int start, int len);
756
769GAVL_PUBLIC
771 const gavl_audio_frame_t * f1,
772 const gavl_audio_frame_t * f2);
773
785GAVL_PUBLIC
787 const gavl_audio_frame_t * f);
788
789
800GAVL_PUBLIC
802 const gavl_audio_format_t * format,
803 uint8_t * data);
804
823GAVL_PUBLIC
825 gavl_audio_frame_t * f, int num_samples);
826
827
847GAVL_PUBLIC
849 const gavl_audio_frame_t * frame,
850 const char * name_base);
851
852
867#define GAVL_AUDIO_FRONT_TO_REAR_COPY (1<<0)
872#define GAVL_AUDIO_FRONT_TO_REAR_MUTE (1<<1)
877#define GAVL_AUDIO_FRONT_TO_REAR_DIFF (1<<2)
882#define GAVL_AUDIO_FRONT_TO_REAR_MASK \
883(GAVL_AUDIO_FRONT_TO_REAR_COPY | \
884GAVL_AUDIO_FRONT_TO_REAR_MUTE | \
885 GAVL_AUDIO_FRONT_TO_REAR_DIFF)
887/* Options for mixing stereo to mono */
888
891#define GAVL_AUDIO_STEREO_TO_MONO_LEFT (1<<3)
894#define GAVL_AUDIO_STEREO_TO_MONO_RIGHT (1<<4)
897#define GAVL_AUDIO_STEREO_TO_MONO_MIX (1<<5)
901#define GAVL_AUDIO_STEREO_TO_MONO_MASK \
902(GAVL_AUDIO_STEREO_TO_MONO_LEFT | \
903GAVL_AUDIO_STEREO_TO_MONO_RIGHT | \
904GAVL_AUDIO_STEREO_TO_MONO_MIX)
909#define GAVL_AUDIO_NORMALIZE_MIX_MATRIX (1<<6)
916typedef enum
917 {
918 GAVL_AUDIO_DITHER_NONE = 0,
919 GAVL_AUDIO_DITHER_AUTO = 1,
920 GAVL_AUDIO_DITHER_RECT = 2,
921 GAVL_AUDIO_DITHER_TRI = 3,
922 GAVL_AUDIO_DITHER_SHAPED = 4,
924
929typedef enum
930 {
938
945typedef struct gavl_audio_options_s gavl_audio_options_t;
946
953GAVL_PUBLIC
955
962GAVL_PUBLIC
964
971GAVL_PUBLIC
973
980GAVL_PUBLIC
983
984
991GAVL_PUBLIC
993
1000GAVL_PUBLIC
1003
1010GAVL_PUBLIC
1012 int flags);
1013
1020GAVL_PUBLIC
1022
1028GAVL_PUBLIC
1030
1047GAVL_PUBLIC
1049 const double ** matrix);
1050
1059GAVL_PUBLIC
1060const double **
1062
1072GAVL_PUBLIC
1074
1081GAVL_PUBLIC
1083 const gavl_audio_options_t * src);
1084
1090GAVL_PUBLIC
1092
1093
1094
1095/* Audio converter */
1096
1130typedef struct gavl_audio_converter_s gavl_audio_converter_t;
1131
1137GAVL_PUBLIC
1139
1145GAVL_PUBLIC
1147
1156GAVL_PUBLIC
1158
1159
1174GAVL_PUBLIC
1176 const gavl_audio_format_t * input_format,
1177 const gavl_audio_format_t * output_format);
1178
1193GAVL_PUBLIC
1195 const gavl_audio_format_t * format);
1196
1211GAVL_PUBLIC
1213
1214
1228GAVL_PUBLIC
1230 const gavl_audio_frame_t * input_frame,
1231 gavl_audio_frame_t * output_frame);
1232
1233
1252GAVL_PUBLIC
1254 double ratio ) ;
1255
1256
1272GAVL_PUBLIC
1274 gavl_audio_frame_t * input_frame,
1275 gavl_audio_frame_t * output_frame,
1276 double ratio);
1277
1278
1292typedef struct gavl_volume_control_s gavl_volume_control_t;
1293
1294/* Create / destroy */
1295
1301GAVL_PUBLIC
1303
1309GAVL_PUBLIC
1311
1319GAVL_PUBLIC
1321 const gavl_audio_format_t * format);
1322
1329GAVL_PUBLIC
1331 float volume);
1332
1339GAVL_PUBLIC
1341 gavl_audio_frame_t * frame);
1342
1343
1353#define GAVL_MAX_PLANES 4
1365typedef struct
1366 {
1367 int32_t x;
1368 int32_t y;
1369 int32_t w;
1370 int32_t h;
1372
1377typedef struct
1378 {
1379 double x;
1380 double y;
1381 double w;
1382 double h;
1384
1391GAVL_PUBLIC
1393 const gavl_video_format_t * format);
1394
1401GAVL_PUBLIC
1403 const gavl_video_format_t * format);
1404
1419GAVL_PUBLIC
1421 gavl_rectangle_i_t * dst_rect,
1422 const gavl_video_format_t * src_format,
1423 const gavl_video_format_t * dst_format);
1424
1436GAVL_PUBLIC
1438 gavl_rectangle_i_t * dst_rect,
1439 const gavl_video_format_t * src_format,
1440 const gavl_video_format_t * dst_format);
1441
1442
1443
1450GAVL_PUBLIC
1452
1459GAVL_PUBLIC
1461
1468GAVL_PUBLIC
1470
1477GAVL_PUBLIC
1479
1486GAVL_PUBLIC
1488
1495GAVL_PUBLIC
1497
1504GAVL_PUBLIC
1506
1513GAVL_PUBLIC
1515
1522GAVL_PUBLIC
1524
1531GAVL_PUBLIC
1533
1547GAVL_PUBLIC
1548void gavl_rectangle_i_align(gavl_rectangle_i_t * r, int h_align, int v_align);
1549
1559GAVL_PUBLIC
1561 const gavl_video_format_t * format);
1562
1563
1570GAVL_PUBLIC
1572
1579GAVL_PUBLIC
1581
1582
1583
1590GAVL_PUBLIC
1592
1599GAVL_PUBLIC
1601
1610GAVL_PUBLIC
1612
1621GAVL_PUBLIC
1623
1651GAVL_PUBLIC
1653 const gavl_video_format_t * src_format,
1654 const gavl_rectangle_f_t * src_rect,
1655 const gavl_video_format_t * dst_format,
1656 float zoom, float squeeze);
1657
1662GAVL_PUBLIC
1664
1669GAVL_PUBLIC
1671
1672
1682#define GAVL_PIXFMT_PLANAR (1<<8)
1683
1687#define GAVL_PIXFMT_RGB (1<<9)
1688
1692#define GAVL_PIXFMT_YUV (1<<10)
1693
1697#define GAVL_PIXFMT_YUVJ (1<<11)
1698
1702#define GAVL_PIXFMT_ALPHA (1<<12)
1703
1707#define GAVL_PIXFMT_GRAY (1<<13)
1708
1713typedef enum
1714 {
1718
1722
1726
1730
1734
1738
1742
1774
1781
1788
1804
1808
1825
1835
1842
1844
1847#define GAVL_PIXELFORMAT_1D_8 GAVL_GRAY_8
1850#define GAVL_PIXELFORMAT_2D_8 GAVL_GRAYA_16
1853#define GAVL_PIXELFORMAT_3D_8 GAVL_RGB_24
1856#define GAVL_PIXELFORMAT_4D_8 GAVL_RGBA_32
1857
1860#define GAVL_PIXELFORMAT_1D_16 GAVL_GRAY_16
1863#define GAVL_PIXELFORMAT_2D_16 GAVL_GRAYA_32
1866#define GAVL_PIXELFORMAT_3D_16 GAVL_RGB_48
1869#define GAVL_PIXELFORMAT_4D_16 GAVL_RGBA_64
1870
1873#define GAVL_PIXELFORMAT_1D_FLOAT GAVL_GRAY_FLOAT
1876#define GAVL_PIXELFORMAT_2D_FLOAT GAVL_GRAYA_FLOAT
1879#define GAVL_PIXELFORMAT_3D_FLOAT GAVL_RGB_FLOAT
1882#define GAVL_PIXELFORMAT_4D_FLOAT GAVL_RGBA_FLOAT
1883
1890typedef enum
1891 {
1901
1902/*
1903 * Colormodel related functions
1904 */
1905
1912#define gavl_pixelformat_is_gray(fmt) ((fmt) & GAVL_PIXFMT_GRAY)
1913
1914
1921#define gavl_pixelformat_is_rgb(fmt) ((fmt) & GAVL_PIXFMT_RGB)
1922
1929#define gavl_pixelformat_is_yuv(fmt) ((fmt) & GAVL_PIXFMT_YUV)
1930
1937#define gavl_pixelformat_is_jpeg_scaled(fmt) ((fmt) & GAVL_PIXFMT_YUVJ)
1938
1945#define gavl_pixelformat_has_alpha(fmt) ((fmt) & GAVL_PIXFMT_ALPHA)
1946
1953#define gavl_pixelformat_is_planar(fmt) ((fmt) & GAVL_PIXFMT_PLANAR)
1954
1955
1962GAVL_PUBLIC
1964
1972GAVL_PUBLIC gavl_color_channel_t
1974
1975
1982GAVL_PUBLIC
1984
1994GAVL_PUBLIC
1995void gavl_pixelformat_chroma_sub(gavl_pixelformat_t pixelformat, int * sub_h, int * sub_v);
1996
2003GAVL_PUBLIC
2005
2012GAVL_PUBLIC
2014
2021GAVL_PUBLIC
2023
2038GAVL_PUBLIC
2040 gavl_pixelformat_t dst);
2041
2055GAVL_PUBLIC gavl_pixelformat_t
2057 const gavl_pixelformat_t * dst_supported,
2058 int * penalty);
2059
2060
2061
2068GAVL_PUBLIC
2070
2080GAVL_PUBLIC
2082
2083
2090GAVL_PUBLIC
2092
2099GAVL_PUBLIC
2101
2102
2108GAVL_PUBLIC
2110
2117GAVL_PUBLIC
2119
2120/* */
2121
2130typedef enum
2131 {
2136
2143GAVL_PUBLIC
2145
2150/* Changing the values alters the gmerlin-avdecoder index format */
2151
2152typedef enum
2153 {
2159
2166GAVL_PUBLIC
2168
2173/* Changing the values alters the gmerlin-avdecoder index format */
2174
2175typedef enum
2176 {
2185
2192GAVL_PUBLIC
2194
2203GAVL_PUBLIC
2205
2206/* Video format structure */
2207
2213 {
2214 uint32_t frame_width;
2217 uint32_t image_width;
2220 /* Support for nonsquare pixels */
2221
2222 uint32_t pixel_width;
2229 uint32_t timescale;
2237 };
2238
2246GAVL_PUBLIC
2248 const gavl_video_format_t * src);
2249
2258GAVL_PUBLIC
2260 const gavl_video_format_t * format_2);
2261
2262
2273GAVL_PUBLIC
2274void gavl_video_format_get_chroma_offset(const gavl_video_format_t * format, int field, int plane,
2275 float * off_x, float * off_y);
2276
2277
2278
2291GAVL_PUBLIC
2293 const gavl_video_format_t * src);
2294
2302GAVL_PUBLIC
2304
2321GAVL_PUBLIC
2323 int pad_h, int pad_v);
2324
2325
2341GAVL_PUBLIC
2343 gavl_video_format_t * channel_format,
2345
2346
2360GAVL_PUBLIC
2362 gavl_video_format_t * field_format,
2363 int field);
2364
2365
2372GAVL_PUBLIC
2374
2387GAVL_PUBLIC
2388void gavl_video_format_dumpi(const gavl_video_format_t * format, int indent);
2389
2390
2414 {
2418 void * user_data;
2419 int64_t timestamp;
2420 int64_t duration;
2425 void (*destroy)(struct gavl_video_frame_s*, void*priv);
2429 int32_t dst_x;
2430 int32_t dst_y;
2431
2433
2434
2446GAVL_PUBLIC
2448
2459GAVL_PUBLIC
2461
2462
2463
2473GAVL_PUBLIC
2475
2487GAVL_PUBLIC
2489
2498GAVL_PUBLIC
2500 const gavl_video_format_t * format);
2501
2511GAVL_PUBLIC
2513 const gavl_video_format_t * format,
2514 const float * color);
2515
2528GAVL_PUBLIC
2530 const gavl_video_frame_t * src1,
2531 const gavl_video_frame_t * src2,
2532 const gavl_video_format_t * format);
2533
2546GAVL_PUBLIC
2547void gavl_video_frame_psnr(double * psnr,
2548 const gavl_video_frame_t * src1,
2549 const gavl_video_frame_t * src2,
2550 const gavl_video_format_t * format);
2551
2578GAVL_PUBLIC
2580 const gavl_video_frame_t * src2,
2581 gavl_video_frame_t * dst,
2582 const gavl_video_format_t * format);
2583
2597GAVL_PUBLIC
2599 gavl_video_frame_t * dst,
2600 const gavl_video_frame_t * src);
2601
2614GAVL_PUBLIC
2616 gavl_video_frame_t * dst,
2617 const gavl_video_frame_t * src, int plane);
2618
2630GAVL_PUBLIC
2632 gavl_video_frame_t * dst,
2633 const gavl_video_frame_t * src);
2634
2646GAVL_PUBLIC
2648 gavl_video_frame_t * dst,
2649 const gavl_video_frame_t * src);
2650
2662GAVL_PUBLIC
2664 gavl_video_frame_t * dst,
2665 const gavl_video_frame_t * src);
2666
2679GAVL_PUBLIC
2681 const gavl_video_frame_t * src);
2682
2683
2701GAVL_PUBLIC
2703 const gavl_video_frame_t * src,
2704 gavl_video_frame_t * dst,
2706
2722GAVL_PUBLIC
2724 const gavl_video_frame_t * src,
2725 gavl_video_frame_t * dst,
2726 int field);
2727
2728
2729
2742GAVL_PUBLIC
2744 const gavl_video_format_t * format,
2745 const char * namebase);
2746
2757GAVL_PUBLIC
2759 const gavl_video_frame_t * frame);
2760
2771GAVL_PUBLIC
2773 const gavl_video_format_t * format);
2774
2787GAVL_PUBLIC
2789 const gavl_video_format_t * format,
2790 uint8_t * buffer);
2791
2803GAVL_PUBLIC
2805 const gavl_video_frame_t * frame);
2806
2807
2822GAVL_PUBLIC
2825 const gavl_video_frame_t * src,
2826 gavl_video_frame_t * dst);
2827
2843GAVL_PUBLIC
2846 const gavl_video_frame_t * src,
2847 gavl_video_frame_t * dst);
2848
2849
2861GAVL_PUBLIC
2863 const gavl_video_frame_t * f1,
2864 const gavl_video_frame_t * f2);
2865
2866
2867/*****************************
2868 Conversion options
2869******************************/
2870
2886#define GAVL_FORCE_DEINTERLACE (1<<0)
2887
2892#define GAVL_CONVOLVE_CHROMA (1<<1)
2893
2898#define GAVL_CONVOLVE_NORMALIZE (1<<2)
2899
2907#define GAVL_RESAMPLE_CHROMA (1<<3)
2908
2916typedef enum
2917 {
2921
2928typedef enum
2929 {
2935
2942typedef enum
2943 {
2947
2952typedef enum
2953 {
2964
2974typedef enum
2975 {
2981
2988typedef struct gavl_video_options_s gavl_video_options_t;
2989
2990/* Default Options */
2991
2997GAVL_PUBLIC
2999
3009GAVL_PUBLIC
3011
3018GAVL_PUBLIC
3020 const gavl_video_options_t * src);
3021
3027GAVL_PUBLIC
3029
3030
3045GAVL_PUBLIC
3047 const gavl_rectangle_f_t * src_rect,
3048 const gavl_rectangle_i_t * dst_rect);
3049
3057GAVL_PUBLIC
3059 gavl_rectangle_f_t * src_rect,
3060 gavl_rectangle_i_t * dst_rect);
3061
3068GAVL_PUBLIC
3070
3077GAVL_PUBLIC
3079
3080
3087GAVL_PUBLIC
3089 int conversion_flags);
3090
3097GAVL_PUBLIC
3099
3106GAVL_PUBLIC
3108 gavl_alpha_mode_t alpha_mode);
3109
3116GAVL_PUBLIC gavl_alpha_mode_t
3118
3119
3126GAVL_PUBLIC
3128 gavl_scale_mode_t scale_mode);
3129
3136GAVL_PUBLIC gavl_scale_mode_t
3138
3139
3146GAVL_PUBLIC
3148 int order);
3149
3156GAVL_PUBLIC
3158
3159
3166GAVL_PUBLIC
3168 const float * color);
3169
3176GAVL_PUBLIC
3178 float * color);
3179
3186GAVL_PUBLIC
3188 gavl_deinterlace_mode_t deinterlace_mode);
3189
3196GAVL_PUBLIC gavl_deinterlace_mode_t
3198
3205GAVL_PUBLIC
3207 gavl_deinterlace_drop_mode_t deinterlace_drop_mode);
3208
3217
3226GAVL_PUBLIC
3229
3230
3239GAVL_PUBLIC gavl_downscale_filter_t
3241
3259GAVL_PUBLIC
3261 float f);
3262
3271GAVL_PUBLIC
3273
3282GAVL_PUBLIC
3284
3285
3294GAVL_PUBLIC
3296
3306GAVL_PUBLIC
3309 void * client_data);
3310
3320GAVL_PUBLIC
3323 void ** client_data);
3324
3334GAVL_PUBLIC
3337 void * client_data);
3338
3348GAVL_PUBLIC
3351 void ** client_data);
3352
3353
3354/***************************************************
3355 * Create and destroy video converters
3356 ***************************************************/
3357
3390typedef struct gavl_video_converter_s gavl_video_converter_t;
3391
3397GAVL_PUBLIC
3399
3405GAVL_PUBLIC
3407
3408/**************************************************
3409 * Get options. Change the options with the gavl_video_options_set_*
3410 * functions above
3411 **************************************************/
3412
3421GAVL_PUBLIC gavl_video_options_t *
3423
3424
3438GAVL_PUBLIC
3440 const gavl_video_format_t * input_format,
3441 const gavl_video_format_t * output_format);
3442
3455GAVL_PUBLIC
3457
3458
3459/***************************************************
3460 * Convert a frame
3461 ***************************************************/
3462
3470GAVL_PUBLIC
3472 const gavl_video_frame_t * input_frame,
3473 gavl_video_frame_t * output_frame);
3474
3506typedef struct gavl_video_scaler_s gavl_video_scaler_t;
3507
3513GAVL_PUBLIC
3515
3521GAVL_PUBLIC
3523
3532GAVL_PUBLIC gavl_video_options_t *
3534
3547GAVL_PUBLIC
3549 const gavl_video_format_t * src_format,
3550 const gavl_video_format_t * dst_format);
3551
3573GAVL_PUBLIC
3575 const gavl_video_format_t * format,
3576 int h_radius, const float * h_coeffs,
3577 int v_radius, const float * v_coeffs);
3578
3586GAVL_PUBLIC
3588 const gavl_video_frame_t * input_frame,
3589 gavl_video_frame_t * output_frame);
3590
3606typedef struct gavl_video_deinterlacer_s gavl_video_deinterlacer_t;
3607
3613GAVL_PUBLIC
3615
3621GAVL_PUBLIC
3623
3632GAVL_PUBLIC gavl_video_options_t *
3634
3645GAVL_PUBLIC
3647 const gavl_video_format_t * src_format);
3648
3649
3657GAVL_PUBLIC
3659 const gavl_video_frame_t * input_frame,
3660 gavl_video_frame_t * output_frame);
3661
3662
3663
3664/**************************************************
3665 * Transparent overlays
3666 **************************************************/
3667
3668/* Overlay struct */
3669
3698
3705typedef struct gavl_overlay_blend_context_s gavl_overlay_blend_context_t;
3706
3712GAVL_PUBLIC
3714
3720GAVL_PUBLIC
3722
3729GAVL_PUBLIC gavl_video_options_t *
3731
3747GAVL_PUBLIC
3749 const gavl_video_format_t * frame_format,
3750 gavl_video_format_t * overlay_format);
3751
3761GAVL_PUBLIC
3763 gavl_overlay_t * ovl);
3764
3771GAVL_PUBLIC
3773 gavl_video_frame_t * dst_frame);
3774
3781GAVL_PUBLIC gavl_video_sink_t *
3783
3805typedef struct gavl_image_transform_s gavl_image_transform_t;
3806
3820typedef void (*gavl_image_transform_func)(void * priv,
3821 double xdst,
3822 double ydst,
3823 double * xsrc,
3824 double * ysrc);
3825
3826
3833GAVL_PUBLIC
3835
3841GAVL_PUBLIC
3843
3862GAVL_PUBLIC
3864 gavl_video_format_t * format,
3865 gavl_image_transform_func func, void * priv);
3866
3874GAVL_PUBLIC
3876 gavl_video_frame_t * in_frame,
3877 gavl_video_frame_t * out_frame);
3878
3889GAVL_PUBLIC gavl_video_options_t *
3891
3914typedef struct
3915 {
3916 int64_t offset;
3917 /* Primary */
3918 int64_t num_entries;
3920
3921 struct
3922 {
3923 int64_t num_frames;
3924 int64_t duration;
3925 } * entries;
3926
3929
3930 struct
3931 {
3932 int64_t pts;
3934 } * timecodes;
3935
3936 /* Secondary */
3937
3939
3946
3957GAVL_PUBLIC gavl_frame_table_t *
3958gavl_frame_table_create_audio(int samplerate, int64_t offset, int64_t duration,
3959 gavl_timecode_format_t * fmt_ret);
3960
3971GAVL_PUBLIC gavl_frame_table_t *
3972gavl_frame_table_create_cfr(int64_t offset, int64_t frame_duration,
3973 int64_t num_frames,
3974 gavl_timecode_t start_timecode);
3975
3983GAVL_PUBLIC gavl_frame_table_t *
3985
3986
3987
3995
4003GAVL_PUBLIC void gavl_frame_table_append_entry(gavl_frame_table_t * t, int64_t duration);
4004
4013GAVL_PUBLIC void
4015 int64_t pts, gavl_timecode_t tc);
4016
4027GAVL_PUBLIC int64_t
4029 int64_t frame, int * duration);
4030
4041GAVL_PUBLIC int64_t
4043 int64_t time,
4044 int64_t * start_time);
4045
4056GAVL_PUBLIC gavl_timecode_t
4058 int64_t time,
4059 int64_t * start_time,
4060 const gavl_timecode_format_t * fmt);
4061
4071GAVL_PUBLIC int64_t
4073 gavl_timecode_t tc,
4074 const gavl_timecode_format_t * fmt);
4075
4076
4087GAVL_PUBLIC gavl_timecode_t
4089 int64_t frame,
4090 int64_t * start_time,
4091 const gavl_timecode_format_t * fmt);
4092
4093
4094
4102GAVL_PUBLIC int64_t
4104
4112GAVL_PUBLIC int64_t
4114
4122GAVL_PUBLIC int64_t
4124
4133GAVL_PUBLIC
4135 const char * filename);
4136
4144GAVL_PUBLIC
4146
4153GAVL_PUBLIC void
4155
4183typedef struct gavl_video_frame_pool_s gavl_video_frame_pool_t;
4184
4191GAVL_PUBLIC
4194 void * priv);
4195
4201GAVL_PUBLIC
4203
4211GAVL_PUBLIC
4213
4221GAVL_PUBLIC
4223
4229#ifdef __cplusplus
4230}
4231#endif
4232
4233#endif /* GAVL_H_INCLUDED */
GAVL_PUBLIC gavl_deinterlace_mode_t gavl_video_options_get_deinterlace_mode(const gavl_video_options_t *opt)
Get the deinterlace mode.
GAVL_PUBLIC void gavl_video_options_set_deinterlace_mode(gavl_video_options_t *opt, gavl_deinterlace_mode_t deinterlace_mode)
Set the deinterlace mode.
GAVL_PUBLIC int gavl_accel_supported()
Get the supported acceleration flags.
GAVL_PUBLIC gavl_audio_options_t * gavl_audio_converter_get_options(gavl_audio_converter_t *cnv)
gets options of an audio converter
GAVL_PUBLIC void gavl_audio_converter_resample(gavl_audio_converter_t *cnv, gavl_audio_frame_t *input_frame, gavl_audio_frame_t *output_frame, double ratio)
Convert audio.
GAVL_PUBLIC void gavl_audio_converter_destroy(gavl_audio_converter_t *cnv)
Destroys an audio converter and frees all associated memory.
GAVL_PUBLIC gavl_audio_converter_t * gavl_audio_converter_create()
Creates an audio converter.
struct gavl_audio_converter_s gavl_audio_converter_t
Opaque audio converter structure.
Definition: gavl.h:1130
GAVL_PUBLIC void gavl_audio_convert(gavl_audio_converter_t *cnv, const gavl_audio_frame_t *input_frame, gavl_audio_frame_t *output_frame)
Convert audio.
GAVL_PUBLIC int gavl_audio_converter_init(gavl_audio_converter_t *cnv, const gavl_audio_format_t *input_format, const gavl_audio_format_t *output_format)
Initialize an audio converter.
GAVL_PUBLIC int gavl_audio_converter_init_resample(gavl_audio_converter_t *cnv, const gavl_audio_format_t *format)
Initialize an audio converter just for resampling.
GAVL_PUBLIC int gavl_audio_converter_set_resample_ratio(gavl_audio_converter_t *cnv, double ratio)
Set samplerate converstion ratio.
GAVL_PUBLIC int gavl_audio_converter_reinit(gavl_audio_converter_t *cnv)
Reinitialize an audio converter.
gavl_channel_id_t
Audio channel setup.
Definition: gavl.h:287
gavl_sample_format_t
Format of one audio sample.
Definition: gavl.h:256
GAVL_PUBLIC void gavl_audio_format_copy(gavl_audio_format_t *dst, const gavl_audio_format_t *src)
Copy one audio format to another.
GAVL_PUBLIC int gavl_channel_index(const gavl_audio_format_t *format, gavl_channel_id_t id)
Get the index of a particular channel for a given format.
GAVL_PUBLIC int gavl_side_channels(const gavl_audio_format_t *format)
Get number of side channels for a given format.
GAVL_PUBLIC void gavl_set_channel_setup(gavl_audio_format_t *format)
Set the default channel setup and indices.
GAVL_PUBLIC int gavl_lfe_channels(const gavl_audio_format_t *format)
Get number of LFE channels for a given format.
GAVL_PUBLIC gavl_sample_format_t gavl_get_sample_format(int index)
Get the sample format from index.
GAVL_PUBLIC const char * gavl_channel_id_to_string(gavl_channel_id_t id)
Convert a gavl_channel_id_t to a human readable string.
GAVL_PUBLIC void gavl_audio_format_dumpi(const gavl_audio_format_t *format, int indent)
Dump an audio format to stderr.
GAVL_PUBLIC int gavl_nearest_samplerate(int in_rate, const int *supported)
Get the nearest samplerate out of a list of supported rates.
GAVL_PUBLIC const char * gavl_sample_format_to_string(gavl_sample_format_t format)
Convert a gavl_sample_format_t to a human readable string.
GAVL_PUBLIC int gavl_num_sample_formats()
Get total number of supported sample formats.
gavl_interleave_mode_t
Definition: gavl.h:273
GAVL_PUBLIC gavl_sample_format_t gavl_string_to_sample_format(const char *str)
Convert a string to a sample format.
GAVL_PUBLIC int gavl_front_channels(const gavl_audio_format_t *format)
Get number of front channels for a given format.
GAVL_PUBLIC int gavl_bytes_per_sample(gavl_sample_format_t format)
Get the number of bytes per sample for a given sample format.
GAVL_PUBLIC void gavl_audio_format_dump(const gavl_audio_format_t *format)
Dump an audio format to stderr.
GAVL_PUBLIC int gavl_aux_channels(const gavl_audio_format_t *format)
Get number of aux channels for a given format.
GAVL_PUBLIC int gavl_rear_channels(const gavl_audio_format_t *format)
Get number of rear channels for a given format.
GAVL_PUBLIC const char * gavl_interleave_mode_to_string(gavl_interleave_mode_t mode)
Convert a gavl_interleave_mode_t to a human readable string.
GAVL_PUBLIC int gavl_audio_formats_equal(const gavl_audio_format_t *format_1, const gavl_audio_format_t *format_2)
Compare 2 audio formats.
#define GAVL_MAX_CHANNELS
Maximum number of audio channels.
Definition: gavl.h:247
@ GAVL_CHID_SIDE_RIGHT
Definition: gavl.h:298
@ GAVL_CHID_FRONT_RIGHT
Definition: gavl.h:291
@ GAVL_CHID_FRONT_LEFT
Definition: gavl.h:290
@ GAVL_CHID_REAR_LEFT
Definition: gavl.h:294
@ GAVL_CHID_SIDE_LEFT
Definition: gavl.h:297
@ GAVL_CHID_NONE
Definition: gavl.h:288
@ GAVL_CHID_FRONT_CENTER_LEFT
Definition: gavl.h:292
@ GAVL_CHID_REAR_CENTER
Definition: gavl.h:296
@ GAVL_CHID_LFE
Definition: gavl.h:299
@ GAVL_CHID_REAR_RIGHT
Definition: gavl.h:295
@ GAVL_CHID_AUX
Definition: gavl.h:300
@ GAVL_CHID_FRONT_CENTER_RIGHT
Definition: gavl.h:293
@ GAVL_CHID_FRONT_CENTER
Definition: gavl.h:289
@ GAVL_SAMPLE_FLOAT
Definition: gavl.h:263
@ GAVL_SAMPLE_NONE
Definition: gavl.h:257
@ GAVL_SAMPLE_U8
Definition: gavl.h:258
@ GAVL_SAMPLE_S8
Definition: gavl.h:259
@ GAVL_SAMPLE_U16
Definition: gavl.h:260
@ GAVL_SAMPLE_S16
Definition: gavl.h:261
@ GAVL_SAMPLE_DOUBLE
Definition: gavl.h:264
@ GAVL_SAMPLE_S32
Definition: gavl.h:262
@ GAVL_INTERLEAVE_2
Definition: gavl.h:275
@ GAVL_INTERLEAVE_ALL
Definition: gavl.h:276
@ GAVL_INTERLEAVE_NONE
Definition: gavl.h:274
GAVL_PUBLIC void gavl_audio_frame_destroy(gavl_audio_frame_t *frame)
Destroy an audio frame.
GAVL_PUBLIC void gavl_audio_frame_mute(gavl_audio_frame_t *frame, const gavl_audio_format_t *format)
Mute an audio frame.
GAVL_PUBLIC void gavl_audio_frame_null(gavl_audio_frame_t *frame)
Zero all pointers in the audio frame.
GAVL_PUBLIC void gavl_audio_frame_set_channels(gavl_audio_frame_t *f, const gavl_audio_format_t *format, uint8_t *data)
Set the channel pointers of an audio frame.
GAVL_PUBLIC void gavl_audio_frame_mute_samples(gavl_audio_frame_t *frame, const gavl_audio_format_t *format, int num_samples)
Mute a number of samples at the start of an audio frame.
GAVL_PUBLIC int gavl_audio_frame_copy(const gavl_audio_format_t *format, gavl_audio_frame_t *dst, const gavl_audio_frame_t *src, int dst_pos, int src_pos, int dst_size, int src_size)
Copy audio data from one frame to another.
GAVL_PUBLIC int gavl_audio_frame_skip(const gavl_audio_format_t *format, gavl_audio_frame_t *f, int num_samples)
Skip samples in am audio frame.
GAVL_PUBLIC gavl_audio_frame_t * gavl_audio_frame_create(const gavl_audio_format_t *format)
Create audio frame.
GAVL_PUBLIC void gavl_audio_frame_get_subframe(const gavl_audio_format_t *format, gavl_audio_frame_t *src, gavl_audio_frame_t *dst, int start, int len)
Set an audio frame to a subframe of another frame.
GAVL_PUBLIC void gavl_audio_frame_mute_channel(gavl_audio_frame_t *frame, const gavl_audio_format_t *format, int channel)
Mute a single channel of an audio frame.
GAVL_PUBLIC int gavl_audio_frame_plot(const gavl_audio_format_t *format, const gavl_audio_frame_t *frame, const char *name_base)
Plot an audio frame to an ASCII file.
GAVL_PUBLIC int gavl_audio_frames_equal(const gavl_audio_format_t *format, const gavl_audio_frame_t *f1, const gavl_audio_frame_t *f2)
Check if 2 audio frames are bit-identical.
GAVL_PUBLIC void gavl_audio_frame_copy_ptrs(const gavl_audio_format_t *format, gavl_audio_frame_t *dst, const gavl_audio_frame_t *src)
Copy audio data from one frame to another.
GAVL_PUBLIC int gavl_audio_frame_continuous(const gavl_audio_format_t *format, const gavl_audio_frame_t *f)
Check if an audio frames is continuous in memory.
struct gavl_audio_options_s gavl_audio_options_t
Opaque container for audio conversion options.
Definition: gavl.h:945
GAVL_PUBLIC void gavl_audio_options_set_resample_mode(gavl_audio_options_t *opt, gavl_resample_mode_t mode)
Set the resample mode for the converter.
GAVL_PUBLIC void gavl_audio_options_copy(gavl_audio_options_t *dst, const gavl_audio_options_t *src)
Copy audio options.
GAVL_PUBLIC gavl_audio_options_t * gavl_audio_options_create()
Create an options container.
gavl_audio_dither_mode_t
Dither mode.
Definition: gavl.h:917
GAVL_PUBLIC void gavl_audio_options_set_conversion_flags(gavl_audio_options_t *opt, int flags)
Set the conversion flags.
GAVL_PUBLIC gavl_audio_dither_mode_t gavl_audio_options_get_dither_mode(const gavl_audio_options_t *opt)
Get the dither mode for the converter.
GAVL_PUBLIC void gavl_audio_options_set_defaults(gavl_audio_options_t *opt)
Set all options to their defaults.
GAVL_PUBLIC void gavl_audio_options_set_mix_matrix(gavl_audio_options_t *opt, const double **matrix)
Set a user defined mix matrix.
GAVL_PUBLIC void gavl_audio_options_set_dither_mode(gavl_audio_options_t *opt, gavl_audio_dither_mode_t mode)
Set the dither mode for the converter.
gavl_resample_mode_t
Resample mode.
Definition: gavl.h:930
GAVL_PUBLIC const double ** gavl_audio_options_get_mix_matrix(const gavl_audio_options_t *opt)
Get the mix matrix.
GAVL_PUBLIC int gavl_audio_options_get_quality(const gavl_audio_options_t *opt)
Get the quality level for a converter.
GAVL_PUBLIC gavl_resample_mode_t gavl_audio_options_get_resample_mode(const gavl_audio_options_t *opt)
Get the resample mode for the converter.
GAVL_PUBLIC void gavl_audio_options_destroy(gavl_audio_options_t *opt)
Destroy audio options.
GAVL_PUBLIC int gavl_audio_options_get_conversion_flags(const gavl_audio_options_t *opt)
Get the conversion flags.
GAVL_PUBLIC void gavl_audio_options_set_quality(gavl_audio_options_t *opt, int quality)
Set the quality level for the converter.
@ GAVL_RESAMPLE_SINC_BEST
Definition: gavl.h:936
@ GAVL_RESAMPLE_ZOH
Definition: gavl.h:932
@ GAVL_RESAMPLE_LINEAR
Definition: gavl.h:933
@ GAVL_RESAMPLE_AUTO
Definition: gavl.h:931
@ GAVL_RESAMPLE_SINC_MEDIUM
Definition: gavl.h:935
@ GAVL_RESAMPLE_SINC_FAST
Definition: gavl.h:934
GAVL_PUBLIC int gavl_frame_table_save(const gavl_frame_table_t *t, const char *filename)
Save a frame table to a file.
GAVL_PUBLIC int64_t gavl_frame_table_end_time(const gavl_frame_table_t *t)
get the end time of the last frame
GAVL_PUBLIC gavl_frame_table_t * gavl_frame_table_load(const char *filename)
Load a frame table from a file.
GAVL_PUBLIC int64_t gavl_frame_table_frame_to_time(const gavl_frame_table_t *t, int64_t frame, int *duration)
Convert a frame index to a timestamp.
GAVL_PUBLIC gavl_timecode_t gavl_frame_table_frame_to_timecode(const gavl_frame_table_t *t, int64_t frame, int64_t *start_time, const gavl_timecode_format_t *fmt)
Convert a frame index to a timecode.
GAVL_PUBLIC void gavl_frame_table_dump(const gavl_frame_table_t *t)
Dump a frame table to stderr for debugging.
GAVL_PUBLIC gavl_timecode_t gavl_frame_table_time_to_timecode(const gavl_frame_table_t *t, int64_t time, int64_t *start_time, const gavl_timecode_format_t *fmt)
Convert a timestamp to a timecode.
GAVL_PUBLIC int64_t gavl_frame_table_time_to_frame(const gavl_frame_table_t *t, int64_t time, int64_t *start_time)
Convert a timestamp to a frame index.
GAVL_PUBLIC int64_t gavl_frame_table_duration(const gavl_frame_table_t *t)
get the total duration of all frames
GAVL_PUBLIC void gavl_frame_table_destroy(gavl_frame_table_t *t)
Destroy a frame table and free all memory.
GAVL_PUBLIC int64_t gavl_frame_table_num_frames(const gavl_frame_table_t *t)
get the total number of frames
GAVL_PUBLIC gavl_frame_table_t * gavl_frame_table_create_cfr(int64_t offset, int64_t frame_duration, int64_t num_frames, gavl_timecode_t start_timecode)
Create a frame table for constant framerate video.
GAVL_PUBLIC void gavl_frame_table_append_entry(gavl_frame_table_t *t, int64_t duration)
Append an entry.
GAVL_PUBLIC void gavl_frame_table_append_timecode(gavl_frame_table_t *t, int64_t pts, gavl_timecode_t tc)
Append a timecodes.
GAVL_PUBLIC gavl_frame_table_t * gavl_frame_table_create()
Create a frame table.
GAVL_PUBLIC gavl_frame_table_t * gavl_frame_table_create_audio(int samplerate, int64_t offset, int64_t duration, gavl_timecode_format_t *fmt_ret)
Create a frame table for an audio stream.
GAVL_PUBLIC int64_t gavl_frame_table_timecode_to_time(const gavl_frame_table_t *t, gavl_timecode_t tc, const gavl_timecode_format_t *fmt)
Convert a timecode to a timestamp.
GAVL_PUBLIC gavl_frame_table_t * gavl_frame_table_copy(const gavl_frame_table_t *tab)
Copy a frame table to another.
void(* gavl_video_stop_func)(void *client_data, int thread)
Wait until a piece of a calculation finished.
Definition: gavl.h:143
void(* gavl_video_process_func)(void *data, int start, int end)
Prototype of a process function.
Definition: gavl.h:115
void(* gavl_video_run_func)(gavl_video_process_func func, void *gavl_data, int start, int end, void *client_data, int thread)
Run a piece of a calculation.
Definition: gavl.h:130
GAVL_PUBLIC void gavl_rectangle_f_crop_bottom(gavl_rectangle_f_t *r, double num_pixels)
Crop a float rectangle by some pixels from the bottom border.
GAVL_PUBLIC int gavl_rectangle_f_is_empty(const gavl_rectangle_f_t *r)
Check if a float rectangle is empty.
GAVL_PUBLIC int gavl_rectangle_i_is_empty(const gavl_rectangle_i_t *r)
Check if an integer rectangle is empty.
GAVL_PUBLIC void gavl_rectangle_f_crop_left(gavl_rectangle_f_t *r, double num_pixels)
Crop a float rectangle by some pixels from the left border.
GAVL_PUBLIC void gavl_rectangle_i_align(gavl_rectangle_i_t *r, int h_align, int v_align)
Align a rectangle.
GAVL_PUBLIC void gavl_rectangle_crop_to_format_scale(gavl_rectangle_f_t *src_rect, gavl_rectangle_i_t *dst_rect, const gavl_video_format_t *src_format, const gavl_video_format_t *dst_format)
Crop 2 rectangles to their formats when scaling is available.
GAVL_PUBLIC void gavl_rectangle_i_copy(gavl_rectangle_i_t *dst, const gavl_rectangle_i_t *src)
Copy an integer rectangle.
GAVL_PUBLIC void gavl_rectangle_f_crop_right(gavl_rectangle_f_t *r, double num_pixels)
Crop a float rectangle by some pixels from the right border.
GAVL_PUBLIC void gavl_rectangle_i_dump(const gavl_rectangle_i_t *r)
Dump a rectangle to stderr.
GAVL_PUBLIC void gavl_rectangle_i_crop_top(gavl_rectangle_i_t *r, int num_pixels)
Crop an integer rectangle by some pixels from the top border.
GAVL_PUBLIC void gavl_rectangle_i_crop_to_format(gavl_rectangle_i_t *r, const gavl_video_format_t *format)
Crop an integer rectangle so it fits into the image size of a video format.
GAVL_PUBLIC void gavl_rectangle_crop_to_format_noscale(gavl_rectangle_i_t *src_rect, gavl_rectangle_i_t *dst_rect, const gavl_video_format_t *src_format, const gavl_video_format_t *dst_format)
Set 2 rectangles as source and destination when no scaling is available.
GAVL_PUBLIC void gavl_rectangle_fit_aspect(gavl_rectangle_i_t *dst_rect, const gavl_video_format_t *src_format, const gavl_rectangle_f_t *src_rect, const gavl_video_format_t *dst_format, float zoom, float squeeze)
Calculate a destination rectangle for scaling.
GAVL_PUBLIC void gavl_rectangle_i_to_f(gavl_rectangle_f_t *dst, const gavl_rectangle_i_t *src)
Convert an integer rectangle to a floating point rectangle.
GAVL_PUBLIC void gavl_rectangle_i_set_all(gavl_rectangle_i_t *r, const gavl_video_format_t *format)
Let an integer rectangle span the whole image size of a video format.
GAVL_PUBLIC void gavl_rectangle_f_set_all(gavl_rectangle_f_t *r, const gavl_video_format_t *format)
Let a float rectangle span the whole image size of a video format.
GAVL_PUBLIC void gavl_rectangle_f_copy(gavl_rectangle_f_t *dst, const gavl_rectangle_f_t *src)
Copy a float rectangle.
GAVL_PUBLIC void gavl_rectangle_f_to_i(gavl_rectangle_i_t *dst, const gavl_rectangle_f_t *src)
Convert a floating point rectangle to an integer rectangle.
GAVL_PUBLIC void gavl_rectangle_f_crop_top(gavl_rectangle_f_t *r, double num_pixels)
Crop a float rectangle by some pixels from the top border.
GAVL_PUBLIC void gavl_rectangle_f_dump(const gavl_rectangle_f_t *r)
Dump a floating point rectangle to stderr.
GAVL_PUBLIC void gavl_rectangle_i_crop_bottom(gavl_rectangle_i_t *r, int num_pixels)
Crop an integer rectangle by some pixels from the bottom border.
GAVL_PUBLIC void gavl_rectangle_i_align_to_format(gavl_rectangle_i_t *r, const gavl_video_format_t *format)
Align a rectangle to a format.
GAVL_PUBLIC void gavl_rectangle_f_crop_to_format(gavl_rectangle_f_t *r, const gavl_video_format_t *format)
Crop a floating point rectangle so it fits into the image size of a video format.
GAVL_PUBLIC void gavl_rectangle_i_crop_left(gavl_rectangle_i_t *r, int num_pixels)
Crop an integer rectangle by some pixels from the left border.
GAVL_PUBLIC void gavl_rectangle_i_crop_right(gavl_rectangle_i_t *r, int num_pixels)
Crop an integer rectangle by some pixels from the right border.
struct gavl_video_sink_s gavl_video_sink_t
Video sink.
Definition: gavl.h:81
struct gavl_audio_sink_s gavl_audio_sink_t
Audio sink.
Definition: gavl.h:72
struct gavl_packet_sink_s gavl_packet_sink_t
Packet sink.
Definition: gavl.h:90
struct gavl_video_source_s gavl_video_source_t
Forward declaration of the video source.
Definition: gavl.h:48
struct gavl_audio_source_s gavl_audio_source_t
Forward declaration of the audio source.
Definition: gavl.h:56
struct gavl_packet_source_s gavl_packet_source_t
Forward declaration of the packet source.
Definition: gavl.h:64
uint64_t gavl_timecode_t
Typedef for timecodes.
Definition: timecode.h:43
GAVL_PUBLIC void gavl_overlay_blend(gavl_overlay_blend_context_t *ctx, gavl_video_frame_t *dst_frame)
Blend overlay onto video frame.
GAVL_PUBLIC void gavl_overlay_blend_context_set_overlay(gavl_overlay_blend_context_t *ctx, gavl_overlay_t *ovl)
Set a new overlay.
gavl_video_frame_t gavl_overlay_t
Overlay structure.
Definition: gavl.h:3697
GAVL_PUBLIC int gavl_overlay_blend_context_init(gavl_overlay_blend_context_t *ctx, const gavl_video_format_t *frame_format, gavl_video_format_t *overlay_format)
Initialize the blend context.
GAVL_PUBLIC gavl_overlay_blend_context_t * gavl_overlay_blend_context_create()
Create a blend context.
struct gavl_overlay_blend_context_s gavl_overlay_blend_context_t
Opaque blend context.
Definition: gavl.h:3705
GAVL_PUBLIC void gavl_overlay_blend_context_destroy(gavl_overlay_blend_context_t *ctx)
Destroy a blend context and free all associated memory.
GAVL_PUBLIC gavl_video_sink_t * gavl_overlay_blend_context_get_sink(gavl_overlay_blend_context_t *ctx)
Get the sink for overlays.
GAVL_PUBLIC gavl_video_options_t * gavl_overlay_blend_context_get_options(gavl_overlay_blend_context_t *ctx)
Get options from a blend context.
GAVL_PUBLIC gavl_video_converter_t * gavl_video_converter_create()
Creates a video converter.
GAVL_PUBLIC int gavl_video_converter_init(gavl_video_converter_t *cnv, const gavl_video_format_t *input_format, const gavl_video_format_t *output_format)
Initialize a video converter.
struct gavl_video_converter_s gavl_video_converter_t
Opaque video converter structure.
Definition: gavl.h:3390
GAVL_PUBLIC void gavl_video_convert(gavl_video_converter_t *cnv, const gavl_video_frame_t *input_frame, gavl_video_frame_t *output_frame)
Convert video.
GAVL_PUBLIC int gavl_video_converter_reinit(gavl_video_converter_t *cnv)
Reinitialize a video converter.
GAVL_PUBLIC void gavl_video_converter_destroy(gavl_video_converter_t *cnv)
Destroys a video converter and frees all associated memory.
GAVL_PUBLIC gavl_video_options_t * gavl_video_converter_get_options(gavl_video_converter_t *cnv)
gets options of a video converter
GAVL_PUBLIC int gavl_video_deinterlacer_init(gavl_video_deinterlacer_t *deinterlacer, const gavl_video_format_t *src_format)
Initialize a video deinterlacer.
struct gavl_video_deinterlacer_s gavl_video_deinterlacer_t
Opaque deinterlacer structure.
Definition: gavl.h:3606
GAVL_PUBLIC void gavl_video_deinterlacer_destroy(gavl_video_deinterlacer_t *deinterlacer)
Destroy a video deinterlacer.
GAVL_PUBLIC gavl_video_options_t * gavl_video_deinterlacer_get_options(gavl_video_deinterlacer_t *deinterlacer)
gets options of a deinterlacer
GAVL_PUBLIC void gavl_video_deinterlacer_deinterlace(gavl_video_deinterlacer_t *deinterlacer, const gavl_video_frame_t *input_frame, gavl_video_frame_t *output_frame)
Deinterlace video.
GAVL_PUBLIC gavl_video_deinterlacer_t * gavl_video_deinterlacer_create()
Create a video deinterlacer.
GAVL_PUBLIC void gavl_video_format_set_frame_size(gavl_video_format_t *format, int pad_h, int pad_v)
Set the frame size from the image size.
#define GAVL_PIXFMT_PLANAR
Definition: gavl.h:1682
#define GAVL_PIXFMT_ALPHA
Definition: gavl.h:1702
GAVL_PUBLIC int gavl_pixelformat_conversion_penalty(gavl_pixelformat_t src, gavl_pixelformat_t dst)
Get the conversion penalty for pixelformat conversions.
GAVL_PUBLIC int gavl_pixelformat_bytes_per_pixel(gavl_pixelformat_t pixelformat)
Get bytes per pixel for packed formats.
gavl_chroma_placement_t
Chroma placement.
Definition: gavl.h:2131
#define GAVL_PIXFMT_GRAY
Definition: gavl.h:1707
GAVL_PUBLIC int gavl_get_color_channel_format(const gavl_video_format_t *frame_format, gavl_video_format_t *channel_format, gavl_color_channel_t ch)
Get the video format for extracting/merging one channel.
gavl_framerate_mode_t
Framerate mode.
Definition: gavl.h:2153
GAVL_PUBLIC int gavl_video_formats_equal(const gavl_video_format_t *format_1, const gavl_video_format_t *format_2)
Compare 2 video formats.
GAVL_PUBLIC void gavl_video_format_get_chroma_offset(const gavl_video_format_t *format, int field, int plane, float *off_x, float *off_y)
Get the chroma offsets relative to the luma samples.
GAVL_PUBLIC const char * gavl_pixelformat_to_string(gavl_pixelformat_t pixelformat)
Translate a pixelformat into a human readable string.
GAVL_PUBLIC void gavl_video_format_dump(const gavl_video_format_t *format)
Dump a video format to stderr.
GAVL_PUBLIC int gavl_video_format_get_image_size(const gavl_video_format_t *format)
Get the unpadded image size.
GAVL_PUBLIC gavl_pixelformat_t gavl_get_pixelformat(int index)
Get the pixelformat from index.
GAVL_PUBLIC gavl_color_channel_t gavl_pixelformat_get_channel(gavl_pixelformat_t pixelformat, int index)
Get the color channel.
GAVL_PUBLIC const char * gavl_interlace_mode_to_string(gavl_interlace_mode_t mode)
Translate an interlace mode into a human readable string.
GAVL_PUBLIC gavl_pixelformat_t gavl_short_string_to_pixelformat(const char *name)
Translate a short pixelformat name into a pixelformat.
GAVL_PUBLIC const char * gavl_chroma_placement_to_string(gavl_chroma_placement_t mode)
Translate a chroma placement into a human readable string.
GAVL_PUBLIC gavl_pixelformat_t gavl_string_to_pixelformat(const char *name)
Translate a pixelformat name into a pixelformat.
gavl_interlace_mode_t
Interlace mode.
Definition: gavl.h:2176
#define GAVL_PIXFMT_RGB
Definition: gavl.h:1687
GAVL_PUBLIC const char * gavl_framerate_mode_to_string(gavl_framerate_mode_t mode)
Translate a framerate mode into a human readable string.
GAVL_PUBLIC int gavl_pixelformat_bits_per_pixel(gavl_pixelformat_t pixelformat)
Get the effective number of bits for one pixel.
#define GAVL_PIXFMT_YUV
Definition: gavl.h:1692
GAVL_PUBLIC int gavl_pixelformat_num_planes(gavl_pixelformat_t pixelformat)
Get the number of planes.
gavl_color_channel_t
Color channel definitions.
Definition: gavl.h:1891
GAVL_PUBLIC int gavl_num_pixelformats()
Get total number of supported pixelformats.
#define GAVL_PIXFMT_YUVJ
Definition: gavl.h:1697
GAVL_PUBLIC void gavl_video_format_fit_to_source(gavl_video_format_t *dst, const gavl_video_format_t *src)
Set the image size of a destination format from a source format.
GAVL_PUBLIC const char * gavl_pixelformat_to_short_string(gavl_pixelformat_t pixelformat)
Translate a pixelformat into a short string.
GAVL_PUBLIC void gavl_video_format_copy(gavl_video_format_t *dst, const gavl_video_format_t *src)
Copy one video format to another.
GAVL_PUBLIC gavl_pixelformat_t gavl_pixelformat_get_best(gavl_pixelformat_t src, const gavl_pixelformat_t *dst_supported, int *penalty)
Get the best destination format for a given source format.
GAVL_PUBLIC void gavl_video_format_dumpi(const gavl_video_format_t *format, int indent)
Dump a video format to stderr.
GAVL_PUBLIC int gavl_pixelformat_bytes_per_component(gavl_pixelformat_t pixelformat)
Get bytes per component for planar formats.
GAVL_PUBLIC int gavl_pixelformat_num_channels(gavl_pixelformat_t pixelformat)
Get the number of channels.
GAVL_PUBLIC int gavl_interlace_mode_is_mixed(gavl_interlace_mode_t mode)
Check if an interlace mode is mixed.
GAVL_PUBLIC void gavl_get_field_format(const gavl_video_format_t *frame_format, gavl_video_format_t *field_format, int field)
Get the video format of one field.
gavl_pixelformat_t
Pixelformat definition.
Definition: gavl.h:1714
GAVL_PUBLIC void gavl_pixelformat_chroma_sub(gavl_pixelformat_t pixelformat, int *sub_h, int *sub_v)
Get the horizontal and vertical subsampling factors.
@ GAVL_CHROMA_PLACEMENT_DVPAL
Definition: gavl.h:2134
@ GAVL_CHROMA_PLACEMENT_MPEG2
Definition: gavl.h:2133
@ GAVL_CHROMA_PLACEMENT_DEFAULT
Definition: gavl.h:2132
@ GAVL_FRAMERATE_UNKNOWN
Definition: gavl.h:2154
@ GAVL_FRAMERATE_CONSTANT
Definition: gavl.h:2155
@ GAVL_FRAMERATE_STILL
Definition: gavl.h:2157
@ GAVL_FRAMERATE_VARIABLE
Definition: gavl.h:2156
@ GAVL_INTERLACE_MIXED_BOTTOM
Definition: gavl.h:2183
@ GAVL_INTERLACE_MIXED_TOP
Definition: gavl.h:2182
@ GAVL_INTERLACE_NONE
Definition: gavl.h:2178
@ GAVL_INTERLACE_BOTTOM_FIRST
Definition: gavl.h:2180
@ GAVL_INTERLACE_UNKNOWN
Definition: gavl.h:2177
@ GAVL_INTERLACE_MIXED
Definition: gavl.h:2181
@ GAVL_INTERLACE_TOP_FIRST
Definition: gavl.h:2179
@ GAVL_CCH_NONE
None/undefined.
Definition: gavl.h:1892
@ GAVL_CCH_Y
Luminance (also grayscale)
Definition: gavl.h:1896
@ GAVL_CCH_RED
Red.
Definition: gavl.h:1893
@ GAVL_CCH_CR
Chrominance red (aka V)
Definition: gavl.h:1898
@ GAVL_CCH_GREEN
Green.
Definition: gavl.h:1894
@ GAVL_CCH_ALPHA
Transparency (or, to be more precise opacity)
Definition: gavl.h:1899
@ GAVL_CCH_CB
Chrominance blue (aka U)
Definition: gavl.h:1897
@ GAVL_CCH_BLUE
Blue.
Definition: gavl.h:1895
@ GAVL_YUVJ_420_P
Definition: gavl.h:1828
@ GAVL_YUV_422_P
Definition: gavl.h:1815
@ GAVL_BGR_24
Definition: gavl.h:1764
@ GAVL_YUV_410_P
Definition: gavl.h:1824
@ GAVL_RGB_48
Definition: gavl.h:1777
@ GAVL_RGB_32
Definition: gavl.h:1767
@ GAVL_YUV_420_P
Definition: gavl.h:1812
@ GAVL_GRAYA_32
Definition: gavl.h:1737
@ GAVL_YUVA_32
Definition: gavl.h:1797
@ GAVL_RGB_16
Definition: gavl.h:1754
@ GAVL_UYVY
Definition: gavl.h:1794
@ GAVL_YUV_422_P_16
Definition: gavl.h:1841
@ GAVL_YUV_444_P
Definition: gavl.h:1818
@ GAVL_RGB_FLOAT
Definition: gavl.h:1784
@ GAVL_YUVJ_422_P
Definition: gavl.h:1831
@ GAVL_GRAY_8
Definition: gavl.h:1721
@ GAVL_RGB_24
Definition: gavl.h:1761
@ GAVL_RGBA_64
Definition: gavl.h:1780
@ GAVL_YUY2
Definition: gavl.h:1791
@ GAVL_YUVA_FLOAT
Definition: gavl.h:1807
@ GAVL_YUVJ_444_P
Definition: gavl.h:1834
@ GAVL_GRAYA_FLOAT
Definition: gavl.h:1741
@ GAVL_BGR_15
Definition: gavl.h:1750
@ GAVL_YUV_444_P_16
Definition: gavl.h:1838
@ GAVL_PIXELFORMAT_NONE
Undefined.
Definition: gavl.h:1717
@ GAVL_GRAYA_16
Definition: gavl.h:1733
@ GAVL_YUV_411_P
Definition: gavl.h:1821
@ GAVL_GRAY_FLOAT
Definition: gavl.h:1729
@ GAVL_YUV_FLOAT
Definition: gavl.h:1803
@ GAVL_RGBA_32
Definition: gavl.h:1773
@ GAVL_GRAY_16
Definition: gavl.h:1725
@ GAVL_BGR_16
Definition: gavl.h:1758
@ GAVL_YUVA_64
Definition: gavl.h:1800
@ GAVL_RGB_15
Definition: gavl.h:1746
@ GAVL_RGBA_FLOAT
Definition: gavl.h:1787
@ GAVL_BGR_32
Definition: gavl.h:1770
GAVL_PUBLIC gavl_video_frame_t * gavl_video_frame_pool_get(gavl_video_frame_pool_t *p)
Create a video frame pool.
GAVL_PUBLIC gavl_video_frame_pool_t * gavl_video_frame_pool_create(gavl_video_frame_t *(*create_frame)(void *priv), void *priv)
Create a video frame pool.
struct gavl_video_frame_pool_s gavl_video_frame_pool_t
Video frame pool.
Definition: gavl.h:4183
GAVL_PUBLIC void gavl_video_frame_pool_destroy(gavl_video_frame_pool_t *p)
Destroy a video frame pool.
GAVL_PUBLIC void gavl_video_frame_pool_reset(gavl_video_frame_pool_t *p)
Reset a video frame pool.
GAVL_PUBLIC void gavl_video_frame_copy(const gavl_video_format_t *format, gavl_video_frame_t *dst, const gavl_video_frame_t *src)
Copy one video frame to another.
GAVL_PUBLIC void gavl_video_frame_copy_plane(const gavl_video_format_t *format, gavl_video_frame_t *dst, const gavl_video_frame_t *src, int plane)
Copy a single plane from one video frame to another.
GAVL_PUBLIC void gavl_video_frame_destroy(gavl_video_frame_t *frame)
Destroy a video frame.
GAVL_PUBLIC void gavl_video_frame_copy_flip_x(const gavl_video_format_t *format, gavl_video_frame_t *dst, const gavl_video_frame_t *src)
Copy one video frame to another with horizontal flipping.
GAVL_PUBLIC void gavl_video_frame_set_strides(gavl_video_frame_t *frame, const gavl_video_format_t *format)
Set the strides according to the format.
GAVL_PUBLIC int gavl_video_frame_insert_channel(const gavl_video_format_t *format, gavl_color_channel_t ch, const gavl_video_frame_t *src, gavl_video_frame_t *dst)
Insert one channel from a grayscale image into a video frame.
GAVL_PUBLIC void gavl_video_frame_set_planes(gavl_video_frame_t *frame, const gavl_video_format_t *format, uint8_t *buffer)
Set the frames according to the format.
GAVL_PUBLIC void gavl_video_frame_copy_flip_xy(const gavl_video_format_t *format, gavl_video_frame_t *dst, const gavl_video_frame_t *src)
Copy one video frame to another with horizontal and vertical flipping.
GAVL_PUBLIC void gavl_video_frame_get_subframe(gavl_pixelformat_t pixelformat, const gavl_video_frame_t *src, gavl_video_frame_t *dst, const gavl_rectangle_i_t *src_rect)
Get a subframe of another frame.
GAVL_PUBLIC void gavl_video_frame_copy_metadata(gavl_video_frame_t *dst, const gavl_video_frame_t *src)
Copy metadata of one video frame to another.
GAVL_PUBLIC void gavl_video_frame_fill(gavl_video_frame_t *frame, const gavl_video_format_t *format, const float *color)
Fill the frame with a user spefified color.
GAVL_PUBLIC void gavl_video_frame_dump(gavl_video_frame_t *frame, const gavl_video_format_t *format, const char *namebase)
Dump a video frame to files.
GAVL_PUBLIC void gavl_video_frame_copy_flip_y(const gavl_video_format_t *format, gavl_video_frame_t *dst, const gavl_video_frame_t *src)
Copy one video frame to another with vertical flipping.
GAVL_PUBLIC void gavl_video_frame_get_field(gavl_pixelformat_t pixelformat, const gavl_video_frame_t *src, gavl_video_frame_t *dst, int field)
Get a field from a frame.
GAVL_PUBLIC void gavl_video_frame_psnr(double *psnr, const gavl_video_frame_t *src1, const gavl_video_frame_t *src2, const gavl_video_format_t *format)
Calculate the PSNR of 2 source frames.
GAVL_PUBLIC void gavl_video_frame_absdiff(gavl_video_frame_t *dst, const gavl_video_frame_t *src1, const gavl_video_frame_t *src2, const gavl_video_format_t *format)
Fill the frame with the absolute differene of 2 source frames.
GAVL_PUBLIC int gavl_video_frame_ssim(const gavl_video_frame_t *src1, const gavl_video_frame_t *src2, gavl_video_frame_t *dst, const gavl_video_format_t *format)
Calculate the SSIM of 2 source frames.
GAVL_PUBLIC int gavl_video_frame_extract_channel(const gavl_video_format_t *format, gavl_color_channel_t ch, const gavl_video_frame_t *src, gavl_video_frame_t *dst)
Extract one channel of a video frame into a grayscale image.
GAVL_PUBLIC gavl_video_frame_t * gavl_video_frame_create(const gavl_video_format_t *format)
Create video frame.
GAVL_PUBLIC void gavl_video_frame_null(gavl_video_frame_t *frame)
Zero all pointers in the video frame.
GAVL_PUBLIC void gavl_video_frame_clear(gavl_video_frame_t *frame, const gavl_video_format_t *format)
Fill the frame with black color.
GAVL_PUBLIC int gavl_video_frame_continuous(const gavl_video_format_t *format, const gavl_video_frame_t *frame)
Check if a video frame uses a continuous memory block.
GAVL_PUBLIC int gavl_video_frames_equal(const gavl_video_format_t *format, const gavl_video_frame_t *f1, const gavl_video_frame_t *f2)
Check if 2 video frames are bit-identical.
GAVL_PUBLIC gavl_video_frame_t * gavl_video_frame_create_nopad(const gavl_video_format_t *format)
Create video frame without padding.
GAVL_PUBLIC void gavl_video_frame_dump_metadata(const gavl_video_format_t *format, const gavl_video_frame_t *frame)
Dump a metadata of a video frame.
struct gavl_video_frame_s gavl_video_frame_t
GAVL_PUBLIC void gavl_video_options_set_run_func(gavl_video_options_t *opt, gavl_video_run_func func, void *client_data)
Set function to be passed to each thread.
GAVL_PUBLIC void gavl_video_options_set_quality(gavl_video_options_t *opt, int quality)
Set the quality level for the converter.
GAVL_PUBLIC void gavl_video_options_set_alpha_mode(gavl_video_options_t *opt, gavl_alpha_mode_t alpha_mode)
Set the alpha mode.
GAVL_PUBLIC void gavl_video_options_get_rectangles(const gavl_video_options_t *opt, gavl_rectangle_f_t *src_rect, gavl_rectangle_i_t *dst_rect)
Get source and destination rectangles.
GAVL_PUBLIC gavl_alpha_mode_t gavl_video_options_get_alpha_mode(const gavl_video_options_t *opt)
Get the alpha mode.
GAVL_PUBLIC void gavl_video_options_set_rectangles(gavl_video_options_t *opt, const gavl_rectangle_f_t *src_rect, const gavl_rectangle_i_t *dst_rect)
Set source and destination rectangles.
GAVL_PUBLIC void gavl_video_options_destroy(gavl_video_options_t *opt)
Destroy video options.
GAVL_PUBLIC int gavl_video_options_get_num_threads(const gavl_video_options_t *opt)
Set number of threads.
GAVL_PUBLIC int gavl_video_options_get_quality(const gavl_video_options_t *opt)
Get the quality level for the converter.
GAVL_PUBLIC void gavl_video_options_set_num_threads(gavl_video_options_t *opt, int n)
Set number of threads.
GAVL_PUBLIC void gavl_video_options_set_scale_mode(gavl_video_options_t *opt, gavl_scale_mode_t scale_mode)
Set the scale mode.
gavl_deinterlace_mode_t
Definition: gavl.h:2929
GAVL_PUBLIC gavl_deinterlace_drop_mode_t gavl_video_options_get_deinterlace_drop_mode(const gavl_video_options_t *opt)
Get the deinterlace drop mode.
GAVL_PUBLIC void gavl_video_options_copy(gavl_video_options_t *dst, const gavl_video_options_t *src)
Copy video options.
gavl_deinterlace_drop_mode_t
Specifies which field to drop when deinterlacing.
Definition: gavl.h:2943
GAVL_PUBLIC gavl_video_options_t * gavl_video_options_create()
Create an options container.
struct gavl_video_options_s gavl_video_options_t
Definition: gavl.h:2988
GAVL_PUBLIC int gavl_video_options_get_scale_order(const gavl_video_options_t *opt)
Get the scale order for GAVL_SCALE_SINC_LANCZOS.
GAVL_PUBLIC gavl_video_stop_func gavl_video_options_get_stop_func(const gavl_video_options_t *opt, void **client_data)
Get function to be passed to each thread.
GAVL_PUBLIC void gavl_video_options_get_background_color(const gavl_video_options_t *opt, float *color)
Get the background color for alpha blending.
GAVL_PUBLIC float gavl_video_options_get_downscale_blur(const gavl_video_options_t *opt)
Get blur factor for downscaling.
gavl_alpha_mode_t
Definition: gavl.h:2917
GAVL_PUBLIC void gavl_video_options_set_background_color(gavl_video_options_t *opt, const float *color)
Set the background color for alpha blending.
GAVL_PUBLIC void gavl_video_options_set_deinterlace_drop_mode(gavl_video_options_t *opt, gavl_deinterlace_drop_mode_t deinterlace_drop_mode)
Set the deinterlace drop mode.
GAVL_PUBLIC void gavl_video_options_set_stop_func(gavl_video_options_t *opt, gavl_video_stop_func func, void *client_data)
Set function to be passed to each thread.
GAVL_PUBLIC gavl_downscale_filter_t gavl_video_options_get_downscale_filter(const gavl_video_options_t *opt)
Get the antialiasing filter for downscaling.
GAVL_PUBLIC void gavl_video_options_set_defaults(gavl_video_options_t *opt)
Set all options to their defaults.
GAVL_PUBLIC void gavl_video_options_set_conversion_flags(gavl_video_options_t *opt, int conversion_flags)
Set the conversion flags.
gavl_scale_mode_t
Definition: gavl.h:2953
GAVL_PUBLIC void gavl_video_options_set_downscale_blur(gavl_video_options_t *opt, float f)
Set blur factor for downscaling.
GAVL_PUBLIC void gavl_video_options_set_downscale_filter(gavl_video_options_t *opt, gavl_downscale_filter_t f)
Set antialiasing filter for downscaling.
GAVL_PUBLIC int gavl_video_options_get_conversion_flags(const gavl_video_options_t *opt)
Get the conversion flags.
GAVL_PUBLIC void gavl_video_options_set_scale_order(gavl_video_options_t *opt, int order)
Set the scale order for GAVL_SCALE_SINC_LANCZOS.
gavl_downscale_filter_t
Definition: gavl.h:2975
GAVL_PUBLIC gavl_scale_mode_t gavl_video_options_get_scale_mode(const gavl_video_options_t *opt)
Get the scale mode.
GAVL_PUBLIC gavl_video_run_func gavl_video_options_get_run_func(const gavl_video_options_t *opt, void **client_data)
Get function to be passed to each thread.
@ GAVL_DEINTERLACE_NONE
Definition: gavl.h:2930
@ GAVL_DEINTERLACE_SCALE
Definition: gavl.h:2932
@ GAVL_DEINTERLACE_BLEND
Definition: gavl.h:2933
@ GAVL_DEINTERLACE_COPY
Definition: gavl.h:2931
@ GAVL_DEINTERLACE_DROP_TOP
Definition: gavl.h:2944
@ GAVL_DEINTERLACE_DROP_BOTTOM
Definition: gavl.h:2945
@ GAVL_ALPHA_IGNORE
Definition: gavl.h:2918
@ GAVL_ALPHA_BLEND_COLOR
Definition: gavl.h:2919
@ GAVL_SCALE_NONE
Definition: gavl.h:2962
@ GAVL_SCALE_NEAREST
Definition: gavl.h:2955
@ GAVL_SCALE_CUBIC_MITCHELL
Definition: gavl.h:2959
@ GAVL_SCALE_AUTO
Definition: gavl.h:2954
@ GAVL_SCALE_SINC_LANCZOS
Definition: gavl.h:2961
@ GAVL_SCALE_CUBIC_CATMULL
Definition: gavl.h:2960
@ GAVL_SCALE_CUBIC_BSPLINE
Definition: gavl.h:2958
@ GAVL_SCALE_QUADRATIC
Definition: gavl.h:2957
@ GAVL_SCALE_BILINEAR
Definition: gavl.h:2956
@ GAVL_DOWNSCALE_FILTER_AUTO
Auto selection based on quality.
Definition: gavl.h:2976
@ GAVL_DOWNSCALE_FILTER_NONE
Fastest method, might produce heavy aliasing artifacts.
Definition: gavl.h:2977
@ GAVL_DOWNSCALE_FILTER_WIDE
Widen the filter curve according to the scaling ratio.
Definition: gavl.h:2978
@ GAVL_DOWNSCALE_FILTER_GAUSS
Do a Gaussian preblur.
Definition: gavl.h:2979
GAVL_PUBLIC int gavl_video_scaler_init(gavl_video_scaler_t *scaler, const gavl_video_format_t *src_format, const gavl_video_format_t *dst_format)
Initialize a video scaler.
GAVL_PUBLIC void gavl_video_scaler_destroy(gavl_video_scaler_t *scaler)
Destroy a video scaler.
GAVL_PUBLIC gavl_video_options_t * gavl_video_scaler_get_options(gavl_video_scaler_t *scaler)
gets options of a scaler
GAVL_PUBLIC gavl_video_scaler_t * gavl_video_scaler_create()
Create a video scaler.
struct gavl_video_scaler_s gavl_video_scaler_t
Opaque scaler structure.
Definition: gavl.h:3506
GAVL_PUBLIC void gavl_video_scaler_scale(gavl_video_scaler_t *scaler, const gavl_video_frame_t *input_frame, gavl_video_frame_t *output_frame)
Scale video.
GAVL_PUBLIC int gavl_video_scaler_init_convolve(gavl_video_scaler_t *scaler, const gavl_video_format_t *format, int h_radius, const float *h_coeffs, int v_radius, const float *v_coeffs)
Initialize a video scaler as a generic convolver.
GAVL_PUBLIC void gavl_image_transform_destroy(gavl_image_transform_t *t)
Destroy a transformation engine.
GAVL_PUBLIC int gavl_image_transform_init(gavl_image_transform_t *t, gavl_video_format_t *format, gavl_image_transform_func func, void *priv)
Initialize a transformation engine.
GAVL_PUBLIC gavl_video_options_t * gavl_image_transform_get_options(gavl_image_transform_t *t)
Get transformation options.
struct gavl_image_transform_s gavl_image_transform_t
Opaque image transformation engine.
Definition: gavl.h:3805
void(* gavl_image_transform_func)(void *priv, double xdst, double ydst, double *xsrc, double *ysrc)
Function describing the method.
Definition: gavl.h:3820
GAVL_PUBLIC void gavl_image_transform_transform(gavl_image_transform_t *t, gavl_video_frame_t *in_frame, gavl_video_frame_t *out_frame)
Transform an image.
GAVL_PUBLIC gavl_image_transform_t * gavl_image_transform_create()
Create a transformation engine.
#define GAVL_MAX_PLANES
Definition: gavl.h:1353
GAVL_PUBLIC void gavl_volume_control_set_volume(gavl_volume_control_t *ctrl, float volume)
Set volume for a volume control.
GAVL_PUBLIC void gavl_volume_control_apply(gavl_volume_control_t *ctrl, gavl_audio_frame_t *frame)
Apply a volume control for an audio frame.
GAVL_PUBLIC gavl_volume_control_t * gavl_volume_control_create()
Create volume control.
GAVL_PUBLIC void gavl_volume_control_destroy(gavl_volume_control_t *ctrl)
Destroys a volume control and frees all associated memory.
GAVL_PUBLIC void gavl_volume_control_set_format(gavl_volume_control_t *ctrl, const gavl_audio_format_t *format)
Set format for a volume control.
struct gavl_volume_control_s gavl_volume_control_t
Opaque structure for a volume control.
Definition: gavl.h:1292
Audio Format.
Definition: gavl.h:312
uint32_t samples_per_frame
Definition: gavl.h:313
uint32_t samplerate
Definition: gavl.h:314
float rear_level
Definition: gavl.h:320
gavl_interleave_mode_t interleave_mode
Definition: gavl.h:317
gavl_sample_format_t sample_format
Definition: gavl.h:316
uint32_t num_channels
Definition: gavl.h:315
float center_level
Definition: gavl.h:319
Generic container for audio samples.
Definition: gavl.h:595
int channel_stride
Definition: gavl.h:600
gavl_audio_samples_t samples
Definition: gavl.h:596
int valid_samples
Definition: gavl.h:598
int64_t timestamp
Definition: gavl.h:599
gavl_audio_channels_t channels
Definition: gavl.h:597
frame table structure
Definition: gavl.h:3915
gavl_timecode_t tc
Timecode associated with this timestamp.
Definition: gavl.h:3933
int num_timecodes
Number of timecodes.
Definition: gavl.h:3927
int64_t num_frames
Number of frames.
Definition: gavl.h:3923
int64_t duration
Duration of each of these frames.
Definition: gavl.h:3924
int64_t offset
Timestamp of the first frame.
Definition: gavl.h:3916
int64_t entries_alloc
Number of allocated entries (never touch this)
Definition: gavl.h:3919
int64_t num_entries
Number of entries.
Definition: gavl.h:3918
int64_t pts
Timestamp of this frame.
Definition: gavl.h:3932
int timecodes_alloc
Number of allocated timecodes (never touch this)
Definition: gavl.h:3928
Floating point rectangle.
Definition: gavl.h:1378
double x
Definition: gavl.h:1379
double y
Definition: gavl.h:1380
double w
Definition: gavl.h:1381
double h
Definition: gavl.h:1382
Integer rectangle.
Definition: gavl.h:1366
int32_t x
Definition: gavl.h:1367
int32_t h
Definition: gavl.h:1370
int32_t y
Definition: gavl.h:1368
int32_t w
Definition: gavl.h:1369
Timecode format.
Definition: timecode.h:60
Video format.
Definition: gavl.h:2213
uint32_t frame_height
Definition: gavl.h:2215
gavl_chroma_placement_t chroma_placement
Definition: gavl.h:2232
uint32_t image_height
Definition: gavl.h:2218
uint32_t pixel_height
Definition: gavl.h:2223
uint32_t frame_width
Definition: gavl.h:2214
uint32_t image_width
Definition: gavl.h:2217
uint32_t timescale
Definition: gavl.h:2229
gavl_interlace_mode_t interlace_mode
Definition: gavl.h:2234
gavl_framerate_mode_t framerate_mode
Definition: gavl.h:2231
gavl_pixelformat_t pixelformat
Definition: gavl.h:2225
uint32_t pixel_width
Definition: gavl.h:2222
gavl_timecode_format_t timecode_format
Definition: gavl.h:2236
uint32_t frame_duration
Definition: gavl.h:2227
Definition: gavl.h:2414
uint8_t * planes[GAVL_MAX_PLANES]
Definition: gavl.h:2415
int64_t duration
Definition: gavl.h:2420
int strides[GAVL_MAX_PLANES]
Definition: gavl.h:2416
void * destroy_priv
Definition: gavl.h:2426
int32_t dst_y
y offset in the destination frame. (since 1.5.0) *‍/
Definition: gavl.h:2430
void * user_data
Definition: gavl.h:2418
int64_t timestamp
Definition: gavl.h:2419
int32_t dst_x
x offset in the destination frame. (since 1.5.0) *‍/
Definition: gavl.h:2429
gavl_rectangle_i_t src_rect
Valid rectangle in this frame (since 1.5.0) *‍/.
Definition: gavl.h:2428
void(* destroy)(struct gavl_video_frame_s *, void *priv)
Definition: gavl.h:2425
int refcount
Definition: gavl.h:2424
gavl_interlace_mode_t interlace_mode
Definition: gavl.h:2421
gavl_timecode_t timecode
Definition: gavl.h:2422
Container for noninterleaved audio samples.
Definition: gavl.h:563
Container for interleaved audio samples.
Definition: gavl.h:543
uint32_t * u_32
Definition: gavl.h:550
int8_t * s_8
Definition: gavl.h:545
uint16_t * u_16
Definition: gavl.h:547
int16_t * s_16
Definition: gavl.h:548
uint8_t * u_8
Definition: gavl.h:544
float * f
Definition: gavl.h:553
double * d
Definition: gavl.h:554
int32_t * s_32
Definition: gavl.h:551