gmerlin
plugin.h
1 /*****************************************************************
2  * gmerlin - a general purpose multimedia framework and applications
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 
22 #ifndef __BG_PLUGIN_H_
23 #define __BG_PLUGIN_H_
24 
25 #include <gavl/gavl.h>
26 #include <gavl/compression.h>
27 #include <gavl/connectors.h>
28 #include <gavl/metadata.h>
29 #include <gavl/edl.h>
30 
31 #include <gavl/gavf.h>
32 
33 #include <gmerlin/parameter.h>
34 #include <gmerlin/streaminfo.h>
35 #include <gmerlin/accelerator.h>
36 #include <gmerlin/edl.h>
37 
81 typedef int (*bg_read_audio_func_t)(void * priv, gavl_audio_frame_t* frame,
82  int stream,
83  int num_samples);
84 
96 typedef int (*bg_read_video_func_t)(void * priv, gavl_video_frame_t* frame,
97  int stream);
98 
108 #define BG_PLUGIN_REMOVABLE (1<<0)
109 #define BG_PLUGIN_FILE (1<<1)
110 #define BG_PLUGIN_RECORDER (1<<2)
111 #define BG_PLUGIN_URL (1<<3)
112 #define BG_PLUGIN_PLAYBACK (1<<4)
113 #define BG_PLUGIN_PIPE (1<<8)
114 #define BG_PLUGIN_TUNER (1<<9)
115 #define BG_PLUGIN_FILTER_1 (1<<10)
116 #define BG_PLUGIN_EMBED_WINDOW (1<<11)
117 #define BG_PLUGIN_VISUALIZE_FRAME (1<<12)
118 #define BG_PLUGIN_VISUALIZE_GL (1<<13)
119 #define BG_PLUGIN_PP (1<<14)
120 #define BG_PLUGIN_CALLBACKS (1<<15)
121 #define BG_PLUGIN_BROADCAST (1<<16)
122 #define BG_PLUGIN_DEVPARAM (1<<17)
123 #define BG_PLUGIN_OV_STILL (1<<18)
124 #define BG_PLUGIN_GAVF_IO (1<<19)
125 
126 #define BG_PLUGIN_AUDIO_COMPRESSOR (1<<19)
127 #define BG_PLUGIN_VIDEO_COMPRESSOR (1<<20)
128 #define BG_PLUGIN_AUDIO_DECOMPRESSOR (1<<21)
129 #define BG_PLUGIN_VIDEO_DECOMPRESSOR (1<<22)
130 #define BG_PLUGIN_OVERLAY_COMPRESSOR (1<<23)
131 #define BG_PLUGIN_OVERLAY_DECOMPRESSOR (1<<24)
132 
133 #define BG_PLUGIN_UNSUPPORTED (1<<25)
134 
135 
136 #define BG_PLUGIN_ALL 0xFFFFFFFF
137 
138 
141 #define BG_PLUGIN_API_VERSION 27
142 
143 /* Include this into all plugin modules exactly once
144  to let the plugin loader obtain the API version */
145 
146 #define BG_GET_PLUGIN_API_VERSION \
147  int get_plugin_api_version() __attribute__ ((visibility("default"))); \
148  int get_plugin_api_version() { return BG_PLUGIN_API_VERSION; }
149 
150 #define BG_PLUGIN_PRIORITY_MIN 1
151 #define BG_PLUGIN_PRIORITY_MAX 10
152 
165 typedef enum
166  {
170 
172 
173 /***************************************************
174  * Plugin API
175  *
176  * Plugin dlls contain a symbol "the_plugin",
177  * which points to one of the structures below.
178  * The member functions are described below.
179  *
180  ***************************************************/
181 
182 /*
183  * Plugin types
184  */
185 
190 typedef enum
191  {
193  BG_PLUGIN_INPUT = (1<<0),
202  BG_PLUGIN_ENCODER = (1<<9),
210  BG_PLUGIN_CODEC = (1<<17),
212 
221 typedef struct
222  {
223  char * device;
224  char * name;
226 
238  const char * device,
239  const char * name);
240 
247 
248 /* Common part */
249 
255 
260 struct bg_plugin_common_s
261  {
262  char * gettext_domain;
263  char * gettext_directory;
264 
265  char * name;
266  char * long_name;
268  int flags;
269 
270  char * description;
271 
272  /*
273  * If there might be more than one plugin for the same
274  * job, there is a priority (0..10) which is used for the
275  * decision
276  */
277 
278  int priority;
279 
284  void * (*create)();
285 
295  void (*destroy)(void* priv);
296 
304  const bg_parameter_info_t * (*get_parameters)(void * priv);
305 
310 
318 
328  int (*check_device)(const char * device, char ** name);
329 
330 
338  bg_device_info_t * (*find_devices)();
339 
340  };
341 
342 /*
343  * Plugin callbacks: Functions called by the
344  * plugin to reflect user input or other changes
345  * Applications might pass NULL callbacks,
346  * so plugins MUST check for valid callbacks structure
347  * before calling any of these functions
348  */
349 
350 /* Input plugin */
351 
358 
368  {
374  void (*duration_changed)(void * data, gavl_time_t duration);
375 
383  void (*metadata_changed)(void * data, const gavl_metadata_t * m);
384 
393  void (*buffer_notify)(void * data, float percentage);
394 
408  int (*user_pass)(void * data, const char * resource,
409  char ** username, char ** password);
410 
422  void (*aspect_changed)(void * data, int stream,
423  int pixel_width, int pixel_height);
424 
425 
426  void * data;
427 
428  };
429 
430 /*************************************************
431  * MEDIA INPUT
432  *************************************************/
433 
438 typedef struct bg_input_plugin_s bg_input_plugin_t;
439 
440 
450 struct bg_input_plugin_s
451  {
453 
459  const char * (*get_protocols)(void * priv);
464  const char * (*get_mimetypes)(void * priv);
465 
470  const char * (*get_extensions)(void * priv);
471 
481  void (*set_callbacks)(void * priv, bg_input_callbacks_t * callbacks);
482 
488  int (*open)(void * priv, const char * arg);
489 
498  int (*open_fd)(void * priv, int fd, int64_t total_bytes,
499  const char * mimetype);
500 
512  int (*open_io)(void * priv, gavf_io_t * io);
513 
519  const gavl_edl_t * (*get_edl)(void * priv);
520 
528  const char * (*get_disc_name)(void * priv);
529 
538  int (*eject_disc)(const char * device);
539 
547  int (*get_num_tracks)(void * priv);
548 
565  bg_track_info_t * (*get_track_info)(void * priv, int track);
566 
577  int (*set_track)(void * priv, int track);
578 
589  int (*get_audio_compression_info)(void * priv, int stream,
590  gavl_compression_info_t * info);
591 
602  int (*get_video_compression_info)(void * priv, int stream,
603  gavl_compression_info_t * info);
604 
615  int (*get_overlay_compression_info)(void * priv, int stream,
616  gavl_compression_info_t * info);
617 
618  /*
619  * These functions set the audio- video- and subpicture streams
620  * as well as programs (== DVD Angles). All these start with 0
621  *
622  * Arguments for actions are defined in the enum bg_stream_action_t
623  * above. Plugins must return FALSE on failure (e.g. no such stream)
624  *
625  * Functions must be defined only, if the corresponding stream
626  * type is supported by the plugin and can be switched.
627  * Single stream plugins can leave these NULL
628  * Gmerlin will never try to call these functions on nonexistent streams
629  */
630 
638  int (*set_audio_stream)(void * priv, int stream, bg_stream_action_t action);
639 
647  int (*set_video_stream)(void * priv, int stream, bg_stream_action_t action);
648 
656  int (*set_text_stream)(void * priv, int stream, bg_stream_action_t action);
657 
665  int (*set_overlay_stream)(void * priv, int stream, bg_stream_action_t action);
666 
678  int (*start)(void * priv);
679 
689  gavl_frame_table_t * (*get_frame_table)(void * priv, int stream);
690 
703  // bg_read_audio_func_t read_audio;
704 
713  gavl_audio_source_t * (*get_audio_source)(void * priv, int stream);
714 
724  // int (*has_still)(void * priv, int stream);
725 
733  // bg_read_video_func_t read_video;
734 
744  gavl_video_source_t * (*get_video_source)(void * priv, int stream);
745 
756  // int (*read_audio_packet)(void * priv, int stream, gavl_packet_t * p);
757 
768  // int (*read_video_packet)(void * priv, int stream, gavl_packet_t * p);
769 
778  gavl_packet_source_t * (*get_audio_packet_source)(void * priv, int stream);
779 
788  gavl_packet_source_t * (*get_video_packet_source)(void * priv, int stream);
789 
798  gavl_packet_source_t * (*get_overlay_packet_source)(void * priv, int stream);
799 
812  void (*skip_video)(void * priv, int stream, int64_t * time, int scale, int exact);
813 
820  // int (*has_subtitle)(void * priv, int stream);
821 
833  // int (*read_subtitle_overlay)(void * priv,
834  // gavl_overlay_t*ovl, int stream);
835 
844  gavl_video_source_t * (*get_overlay_source)(void * priv, int stream);
845 
864  // int (*read_subtitle_text)(void * priv,
865  // char ** text, int * text_alloc,
866  // int64_t * start_time,
867  // int64_t * duration, int stream);
868 
877  gavl_packet_source_t * (*get_text_source)(void * priv, int stream);
878 
887  gavl_packet_source_t * (*get_subtitle_packet_source)(void * priv, int stream);
888 
900  void (*seek)(void * priv, int64_t * time, int scale);
901 
909  void (*stop)(void * priv);
910 
917  void (*close)(void * priv);
918 
919  };
920 
930 typedef struct bg_oa_plugin_s bg_oa_plugin_t;
931 
938 struct bg_oa_plugin_s
939  {
941 
951  int (*open)(void * priv, gavl_audio_format_t* format);
952 
959  int (*start)(void * priv);
960 
966  gavl_audio_sink_t * (*get_sink)(void * priv);
967 
976  int (*get_delay)(void * priv);
977 
985  void (*stop)(void * priv);
986 
993  void (*close)(void * priv);
994  };
995 
996 /*******************************************
997  * Recorder
998  *******************************************/
999 
1006 
1016  {
1024  void (*metadata_changed)(void * data, const gavl_metadata_t * m);
1026  void * data;
1027 
1028  };
1029 
1030 
1036 
1043 struct bg_recorder_plugin_s
1044  {
1046 
1056  void (*set_callbacks)(void * priv, bg_recorder_callbacks_t * callbacks);
1057 
1068  int (*open)(void * priv, gavl_audio_format_t * audio_format,
1069  gavl_video_format_t * video_format, gavl_metadata_t * m);
1070 
1074 
1078  gavl_audio_source_t * (*get_audio_source)(void * priv);
1079 
1083 
1087  gavl_video_source_t * (*get_video_source)(void * priv);
1088 
1093  void (*close)(void * priv);
1094  };
1095 
1096 /*******************************************
1097  * VIDEO OUTPUT
1098  *******************************************/
1099 
1100 /* Callbacks */
1101 
1112 typedef struct bg_ov_callbacks_s bg_ov_callbacks_t;
1113 
1119 struct bg_ov_callbacks_s
1120  {
1127  const bg_accelerator_map_t * accel_map;
1128 
1134  int (*accel_callback)(void * data, int id);
1135 
1149  int (*key_callback)(void * data, int key, int mask);
1150 
1158  int (*key_release_callback)(void * data, int key, int mask);
1159 
1169  int (*button_callback)(void * data, int x, int y, int button, int mask);
1170 
1180  int (*button_release_callback)(void * data, int x, int y, int button, int mask);
1181 
1190  int (*motion_callback)(void * data, int x, int y, int mask);
1191 
1197  void (*show_window)(void * data, int show);
1198 
1206  void (*brightness_callback)(void * data, float val);
1207 
1215  void (*saturation_callback)(void * data, float val);
1216 
1224  void (*contrast_callback)(void * data, float val);
1225 
1233  void (*hue_callback)(void * data, float val);
1235  void * data;
1236  };
1237 
1238 /* Plugin structure */
1239 
1244 typedef struct bg_ov_plugin_s bg_ov_plugin_t;
1245 
1254 struct bg_ov_plugin_s
1255  {
1257 
1268  void (*set_window)(void * priv, const char * window_id);
1269 
1275  const char * (*get_window)(void * priv);
1276 
1289  void (*set_window_options)(void * priv, const char * name,
1290  const char * klass,
1291  const gavl_video_frame_t * icon,
1292  const gavl_video_format_t * icon_format);
1293 
1299  void (*set_window_title)(void * priv, const char * title);
1300 
1301 
1307  void (*set_callbacks)(void * priv, bg_ov_callbacks_t * callbacks);
1308 
1319  int (*open)(void * priv, gavl_video_format_t * format, int keep_aspect);
1320 
1325  // gavl_video_frame_t * (*get_frame)(void * priv);
1326 
1340  gavl_video_sink_t * (*add_overlay_stream)(void * priv, gavl_video_format_t * format);
1341 
1354  // gavl_overlay_t * (*create_overlay)(void * priv, int id);
1355 
1362  // void (*set_overlay)(void * priv, int stream, gavl_overlay_t * ovl);
1363 
1369  gavl_video_sink_t * (*get_sink)(void * priv);
1370 
1379  void (*handle_events)(void * priv);
1380 
1387  void (*update_aspect)(void * priv, int pixel_width, int pixel_height);
1388 
1395  // void (*destroy_overlay)(void * priv, int id, gavl_overlay_t * ovl);
1396 
1404  void (*close)(void * priv);
1405 
1410  void (*show_window)(void * priv, int show);
1411  };
1412 
1413 /*******************************************
1414  * ENCODER
1415  *******************************************/
1416 
1428 
1435  {
1436 
1445  int (*create_output_file)(void * data, const char * filename);
1446 
1455  int (*create_temp_file)(void * data, const char * filename);
1457  void * data;
1458  };
1459 
1460 
1466 
1467 
1472 struct bg_encoder_plugin_s
1473  {
1479  int max_overlay_streams;
1480 
1486  void (*set_callbacks)(void * priv, bg_encoder_callbacks_t * cb);
1487 
1497  int (*writes_compressed_audio)(void * priv,
1498  const gavl_audio_format_t * format,
1499  const gavl_compression_info_t * info);
1500 
1510  int (*writes_compressed_video)(void * priv,
1511  const gavl_video_format_t * format,
1512  const gavl_compression_info_t * info);
1513 
1523  int (*writes_compressed_overlay)(void * priv,
1524  const gavl_video_format_t * format,
1525  const gavl_compression_info_t * info);
1526 
1537  int (*open)(void * data, const char * filename,
1538  const gavl_metadata_t * metadata,
1539  const gavl_chapter_list_t * chapter_list);
1540 
1541 
1549  int (*open_io)(void * data, gavf_io_t * io,
1550  const gavl_metadata_t * metadata,
1551  const gavl_chapter_list_t * chapter_list);
1552 
1553 
1554  /* Return per stream parameters */
1555 
1563  const bg_parameter_info_t * (*get_audio_parameters)(void * priv);
1564 
1572  const bg_parameter_info_t * (*get_video_parameters)(void * priv);
1573 
1581  const bg_parameter_info_t * (*get_text_parameters)(void * priv);
1582 
1590  const bg_parameter_info_t * (*get_overlay_parameters)(void * priv);
1591 
1592  /* Add streams. The formats can be changed, be sure to get the
1593  * final formats with get_[audio|video]_format after starting the plugin
1594  * Return value is the index of the added stream.
1595  */
1596 
1608  int (*add_audio_stream)(void * priv, const gavl_metadata_t * m,
1609  const gavl_audio_format_t * format);
1610 
1623  int (*add_audio_stream_compressed)(void * priv, const gavl_metadata_t * m,
1624  const gavl_audio_format_t * format,
1625  const gavl_compression_info_t * info);
1626 
1637  int (*add_video_stream)(void * priv,
1638  const gavl_metadata_t * m,
1639  const gavl_video_format_t * format);
1640 
1652  int (*add_video_stream_compressed)(void * priv,
1653  const gavl_metadata_t * m,
1654  const gavl_video_format_t * format,
1655  const gavl_compression_info_t * info);
1656 
1663  int (*add_text_stream)(void * priv,
1664  const gavl_metadata_t * m,
1665  uint32_t * timescale);
1666 
1679  int (*add_overlay_stream_compressed)(void * priv,
1680  const gavl_metadata_t * m,
1681  const gavl_video_format_t * format,
1682  const gavl_compression_info_t * ci);
1683 
1696  int (*add_overlay_stream)(void * priv,
1697  const gavl_metadata_t * m,
1698  const gavl_video_format_t * format);
1699 
1700  /* Set parameters for the streams */
1701 
1712  void (*set_audio_parameter)(void * priv, int stream, const char * name,
1713  const bg_parameter_value_t * v);
1714 
1726  void (*set_video_parameter)(void * priv, int stream, const char * name,
1727  const bg_parameter_value_t * v);
1728 
1739  void (*set_text_parameter)(void * priv, int stream,
1740  const char * name,
1741  const bg_parameter_value_t * v);
1742 
1753  void (*set_overlay_parameter)(void * priv, int stream,
1754  const char * name,
1755  const bg_parameter_value_t * v);
1756 
1765  int (*set_video_pass)(void * priv, int stream, int pass, int total_passes,
1766  const char * stats_file);
1767 
1776  int (*start)(void * priv);
1777 
1783  gavl_audio_sink_t * (*get_audio_sink)(void * priv, int stream);
1784 
1790  gavl_packet_sink_t * (*get_audio_packet_sink)(void * priv, int stream);
1791 
1797  gavl_video_sink_t * (*get_video_sink)(void * priv, int stream);
1798 
1804  gavl_packet_sink_t * (*get_video_packet_sink)(void * priv, int stream);
1805 
1811  gavl_packet_sink_t * (*get_text_sink)(void * priv, int stream);
1812 
1818  gavl_video_sink_t * (*get_overlay_sink)(void * priv, int stream);
1819 
1825  gavl_packet_sink_t * (*get_overlay_packet_sink)(void * priv, int stream);
1826 
1834  void (*update_metadata)(void * priv, const gavl_metadata_t * m);
1835 
1844  int (*close)(void * data, int do_delete);
1845  };
1846 
1847 
1848 /*******************************************
1849  * ENCODER Postprocessor
1850  *******************************************/
1851 
1866 typedef struct
1867  {
1874  void (*action_callback)(void * data, char * action);
1875 
1885  void (*progress_callback)(void * data, float perc);
1887  void * data;
1888 
1890 
1897 
1904  {
1908  int max_video_streams;
1910  char * supported_extensions;
1911 
1918  void (*set_callbacks)(void * priv,bg_e_pp_callbacks_t * callbacks);
1919 
1927  int (*init)(void * priv);
1928 
1945  void (*add_track)(void * priv, const char * filename,
1946  gavl_metadata_t * metadata, int pp_only);
1947 
1957  void (*run)(void * priv, const char * directory, int cleanup);
1958 
1968  void (*stop)(void * priv);
1969  };
1970 
1971 
1986 
1991  {
1993  const char * extensions;
1994  const char * mimetypes;
1995 
2003  int (*read_header)(void * priv, const char * filename,
2004  gavl_video_format_t * format);
2005 
2011  const gavl_metadata_t * (*get_metadata)(void * priv);
2012 
2019  int (*get_compression_info)(void * priv, gavl_compression_info_t * ci);
2020 
2030  int (*read_image)(void * priv, gavl_video_frame_t * frame);
2031  };
2032 
2037 typedef struct bg_iw_callbacks_s bg_iw_callbacks_t;
2038 
2043 struct bg_iw_callbacks_s
2044  {
2045 
2054  int (*create_output_file)(void * data, const char * filename);
2056  void * data;
2057  };
2058 
2064 
2070  {
2072  const char * extensions;
2073  const char * mimetypes;
2074 
2080  void (*set_callbacks)(void * priv, bg_iw_callbacks_t * cb);
2081 
2092  int (*write_header)(void * priv, const char * filename,
2093  gavl_video_format_t * format, const gavl_metadata_t * m);
2094 
2105  int (*write_image)(void * priv, gavl_video_frame_t * frame);
2106  } ;
2107 
2138 /* Filters */
2139 
2144 typedef struct bg_fa_plugin_s bg_fa_plugin_t;
2145 
2150 struct bg_fa_plugin_s
2151  {
2153 
2160  void (*reset)(void * priv);
2161 
2171  gavl_audio_source_t * (*connect)(void * priv, gavl_audio_source_t *,
2172  const gavl_audio_options_t * opt);
2173 
2183  int (*need_restart)(void * priv);
2184 
2185  };
2186 
2191 typedef struct bg_fv_plugin_s bg_fv_plugin_t;
2192 
2197 struct bg_fv_plugin_s
2198  {
2200 
2207  void (*reset)(void * priv);
2208 
2218  int (*need_restart)(void * priv);
2219 
2227  gavl_video_source_t * (*connect)(void * priv,
2228  gavl_video_source_t * src,
2229  const gavl_video_options_t * opt);
2230 
2231  };
2232 
2233 
2253 
2254 
2270  {
2272 
2278  void (*set_callbacks)(void * priv, bg_ov_callbacks_t * cb);
2279 
2291  int (*open_ov)(void * priv, gavl_audio_format_t * audio_format,
2292  gavl_video_format_t * video_format);
2293 
2304  int (*open_win)(void * priv, gavl_audio_format_t * audio_format,
2305  const char * window_id);
2306 
2319  void (*update)(void * priv, gavl_audio_frame_t * frame);
2320 
2330  void (*draw_frame)(void * priv, gavl_video_frame_t * frame);
2331 
2340  void (*show_frame)(void * priv);
2341 
2346  void (*close)(void * priv);
2347 
2348  };
2349 
2355 typedef struct bg_codec_plugin_s bg_codec_plugin_t;
2356 
2357 
2363 struct bg_codec_plugin_s
2364  {
2366 
2372  const gavl_codec_id_t * (*get_compressions)(void * priv);
2373 
2382  gavl_audio_sink_t * (*open_encode_audio)(void * priv,
2384  gavl_audio_format_t * fmt,
2385  gavl_metadata_t * m);
2386 
2395  gavl_video_sink_t * (*open_encode_video)(void * priv,
2397  gavl_video_format_t * fmt,
2398  gavl_metadata_t * m);
2399 
2408  gavl_video_sink_t * (*open_encode_overlay)(void * priv,
2410  gavl_video_format_t * fmt,
2411  gavl_metadata_t * m);
2412 
2418  void (*set_packet_sink)(void * priv, gavl_packet_sink_t * s);
2419 
2428  gavl_audio_source_t * (*connect_decode_audio)(void * priv,
2429  gavl_packet_source_t * src,
2430  const gavl_compression_info_t * ci,
2431  const gavl_audio_format_t * fmt,
2432  gavl_metadata_t * m);
2433 
2442  gavl_video_source_t * (*connect_decode_video)(void * priv,
2443  gavl_packet_source_t * src,
2444  const gavl_compression_info_t * ci,
2445  const gavl_video_format_t * fmt,
2446  gavl_metadata_t * m);
2447 
2456  gavl_video_source_t * (*connect_decode_overlay)(void * priv,
2457  gavl_packet_source_t * src,
2458  const gavl_compression_info_t * ci,
2459  const gavl_video_format_t * fmt,
2460  gavl_metadata_t * m);
2461 
2462 
2469  void (*reset)(void * priv);
2470 
2477  int64_t (*skip)(void * priv, int64_t t);
2478 
2486  int (*set_pass)(void * priv, int pass, int total_passes,
2487  const char * stats_file);
2488 
2489  };
2490 
2495 #endif // __BG_PLUGIN_H_
Audio visualization plugin.
Definition: plugin.h:2268
char * description
Textual description.
Definition: plugin.h:269
void(* stop)(void *priv)
Stop playback.
Definition: plugin.h:908
struct gavl_audio_options_s gavl_audio_options_t
void(* show_frame)(void *priv)
Show the image.
Definition: plugin.h:2339
void(* set_packet_sink)(void *priv, gavl_packet_sink_t *s)
Set a packet sink.
Definition: plugin.h:2417
Recorder.
Definition: plugin.h:1042
Encoder postprocessor (e.g. CD burner)
Definition: plugin.h:202
void(* set_callbacks)(void *priv, bg_ov_callbacks_t *cb)
return callback
Definition: plugin.h:2277
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:1473
int(* get_num_tracks)(void *priv)
Get the number of tracks.
Definition: plugin.h:546
void(* reset)(void *priv)
Reset.
Definition: plugin.h:2206
int(* key_release_callback)(void *data, int key, int mask)
Keyboard release callback.
Definition: plugin.h:1157
void(* contrast_callback)(void *data, float val)
Contrast change callback.
Definition: plugin.h:1223
int(* read_image)(void *priv, gavl_video_frame_t *frame)
Read the image.
Definition: plugin.h:2029
void(* stop)(void *priv)
Stop playback.
Definition: plugin.h:984
void(* destroy)(void *priv)
Destroy plugin instance.
Definition: plugin.h:294
int(* writes_compressed_video)(void *priv, const gavl_video_format_t *format, const gavl_compression_info_t *info)
Query for writing compressed video packets.
Definition: plugin.h:1509
void(* saturation_callback)(void *data, float val)
Saturation change callback.
Definition: plugin.h:1214
void(* aspect_changed)(void *data, int stream, int pixel_width, int pixel_height)
Aspect ratio change callback.
Definition: plugin.h:421
void * data
Application specific data passed as the first argument to all callbacks.
Definition: plugin.h:1456
bg_read_video_func_t read_video
Read video frame.
Definition: plugin.h:1081
char * name
Unique short name.
Definition: plugin.h:264
const char * mimetypes
Supported mimetypes.
Definition: plugin.h:2072
bg_stream_action_t
Stream actions.
Definition: plugin.h:164
int(* open)(void *priv, gavl_video_format_t *format, int keep_aspect)
Open plugin.
Definition: plugin.h:1318
void(* set_text_parameter)(void *priv, int stream, const char *name, const bg_parameter_value_t *v)
Set text subtitle encoding parameter.
Definition: plugin.h:1738
Callbacks for postprocessing.
Definition: plugin.h:1865
Callbacks for recorder plugins.
Definition: plugin.h:1014
int(* create_temp_file)(void *data, const char *filename)
Temp file callback.
Definition: plugin.h:1454
void(* reset)(void *priv)
Reset.
Definition: plugin.h:2159
Image reader.
Definition: plugin.h:203
void(* reset)(void *priv)
Reset a decoder.
Definition: plugin.h:2468
Stream will be read in compressed form.
Definition: plugin.h:168
int(* write_header)(void *priv, const char *filename, gavl_video_format_t *format, const gavl_metadata_t *m)
Write the file header.
Definition: plugin.h:2091
Callbacks for input plugins.
Definition: plugin.h:366
int(* need_restart)(void *priv)
Report, if the plugin must be reinitialized.
Definition: plugin.h:2217
Encoder plugin.
Definition: plugin.h:1471
int max_audio_streams
Maximum number of audio streams. -1 means infinite.
Definition: plugin.h:1906
int(* accel_callback)(void *data, int id)
Keyboard callback.
Definition: plugin.h:1133
char * gettext_domain
First argument for bindtextdomain().
Definition: plugin.h:261
void(* seek)(void *priv, int64_t *time, int scale)
Seek within a media track.
Definition: plugin.h:899
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:1255
struct gavl_video_options_s gavl_video_options_t
int(* add_video_stream)(void *priv, const gavl_metadata_t *m, const gavl_video_format_t *format)
Add a video stream.
Definition: plugin.h:1636
int(* get_audio_compression_info)(void *priv, int stream, gavl_compression_info_t *info)
Get the compression info of an audio stream.
Definition: plugin.h:588
void bg_device_info_destroy(bg_device_info_t *arr)
Free an array of device descriptions.
int(* set_pass)(void *priv, int pass, int total_passes, const char *stats_file)
Set pass for an encoder.
Definition: plugin.h:2485
void * data
Application specific data passed as the first argument to all callbacks.
Definition: plugin.h:2055
Audio recorder.
Definition: plugin.h:195
Image writer plugin.
Definition: plugin.h:2068
void(* add_track)(void *priv, const char *filename, gavl_metadata_t *metadata, int pp_only)
Add a transcoded track.
Definition: plugin.h:1944
Callbacks for the encoder plugin.
Definition: plugin.h:1433
int(* open_win)(void *priv, gavl_audio_format_t *audio_format, const char *window_id)
Open a window based visualization plugin.
Definition: plugin.h:2303
void(* set_window)(void *priv, const char *window_id)
Set window.
Definition: plugin.h:1267
int(* start)(void *priv)
Start playback.
Definition: plugin.h:958
Device description.
Definition: plugin.h:220
int flags
Flags (see defines)
Definition: plugin.h:267
int(* open_ov)(void *priv, gavl_audio_format_t *audio_format, gavl_video_format_t *video_format)
Open a frame based visualization plugin.
Definition: plugin.h:2290
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:2151
int(* start)(void *priv)
Start decoding.
Definition: plugin.h:677
int(* create_output_file)(void *data, const char *filename)
Output file callback.
Definition: plugin.h:1444
int(* need_restart)(void *priv)
Report, if the plugin must be reinitialized.
Definition: plugin.h:2182
void(* set_video_parameter)(void *priv, int stream, const char *name, const bg_parameter_value_t *v)
Set video encoding parameter.
Definition: plugin.h:1725
void(* show_window)(void *data, int show)
Show/hide callback.
Definition: plugin.h:1196
void(* duration_changed)(void *data, gavl_time_t duration)
Duration changed.
Definition: plugin.h:373
int(* set_video_pass)(void *priv, int stream, int pass, int total_passes, const char *stats_file)
Setup multipass video encoding.
Definition: plugin.h:1764
void(* set_callbacks)(void *priv, bg_ov_callbacks_t *callbacks)
Set callbacks.
Definition: plugin.h:1306
int max_video_streams
Maximum number of video streams. -1 means infinite.
Definition: plugin.h:1907
const char * extensions
File extensions (space separated)
Definition: plugin.h:2071
int(* user_pass)(void *data, const char *resource, char **username, char **password)
Authentication callback.
Definition: plugin.h:407
bg_set_parameter_func_t set_parameter
Set configuration parameter (optional)
Definition: plugin.h:308
void(* set_callbacks)(void *priv, bg_recorder_callbacks_t *callbacks)
Set callbacks.
Definition: plugin.h:1055
void(* update_metadata)(void *priv, const gavl_metadata_t *m)
Update metadata.
Definition: plugin.h:1833
void(* update_aspect)(void *priv, int pixel_width, int pixel_height)
Update aspect ratio.
Definition: plugin.h:1386
Encoder for video only.
Definition: plugin.h:198
const char * extensions
Supported file extensions (space separated)
Definition: plugin.h:1992
int(* set_audio_stream)(void *priv, int stream, bg_stream_action_t action)
Setup audio stream.
Definition: plugin.h:637
Encoder for multiple kinds of streams.
Definition: plugin.h:201
void * data
Application specific data passed as the first argument to all callbacks.
Definition: plugin.h:1025
Image reader plugin.
Definition: plugin.h:1989
int(* set_overlay_stream)(void *priv, int stream, bg_stream_action_t action)
Setup overlay stream.
Definition: plugin.h:664
Encoding postprocessor.
Definition: plugin.h:1902
Video output.
Definition: plugin.h:194
void(* skip_video)(void *priv, int stream, int64_t *time, int scale, int exact)
Skip frames in a video stream.
Definition: plugin.h:811
int(* get_compression_info)(void *priv, gavl_compression_info_t *ci)
Get compression info.
Definition: plugin.h:2018
Encoder for overlay subtitles only.
Definition: plugin.h:200
void(* set_audio_parameter)(void *priv, int stream, const char *name, const bg_parameter_value_t *v)
Set audio encoding parameter.
Definition: plugin.h:1711
int priority
Priority (between 1 and 10).
Definition: plugin.h:277
const bg_accelerator_map_t * accel_map
Accelerator map.
Definition: plugin.h:1126
bg_get_parameter_func_t get_parameter
Get configuration parameter (optional)
Definition: plugin.h:316
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:1991
Audio output plugin.
Definition: plugin.h:937
int(* read_header)(void *priv, const char *filename, gavl_video_format_t *format)
Read the file header.
Definition: plugin.h:2002
int(* add_text_stream)(void *priv, const gavl_metadata_t *m, uint32_t *timescale)
Add a text subtitle stream.
Definition: plugin.h:1662
Callbacks for the video output plugin.
Definition: plugin.h:1118
Codec plugin.
Definition: plugin.h:2362
bg_device_info_t * bg_device_info_append(bg_device_info_t *arr, const char *device, const char *name)
Append device info to an existing array and return the new array.
Parmeter description.
Definition: parameter.h:134
void(* set_window_options)(void *priv, const char *name, const char *klass, const gavl_video_frame_t *icon, const gavl_video_format_t *icon_format)
Set window class.
Definition: plugin.h:1288
int(* bg_get_parameter_func_t)(void *data, const char *name, bg_parameter_value_t *v)
Generic prototype for getting parameters from a module.
Definition: parameter.h:221
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:2270
int(* check_device)(const char *device, char **name)
Check, if a device can be opened by the plugin (optional)
Definition: plugin.h:327
int(* add_audio_stream_compressed)(void *priv, const gavl_metadata_t *m, const gavl_audio_format_t *format, const gavl_compression_info_t *info)
Add an audio stream fpr compressed writing.
Definition: plugin.h:1622
None or undefined.
Definition: plugin.h:191
int(* writes_compressed_overlay)(void *priv, const gavl_video_format_t *format, const gavl_compression_info_t *info)
Query for writing compressed overlay packets.
Definition: plugin.h:1522
Audio/Video (de)compressor.
Definition: plugin.h:209
void(* metadata_changed)(void *data, const gavl_metadata_t *m)
Metadata changed.
Definition: plugin.h:382
int(* open)(void *priv, const char *arg)
Open file/url/device.
Definition: plugin.h:487
int(* open_io)(void *priv, gavf_io_t *io)
Open plugin with callbacks (optional)
Definition: plugin.h:511
Audio filter plugin.
Definition: plugin.h:2149
Encoder for audio only.
Definition: plugin.h:197
int(* get_delay)(void *priv)
Get the number of buffered audio samples.
Definition: plugin.h:975
Stream is switched off and will be ignored.
Definition: plugin.h:166
char * long_name
Humanized name for GUI widgets.
Definition: plugin.h:265
int(* button_callback)(void *data, int x, int y, int button, int mask)
Mouse button callback.
Definition: plugin.h:1168
void(* set_overlay_parameter)(void *priv, int stream, const char *name, const bg_parameter_value_t *v)
Set text subtitle encoding parameter.
Definition: plugin.h:1752
int(* open)(void *priv, gavl_audio_format_t *format)
Open plugin.
Definition: plugin.h:950
void(* close)(void *priv)
Free an overlay created with the create_overlay() method.
Definition: plugin.h:1403
Image writer.
Definition: plugin.h:204
bg_plugin_type_t type
Type.
Definition: plugin.h:266
Video recorder.
Definition: plugin.h:196
void(* draw_frame)(void *priv, gavl_video_frame_t *frame)
Draw an image.
Definition: plugin.h:2329
int(* motion_callback)(void *data, int x, int y, int mask)
Motion callback.
Definition: plugin.h:1189
Audio output.
Definition: plugin.h:193
int(* add_audio_stream)(void *priv, const gavl_metadata_t *m, const gavl_audio_format_t *format)
Add an audio stream.
Definition: plugin.h:1607
Stream is switched on and will be decoded.
Definition: plugin.h:167
int(* key_callback)(void *data, int key, int mask)
Keyboard callback.
Definition: plugin.h:1148
void(* update)(void *priv, gavl_audio_frame_t *frame)
Send audio data to the plugin.
Definition: plugin.h:2318
void(* bg_set_parameter_func_t)(void *data, const char *name, const bg_parameter_value_t *v)
Generic prototype for setting parameters in a module.
Definition: parameter.h:205
int(* button_release_callback)(void *data, int x, int y, int button, int mask)
Mouse button release callback.
Definition: plugin.h:1179
void(* close)(void *priv)
Close plugin.
Definition: plugin.h:1092
Callbacks for the image writer plugin.
Definition: plugin.h:2042
int(* write_image)(void *priv, gavl_video_frame_t *frame)
Write the image.
Definition: plugin.h:2104
void(* metadata_changed)(void *data, const gavl_metadata_t *m)
Name changed.
Definition: plugin.h:1023
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:451
int(* bg_read_video_func_t)(void *priv, gavl_video_frame_t *frame, int stream)
Generic prototype for reading video.
Definition: plugin.h:96
int(* get_video_compression_info)(void *priv, int stream, gavl_compression_info_t *info)
Get the compression info of a video stream.
Definition: plugin.h:601
void(* set_window_title)(void *priv, const char *title)
Set window title.
Definition: plugin.h:1298
void(* set_callbacks)(void *priv, bg_input_callbacks_t *callbacks)
Set callbacks.
Definition: plugin.h:480
int(* add_overlay_stream)(void *priv, const gavl_metadata_t *m, const gavl_video_format_t *format)
Add a text subtitle stream.
Definition: plugin.h:1695
int64_t gavl_time_t
Audio/Video recorder.
Definition: plugin.h:208
const char * mimetypes
Supported mimetypes.
Definition: plugin.h:1993
int(* bg_read_audio_func_t)(void *priv, gavl_audio_frame_t *frame, int stream, int num_samples)
Generic prototype for reading audio.
Definition: plugin.h:81
void(* show_window)(void *priv, int show)
Show or hide the window.
Definition: plugin.h:1409
void(* set_callbacks)(void *priv, bg_encoder_callbacks_t *cb)
Set callbacks.
Definition: plugin.h:1485
char * gettext_directory
Second argument for bindtextdomain().
Definition: plugin.h:262
int max_text_streams
Maximum number of text subtitle streams. -1 means infinite.
Definition: plugin.h:1477
int(* open_io)(void *data, gavf_io_t *io, const gavl_metadata_t *metadata, const gavl_chapter_list_t *chapter_list)
Open an encoder with a gavf IO handle.
Definition: plugin.h:1548
Media input.
Definition: plugin.h:192
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:2198
void(* handle_events)(void *priv)
Get all events from the queue and handle them.
Definition: plugin.h:1378
void(* set_callbacks)(void *priv, bg_e_pp_callbacks_t *callbacks)
Set callbacks.
Definition: plugin.h:1917
gavl_codec_id_t
int(* start)(void *priv)
Set up all codecs and prepare for encoding.
Definition: plugin.h:1775
char * supported_extensions
Supported file extensions (space separated)
Definition: plugin.h:1909
int max_audio_streams
Maximum number of audio streams. -1 means infinite.
Definition: plugin.h:1475
void(* buffer_notify)(void *data, float percentage)
Buffer callback.
Definition: plugin.h:392
Base structure common to all plugins.
Definition: plugin.h:259
void(* set_callbacks)(void *priv, bg_iw_callbacks_t *cb)
Set callbacks.
Definition: plugin.h:2079
int(* set_video_stream)(void *priv, int stream, bg_stream_action_t action)
Setup video stream.
Definition: plugin.h:646
Input plugin.
Definition: plugin.h:449
Container for a parameter value.
Definition: parameter.h:82
Visualization.
Definition: plugin.h:207
int(* get_overlay_compression_info)(void *priv, int stream, gavl_compression_info_t *info)
Get the compression info of an overlay stream.
Definition: plugin.h:614
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:2364
Video filter plugin.
Definition: plugin.h:2196
void(* brightness_callback)(void *data, float val)
Brightness change callback.
Definition: plugin.h:1205
int(* add_overlay_stream_compressed)(void *priv, const gavl_metadata_t *m, const gavl_video_format_t *format, const gavl_compression_info_t *ci)
Add an overlay subtitle stream.
Definition: plugin.h:1678
void * data
Application specific data passed as the first argument to all callbacks.
Definition: plugin.h:425
int(* open)(void *data, const char *filename, const gavl_metadata_t *metadata, const gavl_chapter_list_t *chapter_list)
Open a file.
Definition: plugin.h:1536
int(* writes_compressed_audio)(void *priv, const gavl_audio_format_t *format, const gavl_compression_info_t *info)
Query for writing compressed audio packets.
Definition: plugin.h:1496
int(* set_text_stream)(void *priv, int stream, bg_stream_action_t action)
Setup text stream.
Definition: plugin.h:655
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:1044
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:939
int(* add_video_stream_compressed)(void *priv, const gavl_metadata_t *m, const gavl_video_format_t *format, const gavl_compression_info_t *info)
Add a video stream for compressed writing.
Definition: plugin.h:1651
bg_plugin_type_t
Plugin types.
Definition: plugin.h:189
int(* open_fd)(void *priv, int fd, int64_t total_bytes, const char *mimetype)
Open plugin from filedescriptor (optional)
Definition: plugin.h:497
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:1904
int max_overlay_streams
Maximum number of overlay subtitle streams. -1 means infinite.
Definition: plugin.h:1478
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:2070
Track info.
Definition: streaminfo.h:255
Audio filter.
Definition: plugin.h:205
void * data
Application specific data passed as the first argument to all callbacks.
Definition: plugin.h:1234
int(* close)(void *data, int do_delete)
Close encoder.
Definition: plugin.h:1843
Video output plugin.
Definition: plugin.h:1253
int(* create_output_file)(void *data, const char *filename)
Output file callback.
Definition: plugin.h:2053
int(* init)(void *priv)
Initialize.
Definition: plugin.h:1926
Video filter.
Definition: plugin.h:206
void(* run)(void *priv, const char *directory, int cleanup)
Start postprocessing.
Definition: plugin.h:1956
int64_t(* skip)(void *priv, int64_t t)
Skip to a time.
Definition: plugin.h:2476
Encoder for text subtitles only.
Definition: plugin.h:199
bg_read_audio_func_t read_audio
Read audio samples.
Definition: plugin.h:1072
int(* eject_disc)(const char *device)
Eject disc (optional)
Definition: plugin.h:537
void(* close)(void *priv)
Close plugin.
Definition: plugin.h:992
void(* close)(void *priv)
Close a plugin.
Definition: plugin.h:2345
void(* hue_callback)(void *data, float val)
Hue change callback.
Definition: plugin.h:1232
int max_video_streams
Maximum number of video streams. -1 means infinite.
Definition: plugin.h:1476
int(* set_track)(void *priv, int track)
Set the track to be played.
Definition: plugin.h:576
void(* stop)(void *priv)
Stop postprocessing.
Definition: plugin.h:1967
void(* close)(void *priv)
Close plugin.
Definition: plugin.h:916
int(* open)(void *priv, gavl_audio_format_t *audio_format, gavl_video_format_t *video_format, gavl_metadata_t *m)
Open plugin.
Definition: plugin.h:1067