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 
2246 GAVL_PUBLIC
2247 void gavl_get_field_format(const gavl_video_format_t * frame_format,
2248  gavl_video_format_t * field_format,
2249  int field);
2250 
2251 
2258 GAVL_PUBLIC
2259 void gavl_video_format_dump(const gavl_video_format_t * format);
2260 
2261 
2284 typedef struct
2285  {
2286  uint8_t * planes[GAVL_MAX_PLANES];
2287  int strides[GAVL_MAX_PLANES];
2289  void * user_data;
2290  int64_t timestamp;
2291  int64_t duration;
2295 
2296 
2308 GAVL_PUBLIC
2310 
2321 GAVL_PUBLIC
2323 
2324 
2325 
2335 GAVL_PUBLIC
2337 
2349 GAVL_PUBLIC
2351 
2360 GAVL_PUBLIC
2362  const gavl_video_format_t * format);
2363 
2373 GAVL_PUBLIC
2375  const gavl_video_format_t * format,
2376  const float * color);
2377 
2390 GAVL_PUBLIC
2392  const gavl_video_frame_t * src1,
2393  const gavl_video_frame_t * src2,
2394  const gavl_video_format_t * format);
2395 
2408 GAVL_PUBLIC
2409 void gavl_video_frame_psnr(double * psnr,
2410  const gavl_video_frame_t * src1,
2411  const gavl_video_frame_t * src2,
2412  const gavl_video_format_t * format);
2413 
2440 GAVL_PUBLIC
2441 int gavl_video_frame_ssim(const gavl_video_frame_t * src1,
2442  const gavl_video_frame_t * src2,
2443  gavl_video_frame_t * dst,
2444  const gavl_video_format_t * format);
2445 
2459 GAVL_PUBLIC
2460 void gavl_video_frame_copy(const gavl_video_format_t * format,
2461  gavl_video_frame_t * dst,
2462  const gavl_video_frame_t * src);
2463 
2476 GAVL_PUBLIC
2478  gavl_video_frame_t * dst,
2479  const gavl_video_frame_t * src, int plane);
2480 
2492 GAVL_PUBLIC
2494  gavl_video_frame_t * dst,
2495  const gavl_video_frame_t * src);
2496 
2508 GAVL_PUBLIC
2510  gavl_video_frame_t * dst,
2511  const gavl_video_frame_t * src);
2512 
2524 GAVL_PUBLIC
2526  gavl_video_frame_t * dst,
2527  const gavl_video_frame_t * src);
2528 
2541 GAVL_PUBLIC
2543  const gavl_video_frame_t * src);
2544 
2545 
2563 GAVL_PUBLIC
2565  const gavl_video_frame_t * src,
2566  gavl_video_frame_t * dst,
2567  gavl_rectangle_i_t * src_rect);
2568 
2584 GAVL_PUBLIC
2586  const gavl_video_frame_t * src,
2587  gavl_video_frame_t * dst,
2588  int field);
2589 
2590 
2591 
2604 GAVL_PUBLIC
2606  const gavl_video_format_t * format,
2607  const char * namebase);
2608 
2619 GAVL_PUBLIC
2621  const gavl_video_format_t * format);
2622 
2635 GAVL_PUBLIC
2637  const gavl_video_format_t * format,
2638  uint8_t * buffer);
2639 
2654 GAVL_PUBLIC
2657  const gavl_video_frame_t * src,
2658  gavl_video_frame_t * dst);
2659 
2675 GAVL_PUBLIC
2678  const gavl_video_frame_t * src,
2679  gavl_video_frame_t * dst);
2680 
2681 
2693 GAVL_PUBLIC
2694 int gavl_video_frames_equal(const gavl_video_format_t * format,
2695  const gavl_video_frame_t * f1,
2696  const gavl_video_frame_t * f2);
2697 
2698 
2699 /*****************************
2700  Conversion options
2701 ******************************/
2702 
2718 #define GAVL_FORCE_DEINTERLACE (1<<0)
2719 
2724 #define GAVL_CONVOLVE_CHROMA (1<<1)
2725 
2730 #define GAVL_CONVOLVE_NORMALIZE (1<<2)
2731 
2739 #define GAVL_RESAMPLE_CHROMA (1<<3)
2740 
2748 typedef enum
2749  {
2753 
2760 typedef enum
2761  {
2767 
2774 typedef enum
2775  {
2779 
2784 typedef enum
2785  {
2796 
2806 typedef enum
2807  {
2813 
2820 typedef struct gavl_video_options_s gavl_video_options_t;
2821 
2822 /* Default Options */
2823 
2829 GAVL_PUBLIC
2831 
2841 GAVL_PUBLIC
2843 
2850 GAVL_PUBLIC
2852  const gavl_video_options_t * src);
2853 
2859 GAVL_PUBLIC
2861 
2862 
2877 GAVL_PUBLIC
2879  const gavl_rectangle_f_t * src_rect,
2880  const gavl_rectangle_i_t * dst_rect);
2881 
2889 GAVL_PUBLIC
2891  gavl_rectangle_f_t * src_rect,
2892  gavl_rectangle_i_t * dst_rect);
2893 
2900 GAVL_PUBLIC
2901 void gavl_video_options_set_quality(gavl_video_options_t * opt, int quality);
2902 
2909 GAVL_PUBLIC
2911 
2912 
2919 GAVL_PUBLIC
2921  int conversion_flags);
2922 
2929 GAVL_PUBLIC
2931 
2938 GAVL_PUBLIC
2940  gavl_alpha_mode_t alpha_mode);
2941 
2948 GAVL_PUBLIC gavl_alpha_mode_t
2950 
2951 
2958 GAVL_PUBLIC
2960  gavl_scale_mode_t scale_mode);
2961 
2968 GAVL_PUBLIC gavl_scale_mode_t
2970 
2971 
2978 GAVL_PUBLIC
2980  int order);
2981 
2988 GAVL_PUBLIC
2990 
2991 
2998 GAVL_PUBLIC
3000  const float * color);
3001 
3008 GAVL_PUBLIC
3010  float * color);
3011 
3018 GAVL_PUBLIC
3020  gavl_deinterlace_mode_t deinterlace_mode);
3021 
3028 GAVL_PUBLIC gavl_deinterlace_mode_t
3030 
3037 GAVL_PUBLIC
3039  gavl_deinterlace_drop_mode_t deinterlace_drop_mode);
3040 
3047 GAVL_PUBLIC gavl_deinterlace_drop_mode_t
3049 
3058 GAVL_PUBLIC
3061 
3062 
3071 GAVL_PUBLIC gavl_downscale_filter_t
3073 
3091 GAVL_PUBLIC
3093  float f);
3094 
3103 GAVL_PUBLIC
3105 
3114 GAVL_PUBLIC
3116 
3117 
3126 GAVL_PUBLIC
3128 
3138 GAVL_PUBLIC
3140  gavl_video_run_func func,
3141  void * client_data);
3142 
3152 GAVL_PUBLIC
3154  void ** client_data);
3155 
3165 GAVL_PUBLIC
3167  gavl_video_stop_func func,
3168  void * client_data);
3169 
3179 GAVL_PUBLIC
3181  void ** client_data);
3182 
3183 
3184 /***************************************************
3185  * Create and destroy video converters
3186  ***************************************************/
3187 
3220 typedef struct gavl_video_converter_s gavl_video_converter_t;
3221 
3227 GAVL_PUBLIC
3229 
3235 GAVL_PUBLIC
3237 
3238 /**************************************************
3239  * Get options. Change the options with the gavl_video_options_set_*
3240  * functions above
3241  **************************************************/
3242 
3251 GAVL_PUBLIC gavl_video_options_t *
3253 
3254 
3268 GAVL_PUBLIC
3270  const gavl_video_format_t * input_format,
3271  const gavl_video_format_t * output_format);
3272 
3285 GAVL_PUBLIC
3287 
3288 
3289 /***************************************************
3290  * Convert a frame
3291  ***************************************************/
3292 
3300 GAVL_PUBLIC
3302  const gavl_video_frame_t * input_frame,
3303  gavl_video_frame_t * output_frame);
3304 
3336 typedef struct gavl_video_scaler_s gavl_video_scaler_t;
3337 
3343 GAVL_PUBLIC
3345 
3351 GAVL_PUBLIC
3353 
3362 GAVL_PUBLIC gavl_video_options_t *
3364 
3377 GAVL_PUBLIC
3379  const gavl_video_format_t * src_format,
3380  const gavl_video_format_t * dst_format);
3381 
3403 GAVL_PUBLIC
3405  const gavl_video_format_t * format,
3406  int h_radius, const float * h_coeffs,
3407  int v_radius, const float * v_coeffs);
3408 
3416 GAVL_PUBLIC
3418  const gavl_video_frame_t * input_frame,
3419  gavl_video_frame_t * output_frame);
3420 
3436 typedef struct gavl_video_deinterlacer_s gavl_video_deinterlacer_t;
3437 
3443 GAVL_PUBLIC
3445 
3451 GAVL_PUBLIC
3453 
3462 GAVL_PUBLIC gavl_video_options_t *
3464 
3475 GAVL_PUBLIC
3477  const gavl_video_format_t * src_format);
3478 
3479 
3487 GAVL_PUBLIC
3489  const gavl_video_frame_t * input_frame,
3490  gavl_video_frame_t * output_frame);
3491 
3492 
3493 
3494 /**************************************************
3495  * Transparent overlays
3496  **************************************************/
3497 
3498 /* Overlay struct */
3499 
3527 typedef struct
3528  {
3531  int dst_x;
3532  int dst_y;
3533  } gavl_overlay_t;
3534 
3541 typedef struct gavl_overlay_blend_context_s gavl_overlay_blend_context_t;
3542 
3548 GAVL_PUBLIC
3550 
3556 GAVL_PUBLIC
3558 
3565 GAVL_PUBLIC gavl_video_options_t *
3567 
3583 GAVL_PUBLIC
3585  const gavl_video_format_t * frame_format,
3586  gavl_video_format_t * overlay_format);
3587 
3597 GAVL_PUBLIC
3599  gavl_overlay_t * ovl);
3600 
3607 GAVL_PUBLIC
3609  gavl_video_frame_t * dst_frame);
3610 
3632 typedef struct gavl_image_transform_s gavl_image_transform_t;
3633 
3647 typedef void (*gavl_image_transform_func)(void * priv,
3648  double xdst,
3649  double ydst,
3650  double * xsrc,
3651  double * ysrc);
3652 
3653 
3660 GAVL_PUBLIC
3662 
3668 GAVL_PUBLIC
3670 
3689 GAVL_PUBLIC
3691  gavl_video_format_t * format,
3692  gavl_image_transform_func func, void * priv);
3693 
3701 GAVL_PUBLIC
3703  gavl_video_frame_t * in_frame,
3704  gavl_video_frame_t * out_frame);
3705 
3716 GAVL_PUBLIC gavl_video_options_t *
3718 
3741 typedef struct
3742  {
3743  int64_t offset;
3744  /* Primary */
3745  int64_t num_entries;
3746  int64_t entries_alloc;
3747 
3748  struct
3749  {
3750  int64_t num_frames;
3751  int64_t duration;
3752  } * entries;
3753 
3756 
3757  struct
3758  {
3759  int64_t pts;
3761  } * timecodes;
3762 
3763  /* Secondary */
3764 
3766 
3773 
3784 GAVL_PUBLIC gavl_frame_table_t *
3785 gavl_frame_table_create_audio(int samplerate, int64_t offset, int64_t duration,
3786  gavl_timecode_format_t * fmt_ret);
3787 
3798 GAVL_PUBLIC gavl_frame_table_t *
3799 gavl_frame_table_create_cfr(int64_t offset, int64_t frame_duration,
3800  int64_t num_frames,
3801  gavl_timecode_t start_timecode);
3802 
3810 GAVL_PUBLIC gavl_frame_table_t *
3812 
3813 
3814 
3821 GAVL_PUBLIC void gavl_frame_table_destroy(gavl_frame_table_t * t);
3822 
3830 GAVL_PUBLIC void gavl_frame_table_append_entry(gavl_frame_table_t * t, int64_t duration);
3831 
3840 GAVL_PUBLIC void
3842  int64_t pts, gavl_timecode_t tc);
3843 
3854 GAVL_PUBLIC int64_t
3856  int64_t frame, int * duration);
3857 
3868 GAVL_PUBLIC int64_t
3870  int64_t time,
3871  int64_t * start_time);
3872 
3883 GAVL_PUBLIC gavl_timecode_t
3885  int64_t time,
3886  int64_t * start_time,
3887  const gavl_timecode_format_t * fmt);
3888 
3898 GAVL_PUBLIC int64_t
3900  gavl_timecode_t tc,
3901  const gavl_timecode_format_t * fmt);
3902 
3903 
3914 GAVL_PUBLIC gavl_timecode_t
3916  int64_t frame,
3917  int64_t * start_time,
3918  const gavl_timecode_format_t * fmt);
3919 
3920 
3921 
3929 GAVL_PUBLIC int64_t
3931 
3939 GAVL_PUBLIC int64_t
3941 
3949 GAVL_PUBLIC int64_t
3951 
3960 GAVL_PUBLIC
3962  const char * filename);
3963 
3971 GAVL_PUBLIC
3972 gavl_frame_table_t * gavl_frame_table_load(const char * filename);
3973 
3980 GAVL_PUBLIC void
3982 
3983 
3984 
3985 
3986 
3987 
3993 #ifdef __cplusplus
3994 }
3995 #endif
3996 
3997 #endif /* GAVL_H_INCLUDED */