gmerlin
plugin.h
1 /*****************************************************************
2  * gmerlin - a general purpose multimedia framework and applications
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 
22 #ifndef __BG_PLUGIN_H_
23 #define __BG_PLUGIN_H_
24 
25 #include <gavl/gavl.h>
26 #include <gavl/compression.h>
27 #include <gmerlin/parameter.h>
28 #include <gmerlin/streaminfo.h>
29 #include <gmerlin/accelerator.h>
30 #include <gmerlin/edl.h>
31 
75 typedef int (*bg_read_audio_func_t)(void * priv, gavl_audio_frame_t* frame,
76  int stream,
77  int num_samples);
78 
90 typedef int (*bg_read_video_func_t)(void * priv, gavl_video_frame_t* frame,
91  int stream);
92 
102 #define BG_PLUGIN_REMOVABLE (1<<0)
103 #define BG_PLUGIN_FILE (1<<1)
104 #define BG_PLUGIN_RECORDER (1<<2)
105 #define BG_PLUGIN_URL (1<<3)
106 #define BG_PLUGIN_PLAYBACK (1<<4)
107 #define BG_PLUGIN_STDIN (1<<8)
108 #define BG_PLUGIN_TUNER (1<<9)
109 #define BG_PLUGIN_FILTER_1 (1<<10)
110 #define BG_PLUGIN_EMBED_WINDOW (1<<11)
111 #define BG_PLUGIN_VISUALIZE_FRAME (1<<12)
112 #define BG_PLUGIN_VISUALIZE_GL (1<<13)
113 #define BG_PLUGIN_PP (1<<14)
114 #define BG_PLUGIN_CALLBACKS (1<<15)
115 #define BG_PLUGIN_BROADCAST (1<<16)
116 #define BG_PLUGIN_DEVPARAM (1<<17)
117 
118 #define BG_PLUGIN_UNSUPPORTED (1<<24)
119 
120 
121 #define BG_PLUGIN_ALL 0xFFFFFFFF
122 
123 
126 #define BG_PLUGIN_API_VERSION 26
127 
128 /* Include this into all plugin modules exactly once
129  to let the plugin loader obtain the API version */
130 
131 #define BG_GET_PLUGIN_API_VERSION \
132  int get_plugin_api_version() __attribute__ ((visibility("default"))); \
133  int get_plugin_api_version() { return BG_PLUGIN_API_VERSION; }
134 
135 #define BG_PLUGIN_PRIORITY_MIN 1
136 #define BG_PLUGIN_PRIORITY_MAX 10
137 
150 typedef enum
151  {
155 
157 
158 /***************************************************
159  * Plugin API
160  *
161  * Plugin dlls contain a symbol "the_plugin",
162  * which points to one of the structures below.
163  * The member functions are described below.
164  *
165  ***************************************************/
166 
167 /*
168  * Plugin types
169  */
170 
175 typedef enum
176  {
178  BG_PLUGIN_INPUT = (1<<0),
187  BG_PLUGIN_ENCODER = (1<<9),
194  BG_PLUGIN_AV_RECORDER = (1<<16),
196 
205 typedef struct
206  {
207  char * device;
208  char * name;
210 
222  const char * device,
223  const char * name);
224 
231 
232 /* Common part */
233 
239 
244 struct bg_plugin_common_s
245  {
246  char * gettext_domain;
247  char * gettext_directory;
248 
249  char * name;
250  char * long_name;
252  int flags;
253 
254  char * description;
255 
256  /*
257  * If there might be more than one plugin for the same
258  * job, there is a priority (0..10) which is used for the
259  * decision
260  */
261 
262  int priority;
263 
268  void * (*create)();
269 
279  void (*destroy)(void* priv);
280 
288  const bg_parameter_info_t * (*get_parameters)(void * priv);
289 
294 
302 
312  int (*check_device)(const char * device, char ** name);
313 
314 
322  bg_device_info_t * (*find_devices)();
323 
324  };
325 
326 /*
327  * Plugin callbacks: Functions called by the
328  * plugin to reflect user input or other changes
329  * Applications might pass NULL callbacks,
330  * so plugins MUST check for valid callbacks structure
331  * before calling any of these functions
332  */
333 
334 /* Input plugin */
335 
342 
352  {
358  void (*duration_changed)(void * data, gavl_time_t duration);
359 
367  void (*name_changed)(void * data, const char * name);
368 
376  void (*metadata_changed)(void * data, const gavl_metadata_t * m);
377 
386  void (*buffer_notify)(void * data, float percentage);
387 
401  int (*user_pass)(void * data, const char * resource,
402  char ** username, char ** password);
403 
415  void (*aspect_changed)(void * data, int stream,
416  int pixel_width, int pixel_height);
417 
418 
419  void * data;
420 
421  };
422 
423 /*************************************************
424  * MEDIA INPUT
425  *************************************************/
426 
431 typedef struct bg_input_plugin_s bg_input_plugin_t;
432 
433 
443 struct bg_input_plugin_s
444  {
446 
452  const char * (*get_protocols)(void * priv);
457  const char * (*get_mimetypes)(void * priv);
458 
463  const char * (*get_extensions)(void * priv);
464 
474  void (*set_callbacks)(void * priv, bg_input_callbacks_t * callbacks);
475 
481  int (*open)(void * priv, const char * arg);
482 
491  int (*open_fd)(void * priv, int fd, int64_t total_bytes,
492  const char * mimetype);
493 
505  int (*open_callbacks)(void * priv,
506  int (*read_callback)(void * priv, uint8_t * data, int len),
507  int64_t (*seek_callback)(void * priv, uint64_t pos, int whence),
508  void * cb_priv, const char * filename, const char * mimetype,
509  int64_t total_bytes);
510 
516  const bg_edl_t * (*get_edl)(void * priv);
517 
525  const char * (*get_disc_name)(void * priv);
526 
535  int (*eject_disc)(const char * device);
536 
544  int (*get_num_tracks)(void * priv);
545 
562  bg_track_info_t * (*get_track_info)(void * priv, int track);
563 
574  int (*set_track)(void * priv, int track);
575 
586  int (*get_audio_compression_info)(void * priv, int stream,
587  gavl_compression_info_t * info);
588 
599  int (*get_video_compression_info)(void * priv, int stream,
600  gavl_compression_info_t * info);
601 
602  /*
603  * These functions set the audio- video- and subpicture streams
604  * as well as programs (== DVD Angles). All these start with 0
605  *
606  * Arguments for actions are defined in the enum bg_stream_action_t
607  * above. Plugins must return FALSE on failure (e.g. no such stream)
608  *
609  * Functions must be defined only, if the corresponding stream
610  * type is supported by the plugin and can be switched.
611  * Single stream plugins can leave these NULL
612  * Gmerlin will never try to call these functions on nonexistent streams
613  */
614 
622  int (*set_audio_stream)(void * priv, int stream, bg_stream_action_t action);
623 
631  int (*set_video_stream)(void * priv, int stream, bg_stream_action_t action);
632 
640  int (*set_subtitle_stream)(void * priv, int stream, bg_stream_action_t action);
641 
653  int (*start)(void * priv);
654 
664  gavl_frame_table_t * (*get_frame_table)(void * priv, int stream);
665 
679 
689  int (*has_still)(void * priv, int stream);
690 
699 
710  int (*read_audio_packet)(void * priv, int stream, gavl_packet_t * p);
711 
722  int (*read_video_packet)(void * priv, int stream, gavl_packet_t * p);
723 
724 
737  void (*skip_video)(void * priv, int stream, int64_t * time, int scale, int exact);
738 
745  int (*has_subtitle)(void * priv, int stream);
746 
758  int (*read_subtitle_overlay)(void * priv,
759  gavl_overlay_t*ovl, int stream);
760 
779  int (*read_subtitle_text)(void * priv,
780  char ** text, int * text_alloc,
781  int64_t * start_time,
782  int64_t * duration, int stream);
783 
795  void (*seek)(void * priv, int64_t * time, int scale);
796 
804  void (*stop)(void * priv);
805 
812  void (*close)(void * priv);
813 
814  };
815 
825 typedef struct bg_oa_plugin_s bg_oa_plugin_t;
826 
833 struct bg_oa_plugin_s
834  {
836 
846  int (*open)(void * priv, gavl_audio_format_t* format);
847 
854  int (*start)(void * priv);
855 
861  void (*write_audio)(void * priv, gavl_audio_frame_t* frame);
862 
871  int (*get_delay)(void * priv);
872 
880  void (*stop)(void * priv);
881 
888  void (*close)(void * priv);
889  };
890 
891 /*******************************************
892  * AUDIO RECORDER
893  *******************************************/
894 
901 
911  {
920  void (*metadata_changed)(void * data, const char * name,
921  const gavl_metadata_t * m);
922 
923  void * data;
924 
925  };
926 
927 
933 
941  {
943 
953  void (*set_callbacks)(void * priv, bg_recorder_callbacks_t * callbacks);
954 
965  int (*open)(void * priv, gavl_audio_format_t * audio_format,
966  gavl_video_format_t * video_format);
967 
971 
975 
980  void (*close)(void * priv);
981  };
982 
983 /*******************************************
984  * VIDEO OUTPUT
985  *******************************************/
986 
987 /* Callbacks */
988 
999 typedef struct bg_ov_callbacks_s bg_ov_callbacks_t;
1000 
1006 struct bg_ov_callbacks_s
1007  {
1014  const bg_accelerator_map_t * accel_map;
1015 
1021  int (*accel_callback)(void * data, int id);
1022 
1036  int (*key_callback)(void * data, int key, int mask);
1037 
1045  int (*key_release_callback)(void * data, int key, int mask);
1046 
1056  int (*button_callback)(void * data, int x, int y, int button, int mask);
1057 
1067  int (*button_release_callback)(void * data, int x, int y, int button, int mask);
1068 
1077  int (*motion_callback)(void * data, int x, int y, int mask);
1078 
1084  void (*show_window)(void * data, int show);
1085 
1093  void (*brightness_callback)(void * data, float val);
1094 
1102  void (*saturation_callback)(void * data, float val);
1103 
1111  void (*contrast_callback)(void * data, float val);
1112 
1120  void (*hue_callback)(void * data, float val);
1122  void * data;
1123  };
1124 
1125 /* Plugin structure */
1126 
1131 typedef struct bg_ov_plugin_s bg_ov_plugin_t;
1132 
1141 struct bg_ov_plugin_s
1142  {
1144 
1155  void (*set_window)(void * priv, const char * window_id);
1156 
1162  const char * (*get_window)(void * priv);
1163 
1176  void (*set_window_options)(void * priv, const char * name,
1177  const char * klass,
1178  const gavl_video_frame_t * icon,
1179  const gavl_video_format_t * icon_format);
1180 
1186  void (*set_window_title)(void * priv, const char * title);
1187 
1188 
1194  void (*set_callbacks)(void * priv, bg_ov_callbacks_t * callbacks);
1195 
1206  int (*open)(void * priv, gavl_video_format_t * format, int keep_aspect);
1207 
1212  gavl_video_frame_t * (*get_frame)(void * priv);
1213 
1227  int (*add_overlay_stream)(void * priv, gavl_video_format_t * format);
1228 
1241  gavl_overlay_t * (*create_overlay)(void * priv, int id);
1242 
1249  void (*set_overlay)(void * priv, int stream, gavl_overlay_t * ovl);
1250 
1258  void (*put_video)(void * priv, gavl_video_frame_t*frame);
1259 
1269  void (*put_still)(void * priv, gavl_video_frame_t*frame);
1270 
1279  void (*handle_events)(void * priv);
1280 
1287  void (*update_aspect)(void * priv, int pixel_width, int pixel_height);
1288 
1293  // void (*destroy_frame)(void * priv, gavl_video_frame_t * frame);
1294 
1301  void (*destroy_overlay)(void * priv, int id, gavl_overlay_t * ovl);
1302 
1310  void (*close)(void * priv);
1311 
1316  void (*show_window)(void * priv, int show);
1317  };
1318 
1319 /*******************************************
1320  * ENCODER
1321  *******************************************/
1322 
1334 
1341  {
1342 
1351  int (*create_output_file)(void * data, const char * filename);
1352 
1361  int (*create_temp_file)(void * data, const char * filename);
1363  void * data;
1364  };
1365 
1366 
1372 
1373 
1378 struct bg_encoder_plugin_s
1379  {
1386 
1392  void (*set_callbacks)(void * priv, bg_encoder_callbacks_t * cb);
1393 
1403  int (*writes_compressed_audio)(void * priv,
1404  const gavl_audio_format_t * format,
1405  const gavl_compression_info_t * info);
1406 
1416  int (*writes_compressed_video)(void * priv,
1417  const gavl_video_format_t * format,
1418  const gavl_compression_info_t * info);
1419 
1430  int (*open)(void * data, const char * filename,
1431  const gavl_metadata_t * metadata,
1432  const bg_chapter_list_t * chapter_list);
1433 
1434  /* Return per stream parameters */
1435 
1443  const bg_parameter_info_t * (*get_audio_parameters)(void * priv);
1444 
1452  const bg_parameter_info_t * (*get_video_parameters)(void * priv);
1453 
1461  const bg_parameter_info_t * (*get_subtitle_text_parameters)(void * priv);
1462 
1470  const bg_parameter_info_t * (*get_subtitle_overlay_parameters)(void * priv);
1471 
1472  /* Add streams. The formats can be changed, be sure to get the
1473  * final formats with get_[audio|video]_format after starting the plugin
1474  * Return value is the index of the added stream.
1475  */
1476 
1488  int (*add_audio_stream)(void * priv, const gavl_metadata_t * m,
1489  const gavl_audio_format_t * format);
1490 
1503  int (*add_audio_stream_compressed)(void * priv, const gavl_metadata_t * m,
1504  const gavl_audio_format_t * format,
1505  const gavl_compression_info_t * info);
1506 
1517  int (*add_video_stream)(void * priv,
1518  const gavl_metadata_t * m,
1519  const gavl_video_format_t * format);
1520 
1532  int (*add_video_stream_compressed)(void * priv,
1533  const gavl_metadata_t * m,
1534  const gavl_video_format_t * format,
1535  const gavl_compression_info_t * info);
1536 
1543  int (*add_subtitle_text_stream)(void * priv,
1544  const gavl_metadata_t * m,
1545  int * timescale);
1546 
1559  int (*add_subtitle_overlay_stream)(void * priv,
1560  const gavl_metadata_t * m,
1561  const gavl_video_format_t * format);
1562 
1563  /* Set parameters for the streams */
1564 
1575  void (*set_audio_parameter)(void * priv, int stream, const char * name,
1576  const bg_parameter_value_t * v);
1577 
1589  void (*set_video_parameter)(void * priv, int stream, const char * name,
1590  const bg_parameter_value_t * v);
1591 
1602  void (*set_subtitle_text_parameter)(void * priv, int stream,
1603  const char * name,
1604  const bg_parameter_value_t * v);
1605 
1616  void (*set_subtitle_overlay_parameter)(void * priv, int stream,
1617  const char * name,
1618  const bg_parameter_value_t * v);
1619 
1628  int (*set_video_pass)(void * priv, int stream, int pass, int total_passes,
1629  const char * stats_file);
1630 
1639  int (*start)(void * priv);
1640 
1641  /*
1642  * After setting the parameters, get the formats, you need to deliver the frames in
1643  */
1644 
1653  void (*get_audio_format)(void * priv, int stream, gavl_audio_format_t*ret);
1654 
1663  void (*get_video_format)(void * priv, int stream, gavl_video_format_t*ret);
1664 
1673  void (*get_subtitle_overlay_format)(void * priv, int stream,
1674  gavl_video_format_t*ret);
1675 
1676  /*
1677  * Encode audio/video
1678  */
1679 
1690  int (*write_audio_frame)(void * data, gavl_audio_frame_t * frame, int stream);
1691 
1702  int (*write_audio_packet)(void * data, gavl_packet_t * packet, int stream);
1703 
1704 
1712  int (*write_video_frame)(void * data, gavl_video_frame_t * frame, int stream);
1713 
1721  int (*write_video_packet)(void * data, gavl_packet_t * packet, int stream);
1722 
1732  int (*write_subtitle_text)(void * data,const char * text,
1733  int64_t start,
1734  int64_t duration, int stream);
1735 
1743  int (*write_subtitle_overlay)(void * data, gavl_overlay_t * ovl, int stream);
1744 
1754  void (*update_metadata)(void * data, const char * name,
1755  const gavl_metadata_t * m);
1756 
1765  int (*close)(void * data, int do_delete);
1766  };
1767 
1768 
1769 /*******************************************
1770  * ENCODER Postprocessor
1771  *******************************************/
1772 
1787 typedef struct
1788  {
1795  void (*action_callback)(void * data, char * action);
1796 
1806  void (*progress_callback)(void * data, float perc);
1808  void * data;
1809 
1811 
1818 
1825  {
1829  int max_video_streams;
1831  char * supported_extensions;
1832 
1839  void (*set_callbacks)(void * priv,bg_e_pp_callbacks_t * callbacks);
1840 
1848  int (*init)(void * priv);
1849 
1866  void (*add_track)(void * priv, const char * filename,
1867  gavl_metadata_t * metadata, int pp_only);
1868 
1878  void (*run)(void * priv, const char * directory, int cleanup);
1879 
1889  void (*stop)(void * priv);
1890  };
1891 
1892 
1907 
1912  {
1914  const char * extensions;
1915 
1923  int (*read_header)(void * priv, const char * filename,
1924  gavl_video_format_t * format);
1925 
1931  const gavl_metadata_t * (*get_metadata)(void * priv);
1932 
1939  int (*get_compression_info)(void * priv, gavl_compression_info_t * ci);
1940 
1950  int (*read_image)(void * priv, gavl_video_frame_t * frame);
1951  };
1952 
1957 typedef struct bg_iw_callbacks_s bg_iw_callbacks_t;
1958 
1963 struct bg_iw_callbacks_s
1964  {
1965 
1974  int (*create_output_file)(void * data, const char * filename);
1976  void * data;
1977  };
1978 
1984 
1990  {
1992  const char * extensions;
1993 
1999  void (*set_callbacks)(void * priv, bg_iw_callbacks_t * cb);
2000 
2011  int (*write_header)(void * priv, const char * filename,
2012  gavl_video_format_t * format, const gavl_metadata_t * m);
2013 
2024  int (*write_image)(void * priv, gavl_video_frame_t * frame);
2025  } ;
2026 
2057 /* Filters */
2058 
2063 typedef struct bg_fa_plugin_s bg_fa_plugin_t;
2064 
2069 struct bg_fa_plugin_s
2070  {
2072 
2081  void (*connect_input_port)(void * priv, bg_read_audio_func_t func,
2082  void * data,
2083  int stream, int port);
2084 
2094  void (*set_input_format)(void * priv, gavl_audio_format_t * format, int port);
2095 
2096 
2103  void (*reset)(void * priv);
2104 
2112  void (*get_output_format)(void * priv, gavl_audio_format_t * format);
2113 
2123  int (*need_restart)(void * priv);
2124 
2129 
2130  };
2131 
2136 typedef struct bg_fv_plugin_s bg_fv_plugin_t;
2137 
2142 struct bg_fv_plugin_s
2143  {
2145 
2154  gavl_video_options_t * (*get_options)(void * priv);
2155 
2164  void (*connect_input_port)(void * priv,
2165  bg_read_video_func_t func,
2166  void * data, int stream, int port);
2167 
2174  void (*set_input_format)(void * priv, gavl_video_format_t * format, int port);
2175 
2182  void (*reset)(void * priv);
2183 
2191  void (*get_output_format)(void * priv, gavl_video_format_t * format);
2192 
2202  int (*need_restart)(void * priv);
2203 
2208 
2209  };
2210 
2211 
2231 
2232 
2248  {
2250 
2256  void (*set_callbacks)(void * priv, bg_ov_callbacks_t * cb);
2257 
2269  int (*open_ov)(void * priv, gavl_audio_format_t * audio_format,
2270  gavl_video_format_t * video_format);
2271 
2282  int (*open_win)(void * priv, gavl_audio_format_t * audio_format,
2283  const char * window_id);
2284 
2297  void (*update)(void * priv, gavl_audio_frame_t * frame);
2298 
2308  void (*draw_frame)(void * priv, gavl_video_frame_t * frame);
2309 
2318  void (*show_frame)(void * priv);
2319 
2324  void (*close)(void * priv);
2325 
2326  };
2327 
2328 
2329 
2334 #endif // __BG_PLUGIN_H_
Audio visualization plugin.
Definition: plugin.h:2246
char * description
Textual description.
Definition: plugin.h:253
void(* stop)(void *priv)
Stop playback.
Definition: plugin.h:803
void(* show_frame)(void *priv)
Show the image.
Definition: plugin.h:2317
Recorder.
Definition: plugin.h:939
Encoder postprocessor (e.g. CD burner)
Definition: plugin.h:187
void(* set_callbacks)(void *priv, bg_ov_callbacks_t *cb)
return callback
Definition: plugin.h:2255
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:1379
int(* get_num_tracks)(void *priv)
Get the number of tracks.
Definition: plugin.h:543
void(* write_audio)(void *priv, gavl_audio_frame_t *frame)
Write audio samples.
Definition: plugin.h:860
void(* reset)(void *priv)
Reset.
Definition: plugin.h:2181
int(* key_release_callback)(void *data, int key, int mask)
Keyboard release callback.
Definition: plugin.h:1044
void(* contrast_callback)(void *data, float val)
Contrast change callback.
Definition: plugin.h:1110
int(* read_image)(void *priv, gavl_video_frame_t *frame)
Read the image.
Definition: plugin.h:1949
void(* stop)(void *priv)
Stop playback.
Definition: plugin.h:879
void(* destroy)(void *priv)
Destroy plugin instance.
Definition: plugin.h:278
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:1415
int(* write_video_frame)(void *data, gavl_video_frame_t *frame, int stream)
Write video frame.
Definition: plugin.h:1711
void(* saturation_callback)(void *data, float val)
Saturation change callback.
Definition: plugin.h:1101
void(* aspect_changed)(void *data, int stream, int pixel_width, int pixel_height)
Aspect ratio change callback.
Definition: plugin.h:414
int(* write_video_packet)(void *data, gavl_packet_t *packet, int stream)
Write video packet.
Definition: plugin.h:1720
void * data
Application specific data passed as the first argument to all callbacks.
Definition: plugin.h:1362
bg_read_video_func_t read_video
Read video frame.
Definition: plugin.h:973
char * name
Unique short name.
Definition: plugin.h:248
bg_stream_action_t
Stream actions.
Definition: plugin.h:149
int(* open)(void *priv, gavl_video_format_t *format, int keep_aspect)
Open plugin.
Definition: plugin.h:1205
Callbacks for postprocessing.
Definition: plugin.h:1786
Callbacks for recorder plugins.
Definition: plugin.h:909
int(* read_video_packet)(void *priv, int stream, gavl_packet_t *p)
Read compressed video packet.
Definition: plugin.h:721
int(* create_temp_file)(void *data, const char *filename)
Temp file callback.
Definition: plugin.h:1360
void(* reset)(void *priv)
Reset.
Definition: plugin.h:2102
Image reader.
Definition: plugin.h:188
Stream will be read in compressed form.
Definition: plugin.h:153
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:2010
Callbacks for input plugins.
Definition: plugin.h:350
void(* get_audio_format)(void *priv, int stream, gavl_audio_format_t *ret)
Get audio format.
Definition: plugin.h:1652
int(* need_restart)(void *priv)
Report, if the plugin must be reinitialized.
Definition: plugin.h:2201
void(* connect_input_port)(void *priv, bg_read_video_func_t func, void *data, int stream, int port)
Set input callback.
Definition: plugin.h:2163
Encoder plugin.
Definition: plugin.h:1377
void(* metadata_changed)(void *data, const char *name, const gavl_metadata_t *m)
Name changed.
Definition: plugin.h:919
int max_audio_streams
Maximum number of audio streams. -1 means infinite.
Definition: plugin.h:1827
int(* accel_callback)(void *data, int id)
Keyboard callback.
Definition: plugin.h:1020
char * gettext_domain
First argument for bindtextdomain().
Definition: plugin.h:245
void(* seek)(void *priv, int64_t *time, int scale)
Seek within a media track.
Definition: plugin.h:794
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:1142
int(* open)(void *priv, gavl_audio_format_t *audio_format, gavl_video_format_t *video_format)
Open plugin.
Definition: plugin.h:964
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:1516
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:585
Check if 2 metadata structures are equal.
Definition: streaminfo.h:211
void bg_device_info_destroy(bg_device_info_t *arr)
Free an array of device descriptions.
void * data
Application specific data passed as the first argument to all callbacks.
Definition: plugin.h:1975
Audio recorder.
Definition: plugin.h:180
int(* open)(void *data, const char *filename, const gavl_metadata_t *metadata, const bg_chapter_list_t *chapter_list)
Open a file.
Definition: plugin.h:1429
Image writer plugin.
Definition: plugin.h:1988
Encoder for text subtitles only.
Definition: plugin.h:184
void(* add_track)(void *priv, const char *filename, gavl_metadata_t *metadata, int pp_only)
Add a transcoded track.
Definition: plugin.h:1865
Callbacks for the encoder plugin.
Definition: plugin.h:1339
void(* set_overlay)(void *priv, int stream, gavl_overlay_t *ovl)
Set an overlay for a specific stream.
Definition: plugin.h:1248
int(* open_win)(void *priv, gavl_audio_format_t *audio_format, const char *window_id)
Open a window based visualization plugin.
Definition: plugin.h:2281
void(* set_window)(void *priv, const char *window_id)
Set window.
Definition: plugin.h:1154
int(* start)(void *priv)
Start playback.
Definition: plugin.h:853
Device description.
Definition: plugin.h:204
int flags
Flags (see defines)
Definition: plugin.h:251
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:2268
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:2070
void(* set_input_format)(void *priv, gavl_audio_format_t *format, int port)
Set input format.
Definition: plugin.h:2093
int(* start)(void *priv)
Start decoding.
Definition: plugin.h:652
int(* create_output_file)(void *data, const char *filename)
Output file callback.
Definition: plugin.h:1350
int(* write_subtitle_overlay)(void *data, gavl_overlay_t *ovl, int stream)
Write an overlay subtitle.
Definition: plugin.h:1742
int(* need_restart)(void *priv)
Report, if the plugin must be reinitialized.
Definition: plugin.h:2122
int(* has_subtitle)(void *priv, int stream)
Query if a new subtitle is available.
Definition: plugin.h:744
void(* set_video_parameter)(void *priv, int stream, const char *name, const bg_parameter_value_t *v)
Set video encoding parameter.
Definition: plugin.h:1588
int max_subtitle_overlay_streams
Maximum number of overlay subtitle streams. -1 means infinite.
Definition: plugin.h:1384
void(* show_window)(void *data, int show)
Show/hide callback.
Definition: plugin.h:1083
void(* destroy_overlay)(void *priv, int id, gavl_overlay_t *ovl)
Free a frame created with the create_frame() method.
Definition: plugin.h:1300
void(* duration_changed)(void *data, gavl_time_t duration)
Duration changed.
Definition: plugin.h:357
int(* set_video_pass)(void *priv, int stream, int pass, int total_passes, const char *stats_file)
Setup multipass video encoding.
Definition: plugin.h:1627
bg_read_audio_func_t read_audio
Read audio samples.
Definition: plugin.h:677
void(* set_callbacks)(void *priv, bg_ov_callbacks_t *callbacks)
Set callbacks.
Definition: plugin.h:1193
bg_read_video_func_t read_video
Read a video frame.
Definition: plugin.h:697
int max_video_streams
Maximum number of video streams. -1 means infinite.
Definition: plugin.h:1828
EDL structure.
Definition: edl.h:119
const char * extensions
File extensions (space separated)
Definition: plugin.h:1991
int(* user_pass)(void *data, const char *resource, char **username, char **password)
Authentication callback.
Definition: plugin.h:400
bg_set_parameter_func_t set_parameter
Set configuration parameter (optional)
Definition: plugin.h:292
int(* add_overlay_stream)(void *priv, gavl_video_format_t *format)
Add a stream for transparent overlays.
Definition: plugin.h:1226
void(* set_callbacks)(void *priv, bg_recorder_callbacks_t *callbacks)
Set callbacks.
Definition: plugin.h:952
void(* update_aspect)(void *priv, int pixel_width, int pixel_height)
Update aspect ratio.
Definition: plugin.h:1286
Encoder for video only.
Definition: plugin.h:183
const char * extensions
Supported file extensions (space separated)
Definition: plugin.h:1913
int(* set_audio_stream)(void *priv, int stream, bg_stream_action_t action)
Setup audio stream.
Definition: plugin.h:621
Encoder for multiple kinds of streams.
Definition: plugin.h:186
void * data
Application specific data passed as the first argument to all callbacks.
Definition: plugin.h:922
int(* add_subtitle_overlay_stream)(void *priv, const gavl_metadata_t *m, const gavl_video_format_t *format)
Add a text subtitle stream.
Definition: plugin.h:1558
Image reader plugin.
Definition: plugin.h:1910
Encoding postprocessor.
Definition: plugin.h:1823
Video output.
Definition: plugin.h:179
void(* skip_video)(void *priv, int stream, int64_t *time, int scale, int exact)
Skip frames in a video stream.
Definition: plugin.h:736
int(* get_compression_info)(void *priv, gavl_compression_info_t *ci)
Get compression info.
Definition: plugin.h:1938
void(* set_audio_parameter)(void *priv, int stream, const char *name, const bg_parameter_value_t *v)
Set audio encoding parameter.
Definition: plugin.h:1574
int priority
Priority (between 1 and 10).
Definition: plugin.h:261
const bg_accelerator_map_t * accel_map
Accelerator map.
Definition: plugin.h:1013
bg_get_parameter_func_t get_parameter
Get configuration parameter (optional)
Definition: plugin.h:300
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:1912
Audio output plugin.
Definition: plugin.h:832
int(* read_header)(void *priv, const char *filename, gavl_video_format_t *format)
Read the file header.
Definition: plugin.h:1922
Callbacks for the video output plugin.
Definition: plugin.h:1005
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.
void(* get_output_format)(void *priv, gavl_audio_format_t *format)
Get output format.
Definition: plugin.h:2111
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:1175
int(* has_still)(void *priv, int stream)
Check is a still image is available.
Definition: plugin.h:688
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:2248
void(* get_subtitle_overlay_format)(void *priv, int stream, gavl_video_format_t *ret)
Get video format of an overlay subtitle stream.
Definition: plugin.h:1672
int(* check_device)(const char *device, char **name)
Check, if a device can be opened by the plugin (optional)
Definition: plugin.h:311
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:1502
None or undefined.
Definition: plugin.h:176
void(* metadata_changed)(void *data, const gavl_metadata_t *m)
Metadata changed.
Definition: plugin.h:375
int(* open)(void *priv, const char *arg)
Open file/url/device.
Definition: plugin.h:480
int(* write_audio_packet)(void *data, gavl_packet_t *packet, int stream)
Write audio packet.
Definition: plugin.h:1701
Audio filter plugin.
Definition: plugin.h:2068
bg_read_audio_func_t read_audio
Read audio samples from the plugin.
Definition: plugin.h:2127
Encoder for audio only.
Definition: plugin.h:182
int(* get_delay)(void *priv)
Get the number of buffered audio samples.
Definition: plugin.h:870
Stream is switched off and will be ignored.
Definition: plugin.h:151
char * long_name
Humanized name for GUI widgets.
Definition: plugin.h:249
int(* button_callback)(void *data, int x, int y, int button, int mask)
Mouse button callback.
Definition: plugin.h:1055
void(* put_video)(void *priv, gavl_video_frame_t *frame)
Display a frame of a video stream.
Definition: plugin.h:1257
void(* connect_input_port)(void *priv, bg_read_audio_func_t func, void *data, int stream, int port)
Set input callback.
Definition: plugin.h:2080
int(* set_subtitle_stream)(void *priv, int stream, bg_stream_action_t action)
Setup subtitle stream.
Definition: plugin.h:639
int(* open)(void *priv, gavl_audio_format_t *format)
Open plugin.
Definition: plugin.h:845
void(* close)(void *priv)
Close the plugin.
Definition: plugin.h:1309
void(* update_metadata)(void *data, const char *name, const gavl_metadata_t *m)
Update metadata.
Definition: plugin.h:1753
Image writer.
Definition: plugin.h:189
bg_plugin_type_t type
Type.
Definition: plugin.h:250
Video recorder.
Definition: plugin.h:181
void(* draw_frame)(void *priv, gavl_video_frame_t *frame)
Draw an image.
Definition: plugin.h:2307
int(* motion_callback)(void *data, int x, int y, int mask)
Motion callback.
Definition: plugin.h:1076
Audio output.
Definition: plugin.h:178
int(* add_audio_stream)(void *priv, const gavl_metadata_t *m, const gavl_audio_format_t *format)
Add an audio stream.
Definition: plugin.h:1487
Stream is switched on and will be decoded.
Definition: plugin.h:152
int(* key_callback)(void *data, int key, int mask)
Keyboard callback.
Definition: plugin.h:1035
int(* read_subtitle_text)(void *priv, char **text, int *text_alloc, int64_t *start_time, int64_t *duration, int stream)
Read one text subtitle.
Definition: plugin.h:778
int(* open_callbacks)(void *priv, int(*read_callback)(void *priv, uint8_t *data, int len), int64_t(*seek_callback)(void *priv, uint64_t pos, int whence), void *cb_priv, const char *filename, const char *mimetype, int64_t total_bytes)
Open plugin with callbacks (optional)
Definition: plugin.h:504
void(* update)(void *priv, gavl_audio_frame_t *frame)
Send audio data to the plugin.
Definition: plugin.h:2296
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:1066
void(* close)(void *priv)
Close plugin.
Definition: plugin.h:979
Callbacks for the image writer plugin.
Definition: plugin.h:1962
bg_read_video_func_t read_video
Read a video frame from the plugin.
Definition: plugin.h:2206
int(* write_image)(void *priv, gavl_video_frame_t *frame)
Write the image.
Definition: plugin.h:2023
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:444
int(* bg_read_video_func_t)(void *priv, gavl_video_frame_t *frame, int stream)
Generic prototype for reading video.
Definition: plugin.h:90
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:598
void(* set_window_title)(void *priv, const char *title)
Set window title.
Definition: plugin.h:1185
void(* set_callbacks)(void *priv, bg_input_callbacks_t *callbacks)
Set callbacks.
Definition: plugin.h:473
int64_t gavl_time_t
Audio/Video recorder.
Definition: plugin.h:193
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:75
void(* show_window)(void *priv, int show)
Show or hide the window.
Definition: plugin.h:1315
void(* set_callbacks)(void *priv, bg_encoder_callbacks_t *cb)
Set callbacks.
Definition: plugin.h:1391
char * gettext_directory
Second argument for bindtextdomain().
Definition: plugin.h:246
Media input.
Definition: plugin.h:177
void(* put_still)(void *priv, gavl_video_frame_t *frame)
Display a still image.
Definition: plugin.h:1268
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:2143
void(* handle_events)(void *priv)
Get all events from the queue and handle them.
Definition: plugin.h:1278
void(* set_callbacks)(void *priv, bg_e_pp_callbacks_t *callbacks)
Set callbacks.
Definition: plugin.h:1838
int(* start)(void *priv)
Set up all codecs and prepare for encoding.
Definition: plugin.h:1638
char * supported_extensions
Supported file extensions (space separated)
Definition: plugin.h:1830
int max_audio_streams
Maximum number of audio streams. -1 means infinite.
Definition: plugin.h:1381
void(* buffer_notify)(void *data, float percentage)
Buffer callback.
Definition: plugin.h:385
Base structure common to all plugins.
Definition: plugin.h:243
void(* set_callbacks)(void *priv, bg_iw_callbacks_t *cb)
Set callbacks.
Definition: plugin.h:1998
int(* read_audio_packet)(void *priv, int stream, gavl_packet_t *p)
Read compressed audio packet.
Definition: plugin.h:709
int(* set_video_stream)(void *priv, int stream, bg_stream_action_t action)
Setup video stream.
Definition: plugin.h:630
Input plugin.
Definition: plugin.h:442
Container for a parameter value.
Definition: parameter.h:82
Visualization.
Definition: plugin.h:192
int(* add_subtitle_text_stream)(void *priv, const gavl_metadata_t *m, int *timescale)
Add a text subtitle stream.
Definition: plugin.h:1542
Video filter plugin.
Definition: plugin.h:2141
void(* brightness_callback)(void *data, float val)
Brightness change callback.
Definition: plugin.h:1092
void * data
Application specific data passed as the first argument to all callbacks.
Definition: plugin.h:418
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:1402
Encoder for overlay subtitles only.
Definition: plugin.h:185
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:941
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:834
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:1531
void(* set_subtitle_overlay_parameter)(void *priv, int stream, const char *name, const bg_parameter_value_t *v)
Set text subtitle encoding parameter.
Definition: plugin.h:1615
void(* get_output_format)(void *priv, gavl_video_format_t *format)
Get output format.
Definition: plugin.h:2190
bg_plugin_type_t
Plugin types.
Definition: plugin.h:174
int(* open_fd)(void *priv, int fd, int64_t total_bytes, const char *mimetype)
Open plugin from filedescriptor (optional)
Definition: plugin.h:490
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:1825
bg_plugin_common_t common
Infos and functions common to all plugin types.
Definition: plugin.h:1990
Track info.
Definition: streaminfo.h:333
Audio filter.
Definition: plugin.h:190
void * data
Application specific data passed as the first argument to all callbacks.
Definition: plugin.h:1121
int(* close)(void *data, int do_delete)
Close encoder.
Definition: plugin.h:1764
int max_subtitle_text_streams
Maximum number of text subtitle streams. -1 means infinite.
Definition: plugin.h:1383
Video output plugin.
Definition: plugin.h:1140
int(* create_output_file)(void *data, const char *filename)
Output file callback.
Definition: plugin.h:1973
void(* set_subtitle_text_parameter)(void *priv, int stream, const char *name, const bg_parameter_value_t *v)
Set text subtitle encoding parameter.
Definition: plugin.h:1601
int(* init)(void *priv)
Initialize.
Definition: plugin.h:1847
Video filter.
Definition: plugin.h:191
void(* run)(void *priv, const char *directory, int cleanup)
Start postprocessing.
Definition: plugin.h:1877
void(* get_video_format)(void *priv, int stream, gavl_video_format_t *ret)
Get video format.
Definition: plugin.h:1662
bg_read_audio_func_t read_audio
Read audio samples.
Definition: plugin.h:969
int(* write_audio_frame)(void *data, gavl_audio_frame_t *frame, int stream)
Write audio samples.
Definition: plugin.h:1689
int(* eject_disc)(const char *device)
Eject disc (optional)
Definition: plugin.h:534
void(* close)(void *priv)
Close plugin.
Definition: plugin.h:887
void(* close)(void *priv)
Close a plugin.
Definition: plugin.h:2323
void(* hue_callback)(void *data, float val)
Hue change callback.
Definition: plugin.h:1119
int max_video_streams
Maximum number of video streams. -1 means infinite.
Definition: plugin.h:1382
int(* set_track)(void *priv, int track)
Set the track to be played.
Definition: plugin.h:573
void(* stop)(void *priv)
Stop postprocessing.
Definition: plugin.h:1888
void(* name_changed)(void *data, const char *name)
Name changed.
Definition: plugin.h:366
void(* close)(void *priv)
Close plugin.
Definition: plugin.h:811
int(* read_subtitle_overlay)(void *priv, gavl_overlay_t *ovl, int stream)
Read one pixmap subtitle.
Definition: plugin.h:757
void(* set_input_format)(void *priv, gavl_video_format_t *format, int port)
Set input format.
Definition: plugin.h:2173
int(* write_subtitle_text)(void *data, const char *text, int64_t start, int64_t duration, int stream)
Write a text subtitle.
Definition: plugin.h:1731