[MPlayer-cvslog] r23909 - in trunk: cfg-common.h mplayer.c stream/tv.c stream/tv.h

voroshil subversion at mplayerhq.hu
Sun Jul 29 12:30:41 CEST 2007


Author: voroshil
Date: Sun Jul 29 12:30:41 2007
New Revision: 23909

Log:
Removing global variables from tv://
Step 8 (last): removing old globals from tv.c, tv.h,
fixing remaining references in cfg-common.h and mplayer.c



Modified:
   trunk/cfg-common.h
   trunk/mplayer.c
   trunk/stream/tv.c
   trunk/stream/tv.h

Modified: trunk/cfg-common.h
==============================================================================
--- trunk/cfg-common.h	(original)
+++ trunk/cfg-common.h	Sun Jul 29 12:30:41 2007
@@ -420,47 +420,47 @@ m_option_t radioopts_conf[]={
 #ifdef USE_TV
 m_option_t tvopts_conf[]={
 	{"on", "-tv on has been removed, use tv:// instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
-	{"immediatemode", &tv_param_immediate, CONF_TYPE_INT, CONF_RANGE, 0, 1, NULL},
-	{"noaudio", &tv_param_noaudio, CONF_TYPE_FLAG, 0, 0, 1, NULL},
-	{"audiorate", &tv_param_audiorate, CONF_TYPE_INT, 0, 0, 0, NULL},
-	{"driver", &tv_param_driver, CONF_TYPE_STRING, 0, 0, 0, NULL},
-	{"device", &tv_param_device, CONF_TYPE_STRING, 0, 0, 0, NULL},
-	{"freq", &tv_param_freq, CONF_TYPE_STRING, 0, 0, 0, NULL},
-	{"channel", &tv_param_channel, CONF_TYPE_STRING, 0, 0, 0, NULL},
-	{"chanlist", &tv_param_chanlist, CONF_TYPE_STRING, 0, 0, 0, NULL},
-	{"norm", &tv_param_norm, CONF_TYPE_STRING, 0, 0, 0, NULL},
-	{"automute", &tv_param_automute, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL},
+	{"immediatemode", &stream_tv_defaults.immediate, CONF_TYPE_INT, CONF_RANGE, 0, 1, NULL},
+	{"noaudio", &stream_tv_defaults.noaudio, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+	{"audiorate", &stream_tv_defaults.audiorate, CONF_TYPE_INT, 0, 0, 0, NULL},
+	{"driver", &stream_tv_defaults.driver, CONF_TYPE_STRING, 0, 0, 0, NULL},
+	{"device", &stream_tv_defaults.device, CONF_TYPE_STRING, 0, 0, 0, NULL},
+	{"freq", &stream_tv_defaults.freq, CONF_TYPE_STRING, 0, 0, 0, NULL},
+	{"channel", &stream_tv_defaults.channel, CONF_TYPE_STRING, 0, 0, 0, NULL},
+	{"chanlist", &stream_tv_defaults.chanlist, CONF_TYPE_STRING, 0, 0, 0, NULL},
+	{"norm", &stream_tv_defaults.norm, CONF_TYPE_STRING, 0, 0, 0, NULL},
+	{"automute", &stream_tv_defaults.automute, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL},
 #ifdef HAVE_TV_V4L2
-	{"normid", &tv_param_normid, CONF_TYPE_INT, 0, 0, 0, NULL},
+	{"normid", &stream_tv_defaults.normid, CONF_TYPE_INT, 0, 0, 0, NULL},
 #endif
-	{"width", &tv_param_width, CONF_TYPE_INT, 0, 0, 4096, NULL},
-	{"height", &tv_param_height, CONF_TYPE_INT, 0, 0, 4096, NULL},
-	{"input", &tv_param_input, CONF_TYPE_INT, 0, 0, 20, NULL},
-	{"outfmt", &tv_param_outfmt, CONF_TYPE_IMGFMT, 0, 0, 0, NULL},
-	{"fps", &tv_param_fps, CONF_TYPE_FLOAT, 0, 0, 100.0, NULL},
-	{"channels", &tv_param_channels, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
-	{"brightness", &tv_param_brightness, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
-	{"contrast", &tv_param_contrast, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
-	{"hue", &tv_param_hue, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
-	{"saturation", &tv_param_saturation, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
+	{"width", &stream_tv_defaults.width, CONF_TYPE_INT, 0, 0, 4096, NULL},
+	{"height", &stream_tv_defaults.height, CONF_TYPE_INT, 0, 0, 4096, NULL},
+	{"input", &stream_tv_defaults.input, CONF_TYPE_INT, 0, 0, 20, NULL},
+	{"outfmt", &stream_tv_defaults.outfmt, CONF_TYPE_IMGFMT, 0, 0, 0, NULL},
+	{"fps", &stream_tv_defaults.fps, CONF_TYPE_FLOAT, 0, 0, 100.0, NULL},
+	{"channels", &stream_tv_defaults.channels, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
+	{"brightness", &stream_tv_defaults.brightness, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
+	{"contrast", &stream_tv_defaults.contrast, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
+	{"hue", &stream_tv_defaults.hue, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
+	{"saturation", &stream_tv_defaults.saturation, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
 #if defined(HAVE_TV_V4L) || defined(HAVE_TV_V4L2)
-	{"amode", &tv_param_amode, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL},
-	{"volume", &tv_param_volume, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL},
-	{"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},
-	{"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},
-	{"mjpeg", &tv_param_mjpeg, CONF_TYPE_FLAG, 0, 0, 1, NULL},
-	{"decimation", &tv_param_decimation, CONF_TYPE_INT, CONF_RANGE, 1, 4, NULL},
-	{"quality", &tv_param_quality, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL},
+	{"amode", &stream_tv_defaults.amode, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL},
+	{"volume", &stream_tv_defaults.volume, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL},
+	{"bass", &stream_tv_defaults.bass, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL},
+	{"treble", &stream_tv_defaults.treble, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL},
+	{"balance", &stream_tv_defaults.balance, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL},
+	{"forcechan", &stream_tv_defaults.forcechan, CONF_TYPE_INT, CONF_RANGE, 1, 2, NULL},
+	{"forceaudio", &stream_tv_defaults.force_audio, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+	{"buffersize", &stream_tv_defaults.buffer_size, CONF_TYPE_INT, CONF_RANGE, 16, 1024, NULL},
+	{"mjpeg", &stream_tv_defaults.mjpeg, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+	{"decimation", &stream_tv_defaults.decimation, CONF_TYPE_INT, CONF_RANGE, 1, 4, NULL},
+	{"quality", &stream_tv_defaults.quality, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL},
 #if defined(HAVE_ALSA9) || defined(HAVE_ALSA1X)
-	{"alsa", &tv_param_alsa, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+	{"alsa", &stream_tv_defaults.alsa, CONF_TYPE_FLAG, 0, 0, 1, NULL},
 #endif
-	{"adevice", &tv_param_adevice, CONF_TYPE_STRING, 0, 0, 0, NULL},
+	{"adevice", &stream_tv_defaults.adevice, CONF_TYPE_STRING, 0, 0, 0, NULL},
 #endif
-	{"audioid", &tv_param_audio_id, CONF_TYPE_INT, CONF_RANGE, 0, 9, NULL},
+	{"audioid", &stream_tv_defaults.audio_id, CONF_TYPE_INT, CONF_RANGE, 0, 9, NULL},
 	{NULL, NULL, 0, 0, 0, 0, NULL}
 };
 #endif

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	(original)
+++ trunk/mplayer.c	Sun Jul 29 12:30:41 2007
@@ -2305,7 +2305,7 @@ int gui_no_filename=0;
 #endif /*WIN32 && USE_WIN32DLL*/
 
 #ifdef USE_TV
-  tv_param_immediate = 1;
+  stream_tv_defaults.immediate = 1;
 #endif
 
   if (argc > 1 && argv[1] &&

Modified: trunk/stream/tv.c
==============================================================================
--- trunk/stream/tv.c	(original)
+++ trunk/stream/tv.c	Sun Jul 29 12:30:41 2007
@@ -35,48 +35,6 @@
 
 #include "frequencies.h"
 
-/* some default values */
-int tv_param_audiorate = 44100;
-int tv_param_noaudio = 0;
-int tv_param_immediate = 0;
-char *tv_param_freq = NULL;
-char *tv_param_channel = NULL;
-char *tv_param_norm = "pal";
-#ifdef HAVE_TV_V4L2
-int tv_param_normid = -1;
-#endif
-char *tv_param_chanlist = "europe-east";
-char *tv_param_device = NULL;
-char *tv_param_driver = "dummy";
-int tv_param_width = -1;
-int tv_param_height = -1;
-int tv_param_input = 0; /* used in v4l and bttv */
-int tv_param_outfmt = -1;
-float tv_param_fps = -1.0;
-char **tv_param_channels = NULL;
-int tv_param_audio_id = 0;
-int tv_param_automute = 0;
-#if defined(HAVE_TV_V4L)
-int tv_param_amode = -1;
-int tv_param_volume = -1;
-int tv_param_bass = -1;
-int tv_param_treble = -1;
-int tv_param_balance = -1;
-int tv_param_forcechan = -1;
-int tv_param_force_audio = 0;
-int tv_param_buffer_size = -1;
-int tv_param_mjpeg = 0;
-int tv_param_decimation = 2;
-int tv_param_quality = 90;
-#if defined(HAVE_ALSA9) || defined(HAVE_ALSA1X)
-int tv_param_alsa = 0;
-#endif
-#endif
-char* tv_param_adevice = NULL;
-int tv_param_brightness = 0;
-int tv_param_contrast = 0;
-int tv_param_hue = 0;
-int tv_param_saturation = 0;
 tv_channels_t *tv_channel_list;
 tv_channels_t *tv_channel_current, *tv_channel_last;
 char *tv_channel_last_real;

Modified: trunk/stream/tv.h
==============================================================================
--- trunk/stream/tv.h	(original)
+++ trunk/stream/tv.h	Sun Jul 29 12:30:41 2007
@@ -5,48 +5,6 @@
 //#include "libmpcodecs/img_format.h"
 //#include "mp_msg.h"
 
-extern char *tv_param_freq;
-extern char *tv_param_channel;
-extern char *tv_param_chanlist;
-extern char *tv_param_norm;
-extern int tv_param_automute;
-#ifdef HAVE_TV_V4L2
-extern int tv_param_normid;
-#endif
-extern char *tv_param_device;
-extern char *tv_param_driver;
-extern int tv_param_width;
-extern int tv_param_height;
-extern int tv_param_input;
-extern int tv_param_outfmt;
-extern float tv_param_fps;
-extern char **tv_param_channels;
-extern int tv_param_noaudio;
-extern int tv_param_immediate;
-extern int tv_param_audiorate;
-extern int tv_param_audio_id;
-#if defined(HAVE_TV_V4L)
-extern int tv_param_amode;
-extern int tv_param_volume;
-extern int tv_param_bass;
-extern int tv_param_treble;
-extern int tv_param_balance;
-extern int tv_param_forcechan;
-extern int tv_param_force_audio;
-extern int tv_param_buffer_size;
-extern int tv_param_mjpeg;
-extern int tv_param_decimation;
-extern int tv_param_quality;
-#if defined(HAVE_ALSA9) || defined(HAVE_ALSA1X)
-extern int tv_param_alsa;
-#endif
-extern char* tv_param_adevice;
-#endif
-extern int tv_param_brightness;
-extern int tv_param_contrast;
-extern int tv_param_hue;
-extern int tv_param_saturation;
-
 typedef struct tv_param_s {
     char *freq;
     char *channel;



More information about the MPlayer-cvslog mailing list