diff options
author | Eduard Hasenleithner <ehasenle@users.sourceforge.net> | 2001-08-14 19:43:43 +0000 |
---|---|---|
committer | Eduard Hasenleithner <ehasenle@users.sourceforge.net> | 2001-08-14 19:43:43 +0000 |
commit | 9d43664d77b956da9c906c618d9d3e013ec4c17d (patch) | |
tree | 8accfed7c0cab552f3f16916bba1e171d15245f9 | |
parent | 406a025a2e1b12eab3ae9aa0124f8707bd8112bc (diff) | |
download | xine-lib-9d43664d77b956da9c906c618d9d3e013ec4c17d.tar.gz xine-lib-9d43664d77b956da9c906c618d9d3e013ec4c17d.tar.bz2 |
Made the dxr3 device name a configuration option. Makes it possible
to disable the plugin using an invalid name.
CVS patchset: 430
CVS date: 2001/08/14 19:43:43
-rw-r--r-- | src/dxr3/dxr3_decoder.c | 27 | ||||
-rw-r--r-- | src/dxr3/video_out_dxr3.c | 7 |
2 files changed, 23 insertions, 11 deletions
diff --git a/src/dxr3/dxr3_decoder.c b/src/dxr3/dxr3_decoder.c index 87bf2be13..689ebadb3 100644 --- a/src/dxr3/dxr3_decoder.c +++ b/src/dxr3/dxr3_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: dxr3_decoder.c,v 1.10 2001/08/14 10:17:58 ehasenle Exp $ + * $Id: dxr3_decoder.c,v 1.11 2001/08/14 19:43:43 ehasenle Exp $ * * dxr3 video and spu decoder plugin. Accepts the video and spu data * from XINE and sends it directly to the corresponding dxr3 devices. @@ -43,7 +43,9 @@ #include "xine_internal.h" #include "buffer.h" -char devname[]="/dev/em8300"; +#define LOOKUP_DEV "dxr3_devname" +#define DEFAULT_DEV "/dev/em8300" +static char *devname; typedef struct dxr3_decoder_s { video_decoder_t video_decoder; @@ -61,6 +63,10 @@ static int dxr3_ok; static void dxr3_presence_test() { int fd, val; + + if (dxr3_tested) + return; + dxr3_tested = 1; dxr3_ok = 0; @@ -153,9 +159,7 @@ static scr_plugin_t* dxr3scr_init (dxr3_decoder_t *dxr3) { static int dxr3_can_handle (video_decoder_t *this_gen, int buf_type) { - if (!dxr3_tested) - dxr3_presence_test(); - return (dxr3_ok && (buf_type & 0xFFFF0000) == BUF_VIDEO_MPEG) ; + return (buf_type & 0xFFFF0000) == BUF_VIDEO_MPEG ; } static void dxr3_init (video_decoder_t *this_gen, vo_instance_t *video_out) @@ -251,6 +255,10 @@ video_decoder_t *init_video_decoder_plugin (int iface_version, return NULL; } + devname = cfg->lookup_str (cfg, LOOKUP_DEV, DEFAULT_DEV); + dxr3_presence_test (); + if (!dxr3_ok) return NULL; + this = (dxr3_decoder_t *) malloc (sizeof (dxr3_decoder_t)); this->video_decoder.interface_version = 2; @@ -280,10 +288,7 @@ typedef struct spudec_decoder_s { static int spudec_can_handle (spu_decoder_t *this_gen, int buf_type) { int type = buf_type & 0xFFFF0000; - if (!dxr3_tested) - dxr3_presence_test(); - return (dxr3_ok && - (type == BUF_SPU_PACKAGE || type == BUF_SPU_CLUT)); + return (type == BUF_SPU_PACKAGE || type == BUF_SPU_CLUT); } static void spudec_init (spu_decoder_t *this_gen, vo_instance_t *vo_out) @@ -413,6 +418,10 @@ spu_decoder_t *init_spu_decoder_plugin (int iface_version, return NULL; } + devname = cfg->lookup_str (cfg, LOOKUP_DEV, DEFAULT_DEV); + dxr3_presence_test (); + if (!dxr3_ok) return NULL; + this = (spudec_decoder_t *) malloc (sizeof (spudec_decoder_t)); this->spu_decoder.interface_version = 3; diff --git a/src/dxr3/video_out_dxr3.c b/src/dxr3/video_out_dxr3.c index 6402a4b78..62572b73e 100644 --- a/src/dxr3/video_out_dxr3.c +++ b/src/dxr3/video_out_dxr3.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_dxr3.c,v 1.7 2001/08/02 18:13:19 ehasenle Exp $ + * $Id: video_out_dxr3.c,v 1.8 2001/08/14 19:43:43 ehasenle Exp $ * * Dummy video out plugin for the dxr3. Is responsible for setting * tv_mode, bcs values and the aspectratio. @@ -46,7 +46,9 @@ #endif #include "../video_out/video_out_x11.h" -char devname[]="/dev/em8300"; +#define LOOKUP_DEV "dxr3_devname" +#define DEFAULT_DEV "/dev/em8300" +static char *devname; typedef struct dxr3_driver_s { vo_driver_t vo_driver; @@ -436,6 +438,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) this->vo_driver.exit = dxr3_exit; /* open control device */ + devname = config->lookup_str (config, LOOKUP_DEV, DEFAULT_DEV); if ((this->fd_control = open(devname, O_WRONLY)) < 0) { fprintf(stderr, "dxr3_vo: Failed to open control device %s (%s)\n", devname, strerror(errno)); |