From fb84a946585c4fc5d86fd3de06127498bc58c0b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 5 Jan 2008 02:21:39 +0100 Subject: Now that FFmpeg is always used external, move the ffmpeg-based MPEG encoder out of the FFmpeg decoding plugin and directly inside dxr3 plugin. This way there is no dlopen() required to open the plugin to read the init function from, there is no need for wrapper init/close functions, and the dxr3_encoder_init() function is no more exported by the plugin. --HG-- rename : src/combined/ffmpeg/ffmpeg_encoder.c => src/dxr3/ffmpeg_encoder.c --- src/dxr3/dxr3_mpeg_encoders.c | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'src/dxr3/dxr3_mpeg_encoders.c') diff --git a/src/dxr3/dxr3_mpeg_encoders.c b/src/dxr3/dxr3_mpeg_encoders.c index d32a298a6..2ccc05e49 100644 --- a/src/dxr3/dxr3_mpeg_encoders.c +++ b/src/dxr3/dxr3_mpeg_encoders.c @@ -110,13 +110,6 @@ static int fame_prepare_frame(fame_data_t *this, dxr3_driver_t *drv, dxr3_frame_t *frame); #endif -/* initialization function */ -int dxr3_lavc_init(dxr3_driver_t *drv, plugin_node_t *node); - -/* close function from encoder api */ -static int lavc_on_close(dxr3_driver_t *drv); - - #ifdef HAVE_LIBRTE int dxr3_rte_init(dxr3_driver_t *drv) { @@ -538,33 +531,3 @@ static int fame_prepare_frame(fame_data_t *this, dxr3_driver_t *drv, dxr3_frame_ return 1; } #endif - - -int dxr3_lavc_init(dxr3_driver_t *drv, plugin_node_t *node) -{ - void *ffmpeg; - int (*init)(dxr3_driver_t *); - int result; - - ffmpeg = dlopen(node->file->filename, RTLD_LAZY); - if (!ffmpeg) return 0; - - init = dlsym(ffmpeg, "dxr3_encoder_init"); - if (!init) return 0; - - result = init(drv); - /* the close function is implemented here, because it will call dlclose() - * and that should not be done be the library we are closing... */ - drv->enc->on_close = lavc_on_close; - drv->enc->handle = ffmpeg; - return result; -} - -static int lavc_on_close(dxr3_driver_t *drv) -{ - drv->enc->on_unneeded(drv); - dlclose(drv->enc->handle); - free(drv->enc); - drv->enc = NULL; - return 1; -} -- cgit v1.2.3