From 876f8b302ef737396004efb42bb5973a82ef9a05 Mon Sep 17 00:00:00 2001 From: Mike Lampard Date: Sun, 18 Nov 2001 08:25:46 +0000 Subject: update to work with the new config system CVS patchset: 1065 CVS date: 2001/11/18 08:25:46 --- src/dxr3/dxr3_decoder.c | 13 ++++++++----- src/dxr3/dxr3_vo_core.c | 25 ++++++++++++++----------- src/dxr3/dxr3_vo_encoder.c | 11 +++++++---- 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/src/dxr3/dxr3_decoder.c b/src/dxr3/dxr3_decoder.c index f94e619fd..6d3508496 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.33 2001/11/14 17:37:02 mlampard Exp $ + * $Id: dxr3_decoder.c,v 1.34 2001/11/18 08:25:46 mlampard Exp $ * * dxr3 video and spu decoder plugin. Accepts the video and spu data * from XINE and sends it directly to the corresponding dxr3 devices. @@ -417,7 +417,8 @@ video_decoder_t *init_video_decoder_plugin (int iface_version, return NULL; } - devname = cfg->lookup_str (cfg, LOOKUP_DEV, DEFAULT_DEV); + devname = cfg->register_string (cfg, LOOKUP_DEV, DEFAULT_DEV, "Name of the dxr3 device",NULL,NULL,NULL); + dxr3_presence_test (); if (!dxr3_ok) return NULL; @@ -432,9 +433,10 @@ video_decoder_t *init_video_decoder_plugin (int iface_version, this->video_decoder.flush = dxr3_flush; this->video_decoder.priority = 10; - this->scr_prio = cfg->lookup_int(cfg, "dxr3_scr_prio", 10); + this->scr_prio = cfg->register_num(cfg, "dxr3_scr_prio", 10, "Priority of the Dxr3 SCR plugin",NULL,NULL,NULL); - this->enhanced_mode = cfg->lookup_int(cfg,"dxr3_buffer_mode", 0); + this->enhanced_mode = cfg->register_bool(cfg,"dxr3_buffer_mode", 0, "Use alternate Play mode",NULL,NULL,NULL); + if(this->enhanced_mode) printf("Dxr3: Using Mode 6 for playback\n"); return (video_decoder_t *) this; @@ -635,7 +637,8 @@ spu_decoder_t *init_spu_decoder_plugin (int iface_version, xine_t *xine) } cfg = xine->config; - devname = cfg->lookup_str (cfg, LOOKUP_DEV, DEFAULT_DEV); + devname = cfg->register_string (cfg, LOOKUP_DEV, DEFAULT_DEV, "Name of the dxr3 device",NULL,NULL,NULL); + dxr3_presence_test (); if (!dxr3_ok) return NULL; diff --git a/src/dxr3/dxr3_vo_core.c b/src/dxr3/dxr3_vo_core.c index c98658f97..e030c5569 100644 --- a/src/dxr3/dxr3_vo_core.c +++ b/src/dxr3/dxr3_vo_core.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_vo_core.c,v 1.7 2001/11/10 06:20:39 mlampard Exp $ + * $Id: dxr3_vo_core.c,v 1.8 2001/11/18 08:25:46 mlampard Exp $ * ************************************************************************* * core functions common to both Standard and RT-Encoding vo plugins * @@ -103,14 +103,15 @@ void dxr3_read_config(dxr3_driver_t *this) fprintf(stderr, "dxr3_vo: cannot read bcs values (%s)\n", strerror(errno)); - this->bcs.contrast = config->lookup_int(config, "dxr3_contrast", this->bcs.contrast); - this->bcs.saturation = config->lookup_int(config, "dxr3_saturation", this->bcs.saturation); - this->bcs.brightness = config->lookup_int(config, "dxr3_brightness", this->bcs.brightness); + this->bcs.contrast = config->register_range(config, "dxr3_contrast", this->bcs.contrast,100,900,"Dxr3 contrast control",NULL,NULL,NULL); + this->bcs.saturation = config->register_range(config, "dxr3_saturation", this->bcs.saturation,100,900,"Dxr3 saturation control",NULL,NULL,NULL); + this->bcs.brightness = config->register_range(config, "dxr3_brightness", this->bcs.brightness,100,900,"Dxr3 brightness control",NULL,NULL,NULL); this->vo_driver.set_property(&this->vo_driver, VO_PROP_ASPECT_RATIO, ASPECT_FULL); - str = config->lookup_str(config, "dxr3_vomode", "tv"); + str = config->register_string(config, "dxr3_vomode", "tv", "Dxr3 videoout mode", NULL,NULL,NULL); + if (!strcasecmp(str, "tv")) { this->overlay_enabled=0; this->tv_switchable=0; /* don't allow on-the-fly switching */ @@ -120,10 +121,12 @@ void dxr3_read_config(dxr3_driver_t *this) if (dxr3_overlay_read_state(&this->overlay) == 0) { this->overlay_enabled = 1; this->tv_switchable=1; - str = config->lookup_str(config, "dxr3_keycolor", "0x80a040"); + str = config->register_string(config, "dxr3_keycolor", "0x80a040", "Dxr3 overlay colourkey value",NULL,NULL,NULL); + sscanf(str, "%x", &this->overlay.colorkey); - str = config->lookup_str(config, "dxr3_color_interval", "50.0"); + str = config->register_string(config, "dxr3_color_interval", "50.0", "Dxr3 overlay colourkey range",NULL,NULL,NULL); + sscanf(str, "%f", &this->overlay.color_interval); } else { fprintf(stderr, "dxr3_vo: please run autocal, overlay disabled\n"); @@ -131,7 +134,7 @@ void dxr3_read_config(dxr3_driver_t *this) this->tv_switchable=0; } } - str = config->lookup_str(config, "dxr3_preferred_tvmode", "default"); + str = config->register_string(config, "dxr3_preferred_tvmode", "default", "Dxr3 preferred tv mode",NULL,NULL,NULL); if (!strcasecmp(str, "ntsc")) { this->tv_mode = EM8300_VIDEOMODE_NTSC; @@ -347,9 +350,9 @@ int dxr3_set_property (vo_driver_t *this_gen, if (ioctl(this->fd_control, EM8300_IOCTL_SETBCS, &this->bcs)) fprintf(stderr, "dxr3_vo: bcs set failed (%s)\n", strerror(errno)); - this->config->set_int(this->config, "dxr3_contrast", this->bcs.contrast); - this->config->set_int(this->config, "dxr3_saturation", this->bcs.saturation); - this->config->set_int(this->config, "dxr3_brightness", this->bcs.brightness); + this->config->update_num(this->config, "dxr3_contrast", this->bcs.contrast); + this->config->update_num(this->config, "dxr3_saturation", this->bcs.saturation); + this->config->update_num(this->config, "dxr3_brightness", this->bcs.brightness); } return value; diff --git a/src/dxr3/dxr3_vo_encoder.c b/src/dxr3/dxr3_vo_encoder.c index 0e1570f63..9776d9014 100644 --- a/src/dxr3/dxr3_vo_encoder.c +++ b/src/dxr3/dxr3_vo_encoder.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_vo_encoder.c,v 1.3 2001/11/17 14:26:38 f1rmb Exp $ + * $Id: dxr3_vo_encoder.c,v 1.4 2001/11/18 08:25:46 mlampard Exp $ * * mpeg1 encoding video out plugin for the dxr3. * @@ -302,7 +302,8 @@ static void dxr3_update_frame_format (vo_driver_t *this_gen, puts ("Couldn't start the FAME library"); buffer = (unsigned char *) malloc (DEFAULT_BUFFER_SIZE); - fp.quality=this->config->lookup_int(this->config,"dxr3enc_quality",90); + fp.quality=this->config->register_range(this->config,"dxr3enc_quality",90, 10,100, "Dxr3enc mpeg encoding quality",NULL,NULL,NULL); + fp.width = width; fp.height = oheight; fp.profile = "mpeg1"; @@ -545,7 +546,8 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) this->config=config; /* open control device */ - devname = config->lookup_str (config, LOOKUP_DEV, DEFAULT_DEV); + devname = config->register_string (config, LOOKUP_DEV, DEFAULT_DEV,"Dxr3 device name",NULL,NULL,NULL); + printf("dxr3enc: Entering video init, devname=%s.\n",devname); if ((this->fd_control = open(devname, O_WRONLY)) < 0) { printf("dxr3enc: Failed to open control device %s (%s)\n", @@ -553,7 +555,8 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) return 0; } /* output mpeg to file instead of dxr3? */ - file_out = config->lookup_str(config, "dxr3enc_file", ""); + file_out = config->register_string(config, "dxr3enc_file", "", "Dxr3enc output file for debugging",NULL,NULL,NULL); + if (file_out && strcmp(file_out, "")) { this->fd_video = open(file_out, O_WRONLY | O_CREAT); if (this->fd_video < 0) { -- cgit v1.2.3