[MPlayer-dev-eng] [PATCH] tv contrast/brightness/color/hue parameters

Zoltan Hidvegi mplayer at hzoli.2y.net
Sun Mar 23 04:11:26 CET 2003


Hi everyone, thanks for this great program!  Below are some trivial
patches that add color, brightness, hue and contrast parameters to the
-tv option.  Only the specified parameters are changed on the tuner.
The color option accepts both British and American spelling.

The patch also changes the max line length in the config file and the
max option and param length.  I need that because my channels list is
too long.  Besides, you could probably exceed the 100 character limit
even with -lavcopts.

Also, could you please include the mythtv video playback patch in the
next release?

I'm not subscribed to this list, so please CC me any replies.

Thanks,

Zoli

 --- save/cfg-common.h	Sat Feb  8 14:52:25 2003
 +++ cfg-common.h	Sat Mar 22 20:22:27 2003
 @@ -272,6 +272,11 @@
  	{"bass", &tv_param_bass, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL},
  	{"treble", &tv_param_treble, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL},
  	{"balance", &tv_param_balance, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL},
 +	{"brightness", &tv_param_brightness, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL},
 +	{"hue", &tv_param_hue, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL},
 +	{"colour", &tv_param_colour, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL},
 +	{"color", &tv_param_colour, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL},
 +	{"contrast", &tv_param_contrast, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL},
  	{"forcechan", &tv_param_forcechan, CONF_TYPE_INT, CONF_RANGE, 1, 2, NULL},
  	{"forceaudio", &tv_param_force_audio, CONF_TYPE_FLAG, 0, 0, 1, NULL},
  	{"buffersize", &tv_param_buffer_size, CONF_TYPE_INT, CONF_RANGE, 16, 1024, NULL},
 --- save/cfgparser.c	Sat Mar 22 20:27:09 2003
 +++ cfgparser.c	Sat Mar 22 04:23:26 2003
 @@ -863,9 +863,9 @@
  int m_config_parse_config_file(m_config_t *config, char *conffile)
  {
  #define PRINT_LINENUM	mp_msg(MSGT_CFGPARSER,MSGL_INFO,"%s(%d): ", conffile, line_num)
 -#define MAX_LINE_LEN	1000
 -#define MAX_OPT_LEN	100
 -#define MAX_PARAM_LEN	100
 +#define MAX_LINE_LEN	10000
 +#define MAX_OPT_LEN	1000
 +#define MAX_PARAM_LEN	1000
  	FILE *fp;
  	char *line;
  	char opt[MAX_OPT_LEN + 1];
 --- save/libmpdemux/tv.c	Mon Mar 10 10:00:39 2003
 +++ libmpdemux/tv.c	Sat Mar 22 19:15:44 2003
 @@ -60,6 +60,10 @@
  int tv_param_bass = -1;
  int tv_param_treble = -1;
  int tv_param_balance = -1;
 +int tv_param_brightness = -1;
 +int tv_param_hue = -1;
 +int tv_param_colour = -1;
 +int tv_param_contrast = -1;
  int tv_param_forcechan = -1;
  int tv_param_force_audio = 0;
  int tv_param_buffer_size = -1;
 --- save/libmpdemux/tv.h	Sat Dec 28 16:57:39 2002
 +++ libmpdemux/tv.h	Sat Mar 22 19:13:55 2003
 @@ -31,6 +31,10 @@
  extern int tv_param_bass;
  extern int tv_param_treble;
  extern int tv_param_balance;
 +extern int tv_param_brightness;
 +extern int tv_param_hue;
 +extern int tv_param_colour;
 +extern int tv_param_contrast;
  extern int tv_param_forcechan;
  extern int tv_param_force_audio;
  extern int tv_param_buffer_size;
 --- save/libmpdemux/tvi_v4l.c	Sat Feb  1 20:36:35 2003
 +++ libmpdemux/tvi_v4l.c	Sat Mar 22 19:26:41 2003
 @@ -639,6 +639,15 @@
  	priv->bytesperline = priv->width * 2;
      }
  
 +    if (tv_param_brightness >= 0)
 +	priv->picture.brightness = tv_param_brightness;
 +    if (tv_param_hue >= 0)
 +	priv->picture.hue = tv_param_hue;
 +    if (tv_param_colour >= 0)
 +	priv->picture.colour = tv_param_colour;
 +    if (tv_param_contrast >= 0)
 +	priv->picture.contrast = tv_param_contrast;
 +
      mp_msg(MSGT_TV, MSGL_V, "Picture values:\n");
      mp_msg(MSGT_TV, MSGL_V, " Depth: %d, Palette: %s (Format: %s)\n", priv->picture.depth,
  	PALETTE(priv->picture.palette), vo_format_name(priv->format));
 --- save/parser-cfg.c	Sat Mar 22 20:27:19 2003
 +++ parser-cfg.c	Sat Mar 22 04:23:36 2003
 @@ -24,9 +24,9 @@
  int m_config_parse_config_file(m_config_t* config, char *conffile)
  {
  #define PRINT_LINENUM	mp_msg(MSGT_CFGPARSER,MSGL_V,"%s(%d): ", conffile, line_num)
 -#define MAX_LINE_LEN	1000
 -#define MAX_OPT_LEN	100
 -#define MAX_PARAM_LEN	100
 +#define MAX_LINE_LEN	10000
 +#define MAX_OPT_LEN	1000
 +#define MAX_PARAM_LEN	1000
  	FILE *fp;
  	char *line;
  	char opt[MAX_OPT_LEN + 1];


More information about the MPlayer-dev-eng mailing list