diff options
author | Michael Roitzsch <mroi@users.sourceforge.net> | 2003-01-13 18:09:54 +0000 |
---|---|---|
committer | Michael Roitzsch <mroi@users.sourceforge.net> | 2003-01-13 18:09:54 +0000 |
commit | 833e3541fba945451b2043291a9657cc35dff789 (patch) | |
tree | 2e8aec60272803374238c027e74936e5d0493b3a | |
parent | 3af8af7fe008ba200535744ed7e6d2c2b7233e2d (diff) | |
download | xine-lib-833e3541fba945451b2043291a9657cc35dff789.tar.gz xine-lib-833e3541fba945451b2043291a9657cc35dff789.tar.bz2 |
non-dxr3-users should not see the dxr3 config tab
CVS patchset: 3903
CVS date: 2003/01/13 18:09:54
-rw-r--r-- | src/dxr3/dxr3_decode_spu.c | 43 | ||||
-rw-r--r-- | src/dxr3/dxr3_decode_video.c | 45 |
2 files changed, 42 insertions, 46 deletions
diff --git a/src/dxr3/dxr3_decode_spu.c b/src/dxr3/dxr3_decode_spu.c index 90cfe4bed..07d342a10 100644 --- a/src/dxr3/dxr3_decode_spu.c +++ b/src/dxr3/dxr3_decode_spu.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_decode_spu.c,v 1.29 2003/01/02 12:00:52 mroi Exp $ + * $Id: dxr3_decode_spu.c,v 1.30 2003/01/13 18:09:54 mroi Exp $ */ /* dxr3 spu decoder plugin. @@ -100,9 +100,6 @@ typedef struct dxr3_spudec_class_s { spu_decoder_class_t spu_decoder_class; int instance; /* we allow only one instance of this plugin */ - - char devname[128]; - char devnum[3]; } dxr3_spudec_class_t; typedef struct dxr3_spudec_s { @@ -112,6 +109,8 @@ typedef struct dxr3_spudec_s { dxr3_driver_t *dxr3_vo; /* we need to talk to the video out */ xine_event_queue_t *event_queue; + char devname[128]; + char devnum[3]; int fd_spu; /* to access the dxr3 spu device */ dxr3_spu_stream_state_t spu_stream_state[MAX_SPU_STREAMS]; @@ -136,27 +135,10 @@ static void dxr3_swab_clut(int* clut); static void *dxr3_spudec_init_plugin(xine_t *xine, void* data) { dxr3_spudec_class_t *this; - const char *confstr; - int dashpos; this = (dxr3_spudec_class_t *)malloc(sizeof(dxr3_spudec_class_t)); if (!this) return NULL; - confstr = xine->config->register_string(xine->config, - CONF_LOOKUP, CONF_DEFAULT, CONF_NAME, CONF_HELP, 0, NULL, NULL); - strncpy(this->devname, confstr, 128); - this->devname[127] = '\0'; - dashpos = strlen(this->devname) - 2; /* the dash in the new device naming scheme would be here */ - if (this->devname[dashpos] == '-') { - /* use new device naming scheme with trailing number */ - strncpy(this->devnum, &this->devname[dashpos], 3); - this->devname[dashpos] = '\0'; - } else { - /* use old device naming scheme without trailing number */ - /* FIXME: remove this when everyone uses em8300 >=0.12.0 */ - this->devnum[0] = '\0'; - } - this->spu_decoder_class.open_plugin = dxr3_spudec_open_plugin; this->spu_decoder_class.get_identifier = dxr3_spudec_get_identifier; this->spu_decoder_class.get_description = dxr3_spudec_get_description; @@ -172,6 +154,8 @@ static spu_decoder_t *dxr3_spudec_open_plugin(spu_decoder_class_t *class_gen, xi { dxr3_spudec_t *this; dxr3_spudec_class_t *class = (dxr3_spudec_class_t *)class_gen; + const char *confstr; + int dashpos; char tmpstr[128]; int i; @@ -194,12 +178,27 @@ static spu_decoder_t *dxr3_spudec_open_plugin(spu_decoder_class_t *class_gen, xi this->dxr3_vo = (dxr3_driver_t *)stream->video_driver; this->event_queue = xine_event_new_queue(stream); + confstr = stream->xine->config->register_string(stream->xine->config, + CONF_LOOKUP, CONF_DEFAULT, CONF_NAME, CONF_HELP, 0, NULL, NULL); + strncpy(this->devname, confstr, 128); + this->devname[127] = '\0'; + dashpos = strlen(this->devname) - 2; /* the dash in the new device naming scheme would be here */ + if (this->devname[dashpos] == '-') { + /* use new device naming scheme with trailing number */ + strncpy(this->devnum, &this->devname[dashpos], 3); + this->devname[dashpos] = '\0'; + } else { + /* use old device naming scheme without trailing number */ + /* FIXME: remove this when everyone uses em8300 >=0.12.0 */ + this->devnum[0] = '\0'; + } + pthread_mutex_lock(&this->dxr3_vo->spu_device_lock); if (this->dxr3_vo->fd_spu) this->fd_spu = this->dxr3_vo->fd_spu; else { /* open dxr3 spu device */ - snprintf(tmpstr, sizeof(tmpstr), "%s_sp%s", class->devname, class->devnum); + snprintf(tmpstr, sizeof(tmpstr), "%s_sp%s", this->devname, this->devnum); if ((this->fd_spu = open(tmpstr, O_WRONLY)) < 0) { printf("dxr3_decode_spu: Failed to open spu device %s (%s)\n", tmpstr, strerror(errno)); diff --git a/src/dxr3/dxr3_decode_video.c b/src/dxr3/dxr3_decode_video.c index 48adbdb3e..3d8121fd9 100644 --- a/src/dxr3/dxr3_decode_video.c +++ b/src/dxr3/dxr3_decode_video.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_decode_video.c,v 1.27 2003/01/12 20:54:14 f1rmb Exp $ + * $Id: dxr3_decode_video.c,v 1.28 2003/01/13 18:09:58 mroi Exp $ */ /* dxr3 video decoder plugin. @@ -99,9 +99,6 @@ typedef struct dxr3_decoder_class_s { int instance; /* we allow only one instance of this plugin */ - char devname[128]; - char devnum[3]; - metronom_clock_t *clock; /* used for syncing */ } dxr3_decoder_class_t; @@ -112,6 +109,8 @@ typedef struct dxr3_decoder_s { dxr3_scr_t *scr; dxr3_driver_t *dxr3_vo; /* we need to talk to the dxr3 video out */ + char devname[128]; + char devnum[3]; int fd_control; int fd_video; /* to access the dxr3 devices */ @@ -156,28 +155,10 @@ static void dxr3_update_correct_durations(void *this_gen, xine_cfg_entry_t static void *dxr3_init_plugin(xine_t *xine, void *data) { dxr3_decoder_class_t *this; - config_values_t *cfg; - const char *confstr; - int dashpos; this = (dxr3_decoder_class_t *)malloc(sizeof (dxr3_decoder_class_t)); if (!this) return NULL; - cfg = xine->config; - confstr = cfg->register_string(cfg, CONF_LOOKUP, CONF_DEFAULT, CONF_NAME, CONF_HELP, 0, NULL, NULL); - strncpy(this->devname, confstr, 128); - this->devname[127] = '\0'; - dashpos = strlen(this->devname) - 2; /* the dash in the new device naming scheme would be here */ - if (this->devname[dashpos] == '-') { - /* use new device naming scheme with trailing number */ - strncpy(this->devnum, &this->devname[dashpos], 3); - this->devname[dashpos] = '\0'; - } else { - /* use old device naming scheme without trailing number */ - /* FIXME: remove this when everyone uses em8300 >=0.12.0 */ - this->devnum[0] = '\0'; - } - this->video_decoder_class.open_plugin = dxr3_open_plugin; this->video_decoder_class.get_identifier = dxr3_get_identifier; this->video_decoder_class.get_description = dxr3_get_description; @@ -196,6 +177,8 @@ static video_decoder_t *dxr3_open_plugin(video_decoder_class_t *class_gen, xine_ dxr3_decoder_t *this; dxr3_decoder_class_t *class = (dxr3_decoder_class_t *)class_gen; config_values_t *cfg; + const char *confstr; + int dashpos; char tmpstr[128]; if (class->instance) return NULL; @@ -217,7 +200,21 @@ static video_decoder_t *dxr3_open_plugin(video_decoder_class_t *class_gen, xine_ this->scr = NULL; this->dxr3_vo = (dxr3_driver_t *)stream->video_driver; - snprintf(tmpstr, sizeof(tmpstr), "%s%s", class->devname, class->devnum); + confstr = cfg->register_string(cfg, CONF_LOOKUP, CONF_DEFAULT, CONF_NAME, CONF_HELP, 0, NULL, NULL); + strncpy(this->devname, confstr, 128); + this->devname[127] = '\0'; + dashpos = strlen(this->devname) - 2; /* the dash in the new device naming scheme would be here */ + if (this->devname[dashpos] == '-') { + /* use new device naming scheme with trailing number */ + strncpy(this->devnum, &this->devname[dashpos], 3); + this->devname[dashpos] = '\0'; + } else { + /* use old device naming scheme without trailing number */ + /* FIXME: remove this when everyone uses em8300 >=0.12.0 */ + this->devnum[0] = '\0'; + } + + snprintf(tmpstr, sizeof(tmpstr), "%s%s", this->devname, this->devnum); #if LOG_VID printf("dxr3_decode_video: Entering video init, devname=%s.\n",tmpstr); #endif @@ -465,7 +462,7 @@ static void dxr3_decode_data(video_decoder_t *this_gen, buf_element_t *buf) */ if (this->fd_video < 0) { char tmpstr[128]; - snprintf (tmpstr, sizeof(tmpstr), "%s_mv%s", this->class->devname, this->class->devnum); + snprintf (tmpstr, sizeof(tmpstr), "%s_mv%s", this->devname, this->devnum); if ((this->fd_video = open(tmpstr, O_WRONLY | O_NONBLOCK)) < 0) { printf("dxr3_decode_video: Failed to open video device %s (%s)\n", tmpstr, strerror(errno)); |