00001
00002
00003
00004
00005
00006
00007 #ifndef _HAS_PLUGINS_H
00008 #define _HAS_PLUGINS_H
00009
00010 #include <gmodule.h>
00011 #include <unistd.h>
00012 #include <string.h>
00013 #include <fcntl.h>
00014 #include <stdlib.h>
00015
00016
00017
00018
00019 GList *get_plugin_list (const gchar *plugin_type, gboolean allow_nonex, const gchar *plugdir, const gchar *filter_ext);
00020 #define PLUGIN_ENCODERS "encoders"
00021 #define PLUGIN_DECODERS "decoders"
00022 #define PLUGIN_VID_PLAYBACK "playback/video"
00023
00024
00026 #define PLUGIN_THEMES "themes"
00027
00029 #define PLUGIN_EFFECTS_WEED "weed"
00030 #define PLUGIN_WEED_FX_BUILTIN "effects/realtime/weed"
00031
00032
00033 GList *plugin_request (const gchar *plugin_type, const gchar *plugin_name, const gchar *request);
00034 GList *plugin_request_with_blanks (const gchar *plugin_type, const gchar *plugin_name, const gchar *request);
00035 GList *plugin_request_by_line (const gchar *plugin_type, const gchar *plugin_name, const gchar *request);
00036 GList *plugin_request_by_space (const gchar *plugin_type, const gchar *plugin_name, const gchar *request);
00037 GList *plugin_request_common (const gchar *plugin_type, const gchar *plugin_name, const gchar *request, const gchar *delim, gboolean allow_blanks);
00038
00039
00041 typedef gboolean (*plugin_keyfunc) (gboolean down, guint16 unicode, guint16 keymod);
00042
00043 typedef struct {
00044
00045 gchar name[64];
00046 void *handle;
00047
00048
00049 const char *(*module_check_init)(void);
00050 const char *(*version) (void);
00051 const char *(*get_description) (void);
00052 const char *(*get_rfx) (void);
00053 gint *(*get_palette_list) (void);
00054 gboolean (*set_palette) (int palette);
00055 guint64 (*get_capabilities) (int palette);
00056 gboolean (*render_frame) (int hsize, int vsize, int64_t timecode, void *pixel_data, void *return_data);
00057
00058
00059 gboolean (*init_screen) (int width, int height, gboolean fullscreen, guint32 window_id, int argc, gchar **argv);
00060 void (*exit_screen) (guint16 mouse_x, guint16 mouse_y);
00061 void (*module_unload) (void);
00062 const gchar *(*get_fps_list) (int palette);
00063 gboolean (*set_fps) (gdouble fps);
00064
00065
00066 gboolean (*send_keycodes) (plugin_keyfunc);
00067
00068
00069 int *(*get_yuv_palette_sampling) (int palette);
00070 int *(*get_yuv_palette_clamping) (int palette);
00071 int *(*get_yuv_palette_subspace) (int palette);
00072 int (*set_yuv_palette_sampling) (int palette);
00073 int (*set_yuv_palette_clamping) (int palette);
00074 int (*set_yuv_palette_subspace) (int palette);
00075
00076 guint64 capabilities;
00077
00078 #define VPP_CAN_RESIZE 1<<0
00079 #define VPP_CAN_RETURN 1<<1
00080 #define VPP_LOCAL_DISPLAY 1<<2
00081
00082 gint fwidth,fheight;
00083
00084 int palette;
00085 int YUV_sampling;
00086 int YUV_clamping;
00087 int YUV_subspace;
00088
00089 gint fixed_fps_numer;
00090 gint fixed_fps_denom;
00091 gdouble fixed_fpsd;
00092
00093 int extra_argc;
00094 gchar **extra_argv;
00095
00096
00097 } _vid_playback_plugin;
00098
00099
00100 #define DEF_VPP_HSIZE 320.
00101 #define DEF_VPP_VSIZE 240.
00102
00103 _vid_playback_plugin *open_vid_playback_plugin (const gchar *name, gboolean using);
00104 void vid_playback_plugin_exit (void);
00105 void close_vid_playback_plugin(_vid_playback_plugin *);
00106 void save_vpp_defaults(_vid_playback_plugin *, gchar *file);
00107 void load_vpp_defaults(_vid_playback_plugin *, gchar *file);
00108
00109
00110
00111
00112 void do_plugin_encoder_error(const gchar *plugin_name_or_null);
00113
00114 GList *filter_encoders_by_img_ext(GList *encoders, const gchar *img_ext);
00115
00116 typedef struct {
00117 gchar name[51];
00118 guint32 audio_codec;
00119
00120
00121
00122
00123 #define AUDIO_CODEC_MP3 0
00124 #define AUDIO_CODEC_PCM 1
00125 #define AUDIO_CODEC_MP2 2
00126 #define AUDIO_CODEC_VORBIS 3
00127 #define AUDIO_CODEC_AC3 4
00128 #define AUDIO_CODEC_AAC 5
00129 #define AUDIO_CODEC_AMR_NB 6
00130
00131 #define AUDIO_CODEC_MAX 31
00132
00133 #define AUDIO_CODEC_NONE 32
00134 #define AUDIO_CODEC_UNKNOWN 33
00135
00136 guint capabilities;
00137
00138
00139 #define HAS_RFX 1<<0
00140
00141 #define CAN_ENCODE_PNG 1<<2
00142 #define ENCODER_NON_NATIVE 1<<3
00143
00144
00145 gchar of_name[51];
00146 gchar of_desc[128];
00147 gint of_allowed_acodecs;
00148 gchar of_restrict[1024];
00149 gchar of_def_ext[16];
00150 }
00151 _encoder;
00152
00153
00154
00155
00156
00157
00158
00160 #define LIVES_SEEK_FAST (1<<0)
00161
00163 #define LIVES_SEEK_NEEDS_CALCULATION (1<<1)
00164 #define LIVES_SEEK_QUALITY_LOSS (1<<2)
00165
00166
00167 typedef struct {
00168 gchar *URI;
00169
00170 gint nclips;
00171 gchar container_name[512];
00172
00174 gint current_clip;
00175
00176
00177 gint width;
00178 gint height;
00179 gint64 nframes;
00180 lives_interlace_t interlace;
00181
00184 gint offs_x;
00185 gint offs_y;
00186 gint frame_width;
00187 gint frame_height;
00188
00189 gfloat par;
00190
00191 gfloat fps;
00192
00193 int *palettes;
00194
00196 int current_palette;
00197
00198 int YUV_sampling;
00199 int YUV_clamping;
00200 int YUV_subspace;
00201 gchar video_name[512];
00202
00203
00204 gint arate;
00205 gint achans;
00206 gint asamps;
00207 gboolean asigned;
00208 gboolean ainterleaf;
00209 gchar audio_name[512];
00210
00211 int seek_flag;
00212
00213 void *priv;
00214
00215 } lives_clip_data_t;
00216
00217
00218
00219 typedef struct {
00220
00221 gchar *name;
00222 void *handle;
00223
00224
00225 const char *(*version) (void);
00226
00233 lives_clip_data_t *(*get_clip_data)(char *URI, lives_clip_data_t *cdata);
00234
00236 gboolean (*get_frame)(const lives_clip_data_t *, int64_t frame, void **pixel_data);
00237
00239 void (*clip_data_free)(lives_clip_data_t *);
00240
00241
00242 const char *(*module_check_init)(void);
00243 int64_t (*rip_audio) (const lives_clip_data_t *, const char *fname, int64_t stframe, int64_t nframes,
00244 unsigned char **abuff);
00245 void (*rip_audio_cleanup) (const lives_clip_data_t *cdata);
00246 void (*module_unload)(void);
00247
00248 } lives_decoder_sys_t;
00249
00250
00251
00252
00253 typedef struct {
00254 const lives_decoder_sys_t *decoder;
00255 lives_clip_data_t *cdata;
00256 } lives_decoder_t;
00257
00258
00259
00260
00261
00262
00263 const lives_clip_data_t *get_decoder_cdata(file *);
00264 void close_decoder_plugin (lives_decoder_t *);
00265 lives_decoder_sys_t *open_decoder_plugin(const gchar *plname);
00266 void get_mime_type(gchar *text, int maxlen, const lives_clip_data_t *);
00267 void unload_decoder_plugins(void);
00268
00269 LIVES_INLINE gboolean decplugin_supports_palette (const lives_decoder_t *dplug, int palette);
00270
00271
00272
00273
00274
00275
00277 #define PLUGIN_RENDERED_EFFECTS_BUILTIN "effects/rendered/"
00278
00280 #define PLUGIN_RENDERED_EFFECTS_CUSTOM "plugins/effects/rendered/custom/"
00281 #define PLUGIN_RENDERED_EFFECTS_TEST "plugins/effects/rendered/test/"
00282
00284 #define PLUGIN_RENDERED_EFFECTS_BUILTIN_SCRIPTS "effects/RFXscripts/"
00285
00287 #define PLUGIN_RENDERED_EFFECTS_CUSTOM_SCRIPTS "plugins/effects/RFXscripts/custom/"
00288 #define PLUGIN_RENDERED_EFFECTS_TEST_SCRIPTS "plugins/effects/RFXscripts/test/"
00289
00291 #define PLUGIN_RFX_SCRAP ""
00292
00293
00295 #define MAX_PARAM_WIDGETS 5
00296
00298 #define RFX_MAXSTRINGLEN 1024
00299
00300
00301 typedef enum {
00302
00303 LIVES_PARAM_UNKNOWN=0,
00304 LIVES_PARAM_NUM,
00305 LIVES_PARAM_BOOL,
00306 LIVES_PARAM_COLRGB24,
00307 LIVES_PARAM_STRING,
00308 LIVES_PARAM_STRING_LIST,
00309 LIVES_PARAM_COLRGBA32,
00310
00311 LIVES_PARAM_UNDISPLAYABLE=65536
00312
00313 } lives_param_type_t;
00314
00315
00316 typedef enum {
00317 LIVES_RFX_SOURCE_RFX=0,
00318 LIVES_RFX_SOURCE_WEED
00319 } lives_rfx_source_t;
00320
00321
00322
00323
00324
00325 typedef struct {
00326
00327 gchar *name;
00328 gchar *desc;
00329
00330 gchar *label;
00331 gint flags;
00332 gboolean use_mnemonic;
00333 gpointer interp_func;
00334 gpointer display_func;
00335 gint hidden;
00336
00337
00338 #define HIDDEN_GUI (1<<0)
00339 #define HIDDEN_MULTI (1<<1)
00340 #define HIDDEN_NEEDS_REINIT (1<<2)
00341
00342 gdouble step_size;
00343 gint copy_to;
00344 gboolean transition;
00345 gboolean reinit;
00346
00347 gboolean wrap;
00348 gint group;
00349 lives_param_type_t type;
00350
00351 gint dp;
00352 void *value;
00353
00354 gdouble min;
00355 gdouble max;
00356
00357 void *def;
00358 GList *list;
00359
00361 gshort multi;
00362 #define PVAL_MULTI_NONE 0
00363 #define PVAL_MULTI_ANY 1
00364 #define PVAL_MULTI_PER_CHANNEL 2
00365
00366
00367
00368
00370 GtkWidget *widgets[MAX_PARAM_WIDGETS];
00371 gboolean onchange;
00372
00373 gboolean changed;
00374
00375 gboolean change_blocked;
00376
00377 void *source;
00378
00379 lives_rfx_source_t source_type;
00380
00381 } lives_param_t;
00382
00383
00384 typedef enum {
00385 RFX_STATUS_BUILTIN=0,
00386 RFX_STATUS_CUSTOM=1,
00387 RFX_STATUS_TEST=2,
00388 RFX_STATUS_ANY=3,
00389 RFX_STATUS_WEED=4,
00390 RFX_STATUS_SCRAP=5,
00391
00392
00393 RFX_STATUS_COPY=128,
00394 RFX_STATUS_RENAME=129
00395 } lives_rfx_status_t;
00396
00397
00398
00399
00400 typedef struct {
00401 gchar *name;
00402 gchar *menu_text;
00403 gchar *action_desc;
00404 gint min_frames;
00405 gint num_in_channels;
00406 lives_rfx_status_t status;
00407
00408
00409 guint32 props;
00410 #define RFX_PROPS_SLOW 0x0001 ///< hint to GUI
00411 #define RFX_PROPS_MAY_RESIZE 0x0002 ///< is a tool
00412 #define RFX_PROPS_BATCHG 0x0004 ///< is a batch generator
00413
00414
00415 #define RFX_PROPS_RESERVED1 0x1000
00416 #define RFX_PROPS_RESERVED2 0x2000
00417 #define RFX_PROPS_RESERVED3 0x4000
00418 #define RFX_PROPS_AUTO_BUILT 0x8000
00419
00420 GtkWidget *menuitem;
00421 gint num_params;
00422 lives_param_t *params;
00423 lives_rfx_source_t source_type;
00424 void *source;
00425 void *extra;
00426 gchar delim[2];
00427 gboolean is_template;
00428
00429 } lives_rfx_t;
00430
00431 gboolean check_rfx_for_lives (lives_rfx_t *);
00432
00433 void do_rfx_cleanup(lives_rfx_t *);
00434
00435 void render_fx_get_params (lives_rfx_t *, const gchar *plugin_name, gshort status);
00436
00437 void sort_rfx_array (lives_rfx_t *in_array, gint num_elements);
00438
00439 gint find_rfx_plugin_by_name (const gchar *name, gshort status);
00440
00441 void rfx_copy (lives_rfx_t *src, lives_rfx_t *dest, gboolean full);
00442
00443 void rfx_free(lives_rfx_t *rfx);
00444
00445 void rfx_free_all (void);
00446
00447 void param_copy (lives_param_t *src, lives_param_t *dest, gboolean full);
00448
00449
00450 typedef struct {
00451 GList *list;
00452 gint delegate;
00453 gulong func;
00454 lives_rfx_t *rfx;
00455 } lives_fx_candidate_t;
00456
00457
00458 #define FX_CANDIDATE_AUDIO_VOL 0
00459 #define FX_CANDIDATE_RESIZER 1
00460 #define FX_CANDIDATE_DEINTERLACE 2
00461
00462 #define MAX_FX_CANDIDATE_TYPES 3
00463
00464 gboolean get_bool_param(void *value);
00465 gint get_int_param(void *value);
00466 gdouble get_double_param(void *value);
00467 void get_colRGB24_param(void *value, lives_colRGB24_t *rgb);
00468 void get_colRGBA32_param(void *value, lives_colRGBA32_t *rgba);
00469
00470 void set_bool_param(void *value, gboolean );
00471 void set_int_param(void *value, gint );
00472 void set_double_param(void *value, gdouble );
00473 void set_colRGB24_param(void *value, gshort red, gshort green, gshort blue);
00474 void set_colRGBA32_param(void *value, gshort red, gshort green, gshort blue, gshort alpha);
00475
00477 void **store_rfx_params (lives_rfx_t *);
00478 void set_rfx_params_from_store (lives_rfx_t *rfx, void **store);
00479 void rfx_params_store_free (lives_rfx_t *, void **store);
00480
00481 GList *array_to_string_list (gchar **array, gint offset, gint len);
00482
00483 lives_rfx_t *weed_to_rfx (weed_plant_t *plant, gboolean show_reinits);
00484
00485 gchar *plugin_run_param_window(const gchar *get_com, GtkVBox *vbox, lives_rfx_t **ret_rfx);
00486
00489 typedef struct {
00490 _vid_playback_plugin *plugin;
00491 GtkWidget *dialog;
00492 GtkWidget *spinbuttonh;
00493 GtkWidget *spinbuttonw;
00494 GtkWidget *fps_entry;
00495 GtkWidget *pal_entry;
00496 lives_rfx_t *rfx;
00497 } _vppaw;
00498
00499 _vppaw *on_vpp_advanced_clicked (GtkButton *, gpointer);
00500
00501
00503
00504 #endif