00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __BG_PLUGINREGISTRY_H_
00023 #define __BG_PLUGINREGISTRY_H_
00024
00025
00026 #include <pthread.h>
00027
00028 #include <gmerlin/plugin.h>
00029 #include <gmerlin/cfg_registry.h>
00030
00049 typedef enum
00050 {
00051 BG_PLUGIN_API_GMERLIN = 0,
00052 BG_PLUGIN_API_LADSPA,
00053 BG_PLUGIN_API_LV,
00054 BG_PLUGIN_API_FREI0R,
00055 } bg_plugin_api_t;
00056
00061 typedef struct bg_plugin_info_s bg_plugin_info_t;
00062
00067 struct bg_plugin_info_s
00068 {
00069 char * gettext_domain;
00070 char * gettext_directory;
00071
00072 char * name;
00073 char * long_name;
00074 char * mimetypes;
00075 char * extensions;
00076 char * protocols;
00077
00078 char * description;
00079
00080 char * module_filename;
00081 long module_time;
00082
00083 bg_plugin_api_t api;
00084 int index;
00085
00086 bg_plugin_type_t type;
00087 int flags;
00088 int priority;
00089
00090 bg_device_info_t * devices;
00091
00092 bg_plugin_info_t * next;
00093
00094 bg_parameter_info_t * parameters;
00095
00096 int max_audio_streams;
00097 int max_video_streams;
00098 int max_subtitle_text_streams;
00099 int max_subtitle_overlay_streams;
00100
00101 bg_parameter_info_t * audio_parameters;
00102 bg_parameter_info_t * video_parameters;
00103
00104 bg_parameter_info_t * subtitle_text_parameters;
00105 bg_parameter_info_t * subtitle_overlay_parameters;
00106
00107 char * cmp_name;
00108
00109 };
00110
00117 typedef struct bg_plugin_registry_s bg_plugin_registry_t;
00118
00123 typedef struct bg_plugin_handle_s bg_plugin_handle_t;
00124
00133 struct bg_plugin_handle_s
00134 {
00135
00136
00137 void * dll_handle;
00138 pthread_mutex_t mutex;
00139 int refcount;
00140 bg_plugin_registry_t * plugin_reg;
00141
00142
00143
00144 const bg_plugin_common_t * plugin;
00145 bg_plugin_common_t * plugin_nc;
00146 const bg_plugin_info_t * info;
00147 void * priv;
00148
00149 char * location;
00150 bg_edl_t * edl;
00151 };
00152
00153
00154
00155
00156
00165 bg_plugin_registry_t *
00166 bg_plugin_registry_create(bg_cfg_section_t * section);
00167
00173 void bg_plugin_registry_destroy(bg_plugin_registry_t * reg);
00174
00183 int bg_plugin_registry_get_num_plugins(bg_plugin_registry_t * reg,
00184 uint32_t type_mask, uint32_t flag_mask);
00197 const bg_plugin_info_t *
00198 bg_plugin_find_by_index(bg_plugin_registry_t * reg, int index,
00199 uint32_t type_mask, uint32_t flag_mask);
00200
00208 const bg_plugin_info_t *
00209 bg_plugin_find_by_name(bg_plugin_registry_t * reg, const char * name);
00210
00221 const bg_plugin_info_t *
00222 bg_plugin_find_by_filename(bg_plugin_registry_t * reg,
00223 const char * filename, int type_mask);
00224
00225
00232 const bg_plugin_info_t *
00233 bg_plugin_find_by_protocol(bg_plugin_registry_t * reg,
00234 const char * protocol);
00235
00236
00237
00238
00253 char ** bg_plugin_registry_get_plugins(bg_plugin_registry_t*reg,
00254 uint32_t type_mask,
00255 uint32_t flag_mask);
00256
00261 void bg_plugin_registry_free_plugins(char ** plugins);
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00288 int bg_input_plugin_load(bg_plugin_registry_t * reg,
00289 const char * location,
00290 const bg_plugin_info_t * info,
00291 bg_plugin_handle_t ** ret,
00292 bg_input_callbacks_t * callbacks, int prefer_edl);
00293
00308 int bg_input_plugin_load_edl(bg_plugin_registry_t * reg,
00309 const bg_edl_t * edl,
00310 const bg_plugin_info_t * info,
00311 bg_plugin_handle_t ** ret,
00312 bg_input_callbacks_t * callbacks);
00313
00314
00315
00325 void bg_plugin_registry_set_extensions(bg_plugin_registry_t * reg,
00326 const char * plugin_name,
00327 const char * extensions);
00328
00338 void bg_plugin_registry_set_protocols(bg_plugin_registry_t * reg,
00339 const char * plugin_name,
00340 const char * protocols);
00341
00351 void bg_plugin_registry_set_priority(bg_plugin_registry_t * reg,
00352 const char * plugin_name,
00353 int priority);
00354
00355
00362 bg_cfg_section_t *
00363 bg_plugin_registry_get_section(bg_plugin_registry_t * reg,
00364 const char * plugin_name);
00365
00375 void bg_plugin_registry_set_parameter_info(bg_plugin_registry_t * reg,
00376 uint32_t type_mask,
00377 uint32_t flag_mask,
00378 bg_parameter_info_t * ret);
00379
00380
00391 void bg_plugin_registry_set_default(bg_plugin_registry_t * reg,
00392 bg_plugin_type_t type,
00393 const char * plugin_name);
00394
00403 const bg_plugin_info_t * bg_plugin_registry_get_default(bg_plugin_registry_t * reg,
00404 bg_plugin_type_t type);
00405
00406
00429 void bg_plugin_registry_set_encode_audio_to_video(bg_plugin_registry_t * reg,
00430 int audio_to_video);
00431
00438 int bg_plugin_registry_get_encode_audio_to_video(bg_plugin_registry_t * reg);
00439
00446 void bg_plugin_registry_set_encode_subtitle_text_to_video(bg_plugin_registry_t * reg,
00447 int subtitle_text_to_video);
00448
00455 int bg_plugin_registry_get_encode_subtitle_text_to_video(bg_plugin_registry_t * reg);
00456
00463 void bg_plugin_registry_set_encode_subtitle_overlay_to_video(bg_plugin_registry_t * reg,
00464 int subtitle_overlay_to_video);
00465
00471 int bg_plugin_registry_get_encode_subtitle_overlay_to_video(bg_plugin_registry_t * reg);
00472
00479 void bg_plugin_registry_set_encode_pp(bg_plugin_registry_t * reg,
00480 int encode_pp);
00481
00487 int bg_plugin_registry_get_encode_pp(bg_plugin_registry_t * reg);
00488
00495 void bg_plugin_registry_set_visualize(bg_plugin_registry_t * reg,
00496 int enable);
00497
00504 int bg_plugin_registry_get_visualize(bg_plugin_registry_t * reg);
00505
00506
00515 void bg_plugin_registry_add_device(bg_plugin_registry_t * reg,
00516 const char * plugin_name,
00517 const char * device,
00518 const char * name);
00519
00532 void bg_plugin_registry_set_device_name(bg_plugin_registry_t * reg,
00533 const char * plugin_name,
00534 const char * device,
00535 const char * name);
00536
00537
00538
00548 void bg_plugin_registry_find_devices(bg_plugin_registry_t * reg,
00549 const char * plugin_name);
00550
00562 void bg_plugin_registry_remove_device(bg_plugin_registry_t * reg,
00563 const char * plugin_name,
00564 const char * device,
00565 const char * name);
00566
00578 gavl_video_frame_t * bg_plugin_registry_load_image(bg_plugin_registry_t * reg,
00579 const char * filename,
00580 gavl_video_format_t * format,
00581 bg_metadata_t * m);
00582
00583
00584
00593 void
00594 bg_plugin_registry_save_image(bg_plugin_registry_t * reg,
00595 const char * filename,
00596 gavl_video_frame_t * frame,
00597 const gavl_video_format_t * format, const bg_metadata_t * m);
00598
00599
00611 int bg_get_thumbnail(const char * gml,
00612 bg_plugin_registry_t * plugin_reg,
00613 char ** thumbnail_filename_ret,
00614 gavl_video_frame_t ** frame_ret,
00615 gavl_video_format_t * format_ret);
00616
00617
00618
00619
00620
00621
00622
00623
00624
00633 bg_plugin_handle_t * bg_plugin_load(bg_plugin_registry_t * reg,
00634 const bg_plugin_info_t * info);
00635
00646 bg_plugin_handle_t * bg_ov_plugin_load(bg_plugin_registry_t * reg,
00647 const bg_plugin_info_t * info,
00648 const char * window_id);
00649
00654 void bg_plugin_lock(bg_plugin_handle_t * h);
00655
00660 void bg_plugin_unlock(bg_plugin_handle_t * h);
00661
00662
00663
00668 void bg_plugin_ref(bg_plugin_handle_t * h);
00669
00670
00671
00679 void bg_plugin_unref(bg_plugin_handle_t * h);
00680
00691 void bg_plugin_unref_nolock(bg_plugin_handle_t * h);
00692
00693
00694
00702 int bg_plugin_equal(bg_plugin_handle_t * h1,
00703 bg_plugin_handle_t * h2);
00704
00705 #endif // __BG_PLUGINREGISTRY_H_