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 - 2011 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 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 #include <gavl/timecode.h>
40 
41 
64 typedef void (*gavl_video_process_func)(void * data, int start, int end);
65 
80  void * gavl_data,
81  int start, int end,
82  void * client_data, int thread);
83 
92 typedef void (*gavl_video_stop_func)(void * client_data, int thread);
93 
103 
104 
105 /* Quality levels */
106 
130 #define GAVL_QUALITY_FASTEST 1
131 
138 #define GAVL_QUALITY_BEST 5
139 
146 #define GAVL_QUALITY_DEFAULT 2
147 
159 #define GAVL_ACCEL_MMX (1<<0)
160 #define GAVL_ACCEL_MMXEXT (1<<1)
161 #define GAVL_ACCEL_SSE (1<<2)
162 #define GAVL_ACCEL_SSE2 (1<<3)
163 #define GAVL_ACCEL_SSE3 (1<<4)
164 #define GAVL_ACCEL_3DNOW (1<<5)
165 #define GAVL_ACCEL_3DNOWEXT (1<<6)
166 #define GAVL_ACCEL_SSSE3 (1<<7)
167 
168 
172 GAVL_PUBLIC int gavl_accel_supported();
173 
182 /* Sample formats: all multibyte numbers are native endian */
183 
196 #define GAVL_MAX_CHANNELS 128
197 
204 typedef enum
205  {
215 
221 typedef enum
222  {
227 
235 typedef enum
236  {
251 
260 typedef struct
261  {
268  float center_level;
269  float rear_level;
274 
275 
276 /* Audio format -> string conversions */
277 
285 GAVL_PUBLIC
287 
296 GAVL_PUBLIC
298 
304 GAVL_PUBLIC
306 
313 GAVL_PUBLIC
315 
322 GAVL_PUBLIC
324 
325 
332 GAVL_PUBLIC
334 
341 GAVL_PUBLIC
342 void gavl_audio_format_dump(const gavl_audio_format_t * format);
343 
352 GAVL_PUBLIC
354 
361 GAVL_PUBLIC
362 int gavl_front_channels(const gavl_audio_format_t * format);
363 
370 GAVL_PUBLIC
371 int gavl_rear_channels(const gavl_audio_format_t * format);
372 
379 GAVL_PUBLIC
380 int gavl_side_channels(const gavl_audio_format_t * format);
381 
388 GAVL_PUBLIC
389 int gavl_aux_channels(const gavl_audio_format_t * format);
390 
391 
392 
399 GAVL_PUBLIC
400 int gavl_lfe_channels(const gavl_audio_format_t * format);
401 
409 GAVL_PUBLIC
411  const gavl_audio_format_t * src);
412 
421 GAVL_PUBLIC
422 int gavl_audio_formats_equal(const gavl_audio_format_t * format_1,
423  const gavl_audio_format_t * format_2);
424 
436 GAVL_PUBLIC
438 
445 GAVL_PUBLIC
447 
462 typedef union
463  {
464  uint8_t * u_8;
465  int8_t * s_8;
467  uint16_t * u_16;
468  int16_t * s_16;
470  uint32_t * u_32;
471  int32_t * s_32;
473  float * f;
474  double * d;
476 
482 typedef union
483  {
484  uint8_t * u_8[GAVL_MAX_CHANNELS];
485  int8_t * s_8[GAVL_MAX_CHANNELS];
487  uint16_t * u_16[GAVL_MAX_CHANNELS];
488  int16_t * s_16[GAVL_MAX_CHANNELS];
490  uint32_t * u_32[GAVL_MAX_CHANNELS];
491  int32_t * s_32[GAVL_MAX_CHANNELS];
493  float * f[GAVL_MAX_CHANNELS];
494  double * d[GAVL_MAX_CHANNELS];
497 
514 typedef struct
515  {
519  int64_t timestamp;
522 
534 GAVL_PUBLIC
536 
548 GAVL_PUBLIC
550 
560 GAVL_PUBLIC
562 
572 GAVL_PUBLIC
574  const gavl_audio_format_t * format);
575 
586 GAVL_PUBLIC
588  const gavl_audio_format_t * format,
589  int num_samples);
590 
591 
592 
603 GAVL_PUBLIC
605  const gavl_audio_format_t * format,
606  int channel);
607 
628 GAVL_PUBLIC
629 int gavl_audio_frame_copy(const gavl_audio_format_t * format,
630  gavl_audio_frame_t * dst,
631  const gavl_audio_frame_t * src,
632  int dst_pos,
633  int src_pos,
634  int dst_size,
635  int src_size);
636 
649 GAVL_PUBLIC
651  gavl_audio_frame_t * dst,
652  const gavl_audio_frame_t * src);
653 
671 GAVL_PUBLIC
673  gavl_audio_frame_t * src,
674  gavl_audio_frame_t * dst,
675  int start, int len);
676 
689 GAVL_PUBLIC
691  const gavl_audio_frame_t * f1,
692  const gavl_audio_frame_t * f2);
693 
713 GAVL_PUBLIC
714 int gavl_audio_frame_plot(const gavl_audio_format_t * format,
715  const gavl_audio_frame_t * frame,
716  const char * name_base);
717 
718 
733 #define GAVL_AUDIO_FRONT_TO_REAR_COPY (1<<0)
738 #define GAVL_AUDIO_FRONT_TO_REAR_MUTE (1<<1)
743 #define GAVL_AUDIO_FRONT_TO_REAR_DIFF (1<<2)
748 #define GAVL_AUDIO_FRONT_TO_REAR_MASK \
749 (GAVL_AUDIO_FRONT_TO_REAR_COPY | \
750 GAVL_AUDIO_FRONT_TO_REAR_MUTE | \
751  GAVL_AUDIO_FRONT_TO_REAR_DIFF)
753 /* Options for mixing stereo to mono */
754 
757 #define GAVL_AUDIO_STEREO_TO_MONO_LEFT (1<<3)
760 #define GAVL_AUDIO_STEREO_TO_MONO_RIGHT (1<<4)
763 #define GAVL_AUDIO_STEREO_TO_MONO_MIX (1<<5)
767 #define GAVL_AUDIO_STEREO_TO_MONO_MASK \
768 (GAVL_AUDIO_STEREO_TO_MONO_LEFT | \
769 GAVL_AUDIO_STEREO_TO_MONO_RIGHT | \
770 GAVL_AUDIO_STEREO_TO_MONO_MIX)
775 #define GAVL_AUDIO_NORMALIZE_MIX_MATRIX (1<<6)
782 typedef enum
783  {
784  GAVL_AUDIO_DITHER_NONE = 0,
785  GAVL_AUDIO_DITHER_AUTO = 1,
786  GAVL_AUDIO_DITHER_RECT = 2,
787  GAVL_AUDIO_DITHER_TRI = 3,
788  GAVL_AUDIO_DITHER_SHAPED = 4,
790 
795 typedef enum
796  {
804 
811 typedef struct gavl_audio_options_s gavl_audio_options_t;
812 
819 GAVL_PUBLIC
821 
828 GAVL_PUBLIC
830 
837 GAVL_PUBLIC
839 
846 GAVL_PUBLIC
848 
849 
856 GAVL_PUBLIC
858 
865 GAVL_PUBLIC
867 
874 GAVL_PUBLIC
876  int flags);
877 
884 GAVL_PUBLIC
886 
892 GAVL_PUBLIC
894 
911 GAVL_PUBLIC
913  const double ** matrix);
914 
923 GAVL_PUBLIC
925 
935 GAVL_PUBLIC
937 
944 GAVL_PUBLIC
946  const gavl_audio_options_t * src);
947 
953 GAVL_PUBLIC
955 
956 
957 
958 /* Audio converter */
959 
993 typedef struct gavl_audio_converter_s gavl_audio_converter_t;
994 
1000 GAVL_PUBLIC
1002 
1008 GAVL_PUBLIC
1010 
1019 GAVL_PUBLIC
1021 
1022 
1037 GAVL_PUBLIC
1039  const gavl_audio_format_t * input_format,
1040  const gavl_audio_format_t * output_format);
1041 
1056 GAVL_PUBLIC
1058  const gavl_audio_format_t * format);
1059 
1074 GAVL_PUBLIC
1076 
1077 
1091 GAVL_PUBLIC
1093  const gavl_audio_frame_t * input_frame,
1094  gavl_audio_frame_t * output_frame);
1095 
1096 
1115 GAVL_PUBLIC
1117  double ratio ) ;
1118 
1119 
1135 GAVL_PUBLIC
1137  gavl_audio_frame_t * input_frame,
1138  gavl_audio_frame_t * output_frame,
1139  double ratio);
1140 
1141 
1155 typedef struct gavl_volume_control_s gavl_volume_control_t;
1156 
1157 /* Create / destroy */
1158 
1164 GAVL_PUBLIC
1166 
1172 GAVL_PUBLIC
1174 
1182 GAVL_PUBLIC
1184  const gavl_audio_format_t * format);
1185 
1192 GAVL_PUBLIC
1194  float volume);
1195 
1202 GAVL_PUBLIC
1204  gavl_audio_frame_t * frame);
1205 
1221 typedef struct gavl_peak_detector_s gavl_peak_detector_t;
1222 
1223 /* Create / destroy */
1224 
1230 GAVL_PUBLIC
1232 
1238 GAVL_PUBLIC
1240 
1250 GAVL_PUBLIC
1252  const gavl_audio_format_t * format);
1253 
1260 GAVL_PUBLIC
1262  gavl_audio_frame_t * frame);
1263 
1276 GAVL_PUBLIC
1278  double * min, double * max,
1279  double * abs);
1280 
1293 GAVL_PUBLIC
1295  double * min, double * max,
1296  double * abs);
1297 
1303 GAVL_PUBLIC
1305 
1315 #define GAVL_MAX_PLANES 4
1327 typedef struct
1328  {
1329  int x;
1330  int y;
1331  int w;
1332  int h;
1334 
1339 typedef struct
1340  {
1341  double x;
1342  double y;
1343  double w;
1344  double h;
1346 
1353 GAVL_PUBLIC
1355  const gavl_video_format_t * format);
1356 
1363 GAVL_PUBLIC
1365  const gavl_video_format_t * format);
1366 
1381 GAVL_PUBLIC
1383  gavl_rectangle_i_t * dst_rect,
1384  const gavl_video_format_t * src_format,
1385  const gavl_video_format_t * dst_format);
1386 
1398 GAVL_PUBLIC
1400  gavl_rectangle_i_t * dst_rect,
1401  const gavl_video_format_t * src_format,
1402  const gavl_video_format_t * dst_format);
1403 
1404 
1405 
1412 GAVL_PUBLIC
1414 
1421 GAVL_PUBLIC
1423 
1430 GAVL_PUBLIC
1431 void gavl_rectangle_i_crop_left(gavl_rectangle_i_t * r, int num_pixels);
1432 
1439 GAVL_PUBLIC
1440 void gavl_rectangle_i_crop_right(gavl_rectangle_i_t * r, int num_pixels);
1441 
1448 GAVL_PUBLIC
1449 void gavl_rectangle_i_crop_top(gavl_rectangle_i_t * r, int num_pixels);
1450 
1457 GAVL_PUBLIC
1458 void gavl_rectangle_i_crop_bottom(gavl_rectangle_i_t * r, int num_pixels);
1459 
1466 GAVL_PUBLIC
1467 void gavl_rectangle_f_crop_left(gavl_rectangle_f_t * r, double num_pixels);
1468 
1475 GAVL_PUBLIC
1476 void gavl_rectangle_f_crop_right(gavl_rectangle_f_t * r, double num_pixels);
1477 
1484 GAVL_PUBLIC
1485 void gavl_rectangle_f_crop_top(gavl_rectangle_f_t * r, double num_pixels);
1486 
1493 GAVL_PUBLIC
1494 void gavl_rectangle_f_crop_bottom(gavl_rectangle_f_t * r, double num_pixels);
1495 
1509 GAVL_PUBLIC
1510 void gavl_rectangle_i_align(gavl_rectangle_i_t * r, int h_align, int v_align);
1511 
1521 GAVL_PUBLIC
1523  const gavl_video_format_t * format);
1524 
1525 
1532 GAVL_PUBLIC
1534 
1541 GAVL_PUBLIC
1543 
1544 
1545 
1552 GAVL_PUBLIC
1554 
1561 GAVL_PUBLIC
1563 
1572 GAVL_PUBLIC
1574 
1583 GAVL_PUBLIC
1585 
1613 GAVL_PUBLIC
1615  const gavl_video_format_t * src_format,
1616  const gavl_rectangle_f_t * src_rect,
1617  const gavl_video_format_t * dst_format,
1618  float zoom, float squeeze);
1619 
1624 GAVL_PUBLIC
1626 
1631 GAVL_PUBLIC
1633 
1634 
1644 #define GAVL_PIXFMT_PLANAR (1<<8)
1645 
1649 #define GAVL_PIXFMT_RGB (1<<9)
1650 
1654 #define GAVL_PIXFMT_YUV (1<<10)
1655 
1659 #define GAVL_PIXFMT_YUVJ (1<<11)
1660 
1664 #define GAVL_PIXFMT_ALPHA (1<<12)
1665 
1669 #define GAVL_PIXFMT_GRAY (1<<13)
1670 
1675 typedef enum
1676  {
1680 
1684 
1688 
1692 
1696 
1700 
1704 
1736 
1743 
1750 
1766 
1770 
1787 
1797 
1804 
1806 
1809 #define GAVL_PIXELFORMAT_1D_8 GAVL_GRAY_8
1810 
1812 #define GAVL_PIXELFORMAT_2D_8 GAVL_GRAYA_16
1813 
1815 #define GAVL_PIXELFORMAT_3D_8 GAVL_RGB_24
1816 
1818 #define GAVL_PIXELFORMAT_4D_8 GAVL_RGBA_32
1819 
1822 #define GAVL_PIXELFORMAT_1D_16 GAVL_GRAY_16
1823 
1825 #define GAVL_PIXELFORMAT_2D_16 GAVL_GRAYA_32
1826 
1828 #define GAVL_PIXELFORMAT_3D_16 GAVL_RGB_48
1829 
1831 #define GAVL_PIXELFORMAT_4D_16 GAVL_RGBA_64
1832 
1835 #define GAVL_PIXELFORMAT_1D_FLOAT GAVL_GRAY_FLOAT
1836 
1838 #define GAVL_PIXELFORMAT_2D_FLOAT GAVL_GRAYA_FLOAT
1839 
1841 #define GAVL_PIXELFORMAT_3D_FLOAT GAVL_RGB_FLOAT
1842 
1844 #define GAVL_PIXELFORMAT_4D_FLOAT GAVL_RGBA_FLOAT
1845 
1852 typedef enum
1853  {
1862 
1863 /*
1864  * Colormodel related functions
1865  */
1866 
1873 #define gavl_pixelformat_is_gray(fmt) ((fmt) & GAVL_PIXFMT_GRAY)
1874 
1875 
1882 #define gavl_pixelformat_is_rgb(fmt) ((fmt) & GAVL_PIXFMT_RGB)
1883 
1890 #define gavl_pixelformat_is_yuv(fmt) ((fmt) & GAVL_PIXFMT_YUV)
1891 
1898 #define gavl_pixelformat_is_jpeg_scaled(fmt) ((fmt) & GAVL_PIXFMT_YUVJ)
1899 
1906 #define gavl_pixelformat_has_alpha(fmt) ((fmt) & GAVL_PIXFMT_ALPHA)
1907 
1914 #define gavl_pixelformat_is_planar(fmt) ((fmt) & GAVL_PIXFMT_PLANAR)
1915 
1922 GAVL_PUBLIC
1924 
1934 GAVL_PUBLIC
1935 void gavl_pixelformat_chroma_sub(gavl_pixelformat_t pixelformat, int * sub_h, int * sub_v);
1936 
1943 GAVL_PUBLIC
1945 
1952 GAVL_PUBLIC
1954 
1961 GAVL_PUBLIC
1963 
1978 GAVL_PUBLIC
1980  gavl_pixelformat_t dst);
1981 
1995 GAVL_PUBLIC gavl_pixelformat_t
1997  const gavl_pixelformat_t * dst_supported,
1998  int * penalty);
1999 
2000 
2001 
2008 GAVL_PUBLIC
2009 const char * gavl_pixelformat_to_string(gavl_pixelformat_t pixelformat);
2010 
2017 GAVL_PUBLIC
2019 
2025 GAVL_PUBLIC
2026 int gavl_num_pixelformats();
2027 
2034 GAVL_PUBLIC
2036 
2037 /* */
2038 
2047 typedef enum
2048  {
2053 
2060 GAVL_PUBLIC
2062 
2067 /* Changing the values alters the gmerlin-avdecoder index format */
2068 
2069 typedef enum
2070  {
2076 
2083 GAVL_PUBLIC
2085 
2090 /* Changing the values alters the gmerlin-avdecoder index format */
2091 
2092 typedef enum
2093  {
2102 
2109 GAVL_PUBLIC
2111 
2112 
2113 /* Video format structure */
2114 
2120  {
2127  /* Support for nonsquare pixels */
2128 
2144  };
2145 
2153 GAVL_PUBLIC
2155  const gavl_video_format_t * src);
2156 
2165 GAVL_PUBLIC
2166 int gavl_video_formats_equal(const gavl_video_format_t * format_1,
2167  const gavl_video_format_t * format_2);
2168 
2169 
2180 GAVL_PUBLIC
2181 void gavl_video_format_get_chroma_offset(const gavl_video_format_t * format, int field, int plane,
2182  float * off_x, float * off_y);
2183 
2184 
2185 
2198 GAVL_PUBLIC
2200  const gavl_video_format_t * src);
2201 
2209 GAVL_PUBLIC
2211 
2227 GAVL_PUBLIC
2228 int gavl_get_color_channel_format(const gavl_video_format_t * frame_format,
2229  gavl_video_format_t * channel_format,
2231 
2232 
2239 GAVL_PUBLIC
2240 void gavl_video_format_dump(const gavl_video_format_t * format);
2241 
2242 
2265 typedef struct
2266  {
2267  uint8_t * planes[GAVL_MAX_PLANES];
2268  int strides[GAVL_MAX_PLANES];
2270  void * user_data;
2271  int64_t timestamp;
2272  int64_t duration;
2276 
2277 
2289 GAVL_PUBLIC
2291 
2302 GAVL_PUBLIC
2304 
2305 
2306 
2316 GAVL_PUBLIC
2318 
2330 GAVL_PUBLIC
2332 
2341 GAVL_PUBLIC
2343  const gavl_video_format_t * format);
2344 
2354 GAVL_PUBLIC
2356  const gavl_video_format_t * format,
2357  const float * color);
2358 
2371 GAVL_PUBLIC
2373  const gavl_video_frame_t * src1,
2374  const gavl_video_frame_t * src2,
2375  const gavl_video_format_t * format);
2376 
2389 GAVL_PUBLIC
2390 void gavl_video_frame_psnr(double * psnr,
2391  const gavl_video_frame_t * src1,
2392  const gavl_video_frame_t * src2,
2393  const gavl_video_format_t * format);
2394 
2421 GAVL_PUBLIC
2422 int gavl_video_frame_ssim(const gavl_video_frame_t * src1,
2423  const gavl_video_frame_t * src2,
2424  gavl_video_frame_t * dst,
2425  const gavl_video_format_t * format);
2426 
2440 GAVL_PUBLIC
2441 void gavl_video_frame_copy(const gavl_video_format_t * format,
2442  gavl_video_frame_t * dst,
2443  const gavl_video_frame_t * src);
2444 
2457 GAVL_PUBLIC
2459  gavl_video_frame_t * dst,
2460  const gavl_video_frame_t * src, int plane);
2461 
2473 GAVL_PUBLIC
2475  gavl_video_frame_t * dst,
2476  const gavl_video_frame_t * src);
2477 
2489 GAVL_PUBLIC
2491  gavl_video_frame_t * dst,
2492  const gavl_video_frame_t * src);
2493 
2505 GAVL_PUBLIC
2507  gavl_video_frame_t * dst,
2508  const gavl_video_frame_t * src);
2509 
2522 GAVL_PUBLIC
2524  const gavl_video_frame_t * src);
2525 
2526 
2544 GAVL_PUBLIC
2546  const gavl_video_frame_t * src,
2547  gavl_video_frame_t * dst,
2548  gavl_rectangle_i_t * src_rect);
2549 
2565 GAVL_PUBLIC
2567  const gavl_video_frame_t * src,
2568  gavl_video_frame_t * dst,
2569  int field);
2570 
2571 
2572 
2585 GAVL_PUBLIC
2587  const gavl_video_format_t * format,
2588  const char * namebase);
2589 
2600 GAVL_PUBLIC
2602  const gavl_video_format_t * format);
2603 
2616 GAVL_PUBLIC
2618  const gavl_video_format_t * format,
2619  uint8_t * buffer);
2620 
2635 GAVL_PUBLIC
2638  const gavl_video_frame_t * src,
2639  gavl_video_frame_t * dst);
2640 
2656 GAVL_PUBLIC
2659  const gavl_video_frame_t * src,
2660  gavl_video_frame_t * dst);
2661 
2662 
2674 GAVL_PUBLIC
2675 int gavl_video_frames_equal(const gavl_video_format_t * format,
2676  const gavl_video_frame_t * f1,
2677  const gavl_video_frame_t * f2);
2678 
2679 
2680 /*****************************
2681  Conversion options
2682 ******************************/
2683 
2699 #define GAVL_FORCE_DEINTERLACE (1<<0)
2700 
2705 #define GAVL_CONVOLVE_CHROMA (1<<1)
2706 
2711 #define GAVL_CONVOLVE_NORMALIZE (1<<2)
2712 
2720 #define GAVL_RESAMPLE_CHROMA (1<<3)
2721 
2729 typedef enum
2730  {
2734 
2741 typedef enum
2742  {
2748 
2755 typedef enum
2756  {
2760 
2765 typedef enum
2766  {
2777 
2787 typedef enum
2788  {
2794 
2801 typedef struct gavl_video_options_s gavl_video_options_t;
2802 
2803 /* Default Options */
2804 
2810 GAVL_PUBLIC
2812 
2822 GAVL_PUBLIC
2824 
2831 GAVL_PUBLIC
2833  const gavl_video_options_t * src);
2834 
2840 GAVL_PUBLIC
2842 
2843 
2858 GAVL_PUBLIC
2860  const gavl_rectangle_f_t * src_rect,
2861  const gavl_rectangle_i_t * dst_rect);
2862 
2870 GAVL_PUBLIC
2872  gavl_rectangle_f_t * src_rect,
2873  gavl_rectangle_i_t * dst_rect);
2874 
2881 GAVL_PUBLIC
2882 void gavl_video_options_set_quality(gavl_video_options_t * opt, int quality);
2883 
2890 GAVL_PUBLIC
2892 
2893 
2900 GAVL_PUBLIC
2902  int conversion_flags);
2903 
2910 GAVL_PUBLIC
2912 
2919 GAVL_PUBLIC
2921  gavl_alpha_mode_t alpha_mode);
2922 
2929 GAVL_PUBLIC gavl_alpha_mode_t
2931 
2932 
2939 GAVL_PUBLIC
2941  gavl_scale_mode_t scale_mode);
2942 
2949 GAVL_PUBLIC gavl_scale_mode_t
2951 
2952 
2959 GAVL_PUBLIC
2961  int order);
2962 
2969 GAVL_PUBLIC
2971 
2972 
2979 GAVL_PUBLIC
2981  const float * color);
2982 
2989 GAVL_PUBLIC
2991  float * color);
2992 
2999 GAVL_PUBLIC
3001  gavl_deinterlace_mode_t deinterlace_mode);
3002 
3009 GAVL_PUBLIC gavl_deinterlace_mode_t
3011 
3018 GAVL_PUBLIC
3020  gavl_deinterlace_drop_mode_t deinterlace_drop_mode);
3021 
3028 GAVL_PUBLIC gavl_deinterlace_drop_mode_t
3030 
3039 GAVL_PUBLIC
3042 
3043 
3052 GAVL_PUBLIC gavl_downscale_filter_t
3054 
3072 GAVL_PUBLIC
3074  float f);
3075 
3084 GAVL_PUBLIC
3086 
3095 GAVL_PUBLIC
3097 
3098 
3107 GAVL_PUBLIC
3109 
3119 GAVL_PUBLIC
3121  gavl_video_run_func func,
3122  void * client_data);
3123 
3133 GAVL_PUBLIC
3135  void ** client_data);
3136 
3146 GAVL_PUBLIC
3148  gavl_video_stop_func func,
3149  void * client_data);
3150 
3160 GAVL_PUBLIC
3162  void ** client_data);
3163 
3164 
3165 /***************************************************
3166  * Create and destroy video converters
3167  ***************************************************/
3168 
3201 typedef struct gavl_video_converter_s gavl_video_converter_t;
3202 
3208 GAVL_PUBLIC
3210 
3216 GAVL_PUBLIC
3218 
3219 /**************************************************
3220  * Get options. Change the options with the gavl_video_options_set_*
3221  * functions above
3222  **************************************************/
3223 
3232 GAVL_PUBLIC gavl_video_options_t *
3234 
3235 
3249 GAVL_PUBLIC
3251  const gavl_video_format_t * input_format,
3252  const gavl_video_format_t * output_format);
3253 
3266 GAVL_PUBLIC
3268 
3269 
3270 /***************************************************
3271  * Convert a frame
3272  ***************************************************/
3273 
3281 GAVL_PUBLIC
3283  const gavl_video_frame_t * input_frame,
3284  gavl_video_frame_t * output_frame);
3285 
3317 typedef struct gavl_video_scaler_s gavl_video_scaler_t;
3318 
3324 GAVL_PUBLIC
3326 
3332 GAVL_PUBLIC
3334 
3343 GAVL_PUBLIC gavl_video_options_t *
3345 
3358 GAVL_PUBLIC
3360  const gavl_video_format_t * src_format,
3361  const gavl_video_format_t * dst_format);
3362 
3384 GAVL_PUBLIC
3386  const gavl_video_format_t * format,
3387  int h_radius, const float * h_coeffs,
3388  int v_radius, const float * v_coeffs);
3389 
3397 GAVL_PUBLIC
3399  const gavl_video_frame_t * input_frame,
3400  gavl_video_frame_t * output_frame);
3401 
3417 typedef struct gavl_video_deinterlacer_s gavl_video_deinterlacer_t;
3418 
3424 GAVL_PUBLIC
3426 
3432 GAVL_PUBLIC
3434 
3443 GAVL_PUBLIC gavl_video_options_t *
3445 
3456 GAVL_PUBLIC
3458  const gavl_video_format_t * src_format);
3459 
3460 
3468 GAVL_PUBLIC
3470  const gavl_video_frame_t * input_frame,
3471  gavl_video_frame_t * output_frame);
3472 
3473 
3474 
3475 /**************************************************
3476  * Transparent overlays
3477  **************************************************/
3478 
3479 /* Overlay struct */
3480 
3508 typedef struct
3509  {
3512  int dst_x;
3513  int dst_y;
3514  } gavl_overlay_t;
3515 
3522 typedef struct gavl_overlay_blend_context_s gavl_overlay_blend_context_t;
3523 
3529 GAVL_PUBLIC
3531 
3537 GAVL_PUBLIC
3539 
3546 GAVL_PUBLIC gavl_video_options_t *
3548 
3564 GAVL_PUBLIC
3566  const gavl_video_format_t * frame_format,
3567  gavl_video_format_t * overlay_format);
3568 
3578 GAVL_PUBLIC
3580  gavl_overlay_t * ovl);
3581 
3588 GAVL_PUBLIC
3590  gavl_video_frame_t * dst_frame);
3591 
3613 typedef struct gavl_image_transform_s gavl_image_transform_t;
3614 
3628 typedef void (*gavl_image_transform_func)(void * priv,
3629  double xdst,
3630  double ydst,
3631  double * xsrc,
3632  double * ysrc);
3633 
3634 
3641 GAVL_PUBLIC
3643 
3649 GAVL_PUBLIC
3651 
3670 GAVL_PUBLIC
3672  gavl_video_format_t * format,
3673  gavl_image_transform_func func, void * priv);
3674 
3682 GAVL_PUBLIC
3684  gavl_video_frame_t * in_frame,
3685  gavl_video_frame_t * out_frame);
3686 
3697 GAVL_PUBLIC gavl_video_options_t *
3699 
3722 typedef struct
3723  {
3724  int64_t offset;
3725  /* Primary */
3726  int64_t num_entries;
3727  int64_t entries_alloc;
3728 
3729  struct
3730  {
3731  int64_t num_frames;
3732  int64_t duration;
3733  } * entries;
3734 
3737 
3738  struct
3739  {
3740  int64_t pts;
3742  } * timecodes;
3743 
3744  /* Secondary */
3745 
3747 
3754 
3765 GAVL_PUBLIC gavl_frame_table_t *
3766 gavl_frame_table_create_audio(int samplerate, int64_t offset, int64_t duration,
3767  gavl_timecode_format_t * fmt_ret);
3768 
3780 GAVL_PUBLIC gavl_frame_table_t *
3781 gavl_frame_table_create_cfr(int64_t offset, int64_t frame_duration,
3782  int64_t num_frames,
3783  gavl_timecode_t start_timecode);
3784 
3792 GAVL_PUBLIC gavl_frame_table_t *
3794 
3795 
3796 
3803 GAVL_PUBLIC void gavl_frame_table_destroy(gavl_frame_table_t * t);
3804 
3812 GAVL_PUBLIC void gavl_frame_table_append_entry(gavl_frame_table_t * t, int64_t duration);
3813 
3822 GAVL_PUBLIC void
3824  int64_t pts, gavl_timecode_t tc);
3825 
3836 GAVL_PUBLIC int64_t
3838  int64_t frame, int * duration);
3839 
3850 GAVL_PUBLIC int64_t
3852  int64_t time,
3853  int64_t * start_time);
3854 
3865 GAVL_PUBLIC gavl_timecode_t
3867  int64_t time,
3868  int64_t * start_time,
3869  const gavl_timecode_format_t * fmt);
3870 
3880 GAVL_PUBLIC int64_t
3882  gavl_timecode_t tc,
3883  const gavl_timecode_format_t * fmt);
3884 
3885 
3896 GAVL_PUBLIC gavl_timecode_t
3898  int64_t frame,
3899  int64_t * start_time,
3900  const gavl_timecode_format_t * fmt);
3901 
3902 
3903 
3911 GAVL_PUBLIC int64_t
3913 
3921 GAVL_PUBLIC int64_t
3923 
3931 GAVL_PUBLIC int64_t
3933 
3942 GAVL_PUBLIC
3944  const char * filename);
3945 
3953 GAVL_PUBLIC
3954 gavl_frame_table_t * gavl_frame_table_load(const char * filename);
3955 
3962 GAVL_PUBLIC void
3964 
3965 
3966 
3967 
3968 
3969 
3975 #ifdef __cplusplus
3976 }
3977 #endif
3978 
3979 #endif /* GAVL_H_INCLUDED */