LINUX.ORG.RU

Для тех кто использует mplayer для просмотра ТВ


0

0

Недавно сменил компьютер и взял видюху Ati EAH2400Pro и после этого tvtime отказался работать(xawtv не нравится), решил использовать mplayer.

Вот патч который добавляет возможность установки формата(PAL,SECAM, PALM итд) в список каналов.

Новый формат записи каналов:
  channels=<НОМЕР>-<ИМЯ КАНАЛА>=<ФОРМАТ>

Пример:
  mplayer tv://2 -tv driver=v4l2:input=0:chanlist=russia:channels=8-TNT+100=PAL,11-ORT=SECAM,27-RUSS
IA=SECAM,29-NTV=PAL,31-TNV=SECAM
  mplayer tv://2 -tv driver=v4l2:input=0:norm=SECAM:chanlist=russia:channels=8-TNT+100=PAL,11-ORT=SE
CAM,27-RUSSIA,29-NTV=PAL,31-TNV=SECAM

Вот сам патч:
diff -Naur mplayer-1.0_rc2_p25993.orig/stream/tv.c mplayer-1.0_rc2_p25993/stream/tv.c
--- mplayer-1.0_rc2_p25993.orig/stream/tv.c	2008-02-06 17:37:07.000000000 +0300
+++ mplayer-1.0_rc2_p25993/stream/tv.c	2008-03-13 09:34:05.000000000 +0300
@@ -254,6 +254,7 @@
     tv_channel_list->next=NULL;
     tv_channel_list->prev=NULL;
     tv_channel_current = tv_channel_list;
+	tv_channel_current->norm = tvh->norm;
 
     while (*channels) {
         char* tmp = *(channels++);
@@ -299,6 +300,12 @@
             if ( sep[0] == '-' ) tv_channel_current->freq -= i * 100;
             sep[0] = '\0';
           }
+
+          sep = strchr(tv_channel_current->name, '=');
+          if ( sep ) {
+			tv_channel_current->norm = norm_from_string(tvh, sep+1);
+            sep[0] = '\0';
+          }
         }
 
         /*mp_msg(MSGT_TV, MSGL_INFO, "-- Detected channel %s - %s (%5.3f)\n",
@@ -310,6 +317,7 @@
         tv_channel_current->next->prev = tv_channel_current;
         tv_channel_current->next->next = NULL;
         tv_channel_current = tv_channel_current->next;
+		tv_channel_current->norm = tvh->norm;
     }
     if (tv_channel_current->prev)
         tv_channel_current->prev->next = NULL;
@@ -500,6 +508,7 @@
 
 	mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3, tv_channel_current->number,
 			tv_channel_current->name, (float)tv_channel_current->freq/1000);
+	tv_set_norm_i(tvh, tv_channel_current->norm);
 	tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
 	tv_channel_last = tv_channel_current;
     } else {
@@ -922,6 +931,8 @@
 				tv_channel_current = tv_channel_current->next;
 			else
 				tv_channel_current = tv_channel_list;
+				
+				tv_set_norm_i(tvh, tv_channel_current->norm);
 				tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
 				mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3,
 			tv_channel_current->number, tv_channel_current->name, (float)tv_channel_current->freq/1000);
@@ -933,6 +944,7 @@
 			else
 				while (tv_channel_current->next)
 					tv_channel_current = tv_channel_current->next;
+				tv_set_norm_i(tvh, tv_channel_current->norm);
 				tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
 				mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3,
 			tv_channel_current->number, tv_channel_current->name, (float)tv_channel_current->freq/1000);
@@ -977,6 +989,7 @@
 				tv_channel_current = tv_channel_current->next;
 		mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3, tv_channel_current->number,
 				tv_channel_current->name, (float)tv_channel_current->freq/1000);
+		tv_set_norm_i(tvh, tv_channel_current->norm);
 		tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
 	} else tv_set_channel_real(tvh, channel);
 	return(1);
@@ -994,6 +1007,7 @@
 
 		mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel3, tv_channel_current->number,
 				tv_channel_current->name, (float)tv_channel_current->freq/1000);
+		tv_set_norm_i(tvh, tv_channel_current->norm);
 		tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16));
 	} else {
 		int i;
@@ -1050,6 +1064,22 @@
     return(1);
 }
 
+int tv_set_norm_i(tvi_handle_t *tvh, int norm)
+{
+	char norm_s[5];
+	snprintf(norm_s, 5, "%d", norm);
+
+    tvh->norm = norm;
+
+    mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_SelectedNorm, norm_s);
+    if (tvh->functions->control(tvh->priv, TVI_CONTROL_TUN_SET_NORM, &tvh->norm) != TVI_CONTROL_TRUE) {
+	mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_CannotSetNorm);
+	return 0;
+    }
+    tvh->functions->control(tvh->priv,TV_VBI_CONTROL_RESET,tvh->tv_param);
+    return(1);
+}
+
 demuxer_desc_t demuxer_desc_tv = {
   "Tv card demuxer",
   "tv",
diff -Naur mplayer-1.0_rc2_p25993.orig/stream/tv.h mplayer-1.0_rc2_p25993/stream/tv.h
--- mplayer-1.0_rc2_p25993.orig/stream/tv.h	2008-02-06 17:37:07.000000000 +0300
+++ mplayer-1.0_rc2_p25993/stream/tv.h	2008-03-13 09:19:22.000000000 +0300
@@ -119,6 +119,7 @@
     int index;
     char number[5];
     char name[20];
+	int norm;
     int   freq;
     struct tv_channels_s *next;
     struct tv_channels_s *prev;

В принцыпи и для записи очень удобно получаетс. Конечно если список каналов добавить в конфигурационный файл.

Devix
() автор топика
Ответ на: комментарий от madcore

>Почему было не написать патч для tvtime, чтобы на ати работал? :)
Пока чтото не охото в эти дебри лесть.

>А kdetv тоже не пашет?
У меня дист скомпилирован без поддержки kde и gnome.

Devix
() автор топика
Ответ на: комментарий от madcore

> Почему было не написать патч для tvtime, чтобы на ати работал? :)

Сейчас посмотрел как в tvtime реализован вывод. В принципи сделать можно. Час надо почитать про библиотеку SDL. Потом посмотру.

Devix
() автор топика
Ответ на: комментарий от madcore

> Почему было не написать патч для tvtime, чтобы на ати работал? :)

Вот и патч для версии tvtime 1.0.2 для поддержки sdl. У меня тепер работает.
Перед компиляцией прогнать automake и autoconfig

Вот сам патч:

diff -Naur tvtime-1.0.2.orig/config.h.in tvtime-1.0.2/config.h.in
--- tvtime-1.0.2.orig/config.h.in	2005-09-15 01:41:48.000000000 +0400
+++ tvtime-1.0.2/config.h.in	2008-03-13 21:40:51.000000000 +0300
@@ -301,6 +301,9 @@
 /* Xv support */
 #undef HAVE_XV
 
+/* SDL support */
+#undef HAVE_SDL
+
 /* Define to 1 if you have the `__argz_count' function. */
 #undef HAVE___ARGZ_COUNT
 
diff -Naur tvtime-1.0.2.orig/configure.ac tvtime-1.0.2/configure.ac
--- tvtime-1.0.2.orig/configure.ac	2005-09-15 01:40:44.000000000 +0400
+++ tvtime-1.0.2/configure.ac	2008-03-13 21:40:21.000000000 +0300
@@ -130,6 +130,11 @@
 	    X11_LIBS="$X11_LIBS -lXxf86vm"],,
 	    [$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS -lXext])],,
 	[$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS])
+
+	AC_CHECK_LIB([SDL],[SDL_CreateYUVOverlay],
+	    [AC_DEFINE([HAVE_SDL],,[SDL support])
+	    X11_LIBS="$X11_LIBS -lSDL"],,
+	[$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS])
 else
     AC_MSG_ERROR(X needed and no X libraries or development headers found)
 fi
diff -Naur tvtime-1.0.2.orig/src/Makefile.am tvtime-1.0.2/src/Makefile.am
--- tvtime-1.0.2.orig/src/Makefile.am	2005-02-08 08:00:16.000000000 +0300
+++ tvtime-1.0.2/src/Makefile.am	2008-03-13 21:40:21.000000000 +0300
@@ -67,7 +67,7 @@
 	$(top_srcdir)/plugins/weavebff.c \
 	$(DSCALER_SRCS)
 
-OUTPUT_SRCS = xfullscreen.h xfullscreen.c outputapi.h xvoutput.h xvoutput.c \
+OUTPUT_SRCS = xfullscreen.h xfullscreen.c outputapi.h xvoutput.h xvoutput.c sdloutput.c sdloutput.h\
 	xcommon.h xcommon.c
 
 bin_PROGRAMS = tvtime tvtime-command tvtime-configure tvtime-scanner
diff -Naur tvtime-1.0.2.orig/src/sdloutput.c tvtime-1.0.2/src/sdloutput.c
--- tvtime-1.0.2.orig/src/sdloutput.c	1970-01-01 03:00:00.000000000 +0300
+++ tvtime-1.0.2/src/sdloutput.c	2008-03-13 21:40:21.000000000 +0300
@@ -0,0 +1,359 @@
+/**
+ * Copyright (C) 2008 Ildar Ismagilov <devix@pop3.ru>.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "xvoutput.h"
+
+#ifdef HAVE_SDL
+
+#include <SDL/SDL.h>
+#include <stdlib.h>
+#include "utils.h"
+
+static SDL_Surface *screen;
+static SDL_Overlay *overlay;
+int full_screen;
+int real_width, real_height;
+
+static int sdl_init( const char *user_geometry, int aspect, int squarepixel, int verbose )
+{
+	screen = NULL;
+	overlay = NULL;
+	full_screen = 0;
+
+	if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0)
+		return 0;
+
+    return 1;
+}
+
+static void sdl_quit( void )
+{
+	if (overlay)
+		SDL_FreeYUVOverlay(overlay);
+
+	SDL_Quit();
+}
+
+static int sdl_show_frame( int x, int y, int width, int height )
+{
+	SDL_Rect rect;
+
+	rect.x = 0;
+	rect.y = 0;
+	rect.w = screen->w;
+	rect.h = screen->h;
+
+	if (SDL_DisplayYUVOverlay(overlay, &rect) == 0)
+		return 1;
+	else
+		return 0;
+}
+
+static int sdl_set_input_size( int width, int height)
+{
+	real_width = width;
+	real_height = height;
+
+	if (overlay)
+		SDL_FreeYUVOverlay(overlay);
+
+	sdl_set_video_mode(width, height);
+	overlay = SDL_CreateYUVOverlay(width, height, SDL_YUY2_OVERLAY, screen);
+
+	return 1;
+}
+
+void sdl_set_video_mode(int width, int height)
+{
+	screen = SDL_SetVideoMode(width, height, 16, SDL_HWSURFACE | SDL_ANYFORMAT | SDL_RESIZABLE);
+}
+
+static uint8_t *sdl_get_output( void )
+{
+    return overlay->pixels[0];
+}
+
+int sdl_get_visible_width( void )
+{
+	return screen->w;
+}
+
+int sdl_get_visible_height( void )
+{
+	return screen->h;
+}
+
+static int sdl_get_stride( void )
+{
+	return overlay->pitches[0];
+}
+
+void sdl_poll_events( input_t *in )
+{
+	SDL_Event event;
+  
+	while (SDL_PollEvent(&event)) {
+		int arg = 0;
+		SDLKey mykey;
+		int x, y;
+
+		switch (event.type) {
+			case SDL_VIDEORESIZE: 
+				sdl_set_video_mode(event.resize.w, event.resize.h);
+				break;
+			case SDL_QUIT:
+				input_callback( in, I_QUIT, arg );
+				break;
+			case SDL_MOUSEBUTTONDOWN:
+                input_callback( in, I_BUTTONPRESS, event.button.button );
+				break;
+			case SDL_MOUSEBUTTONUP:
+                input_callback( in, I_BUTTONRELEASE, event.button.button );
+				break;
+			case SDL_MOUSEMOTION:
+				x = event.motion.x*real_width/screen->w;
+				y = event.motion.y*real_height/screen->h;
+				input_callback( in, I_MOUSEMOVE, ((x & 0xffff) << 16 | (y & 0xffff)) );
+				break;
+			case SDL_KEYDOWN:
+				mykey = event.key.keysym.sym;
+
+				if(event.key.keysym.mod == KMOD_CTRL) arg |= I_CTRL;
+				if(event.key.keysym.mod == KMOD_META) arg |= I_META;
+
+				if( mykey >= SDLK_a && mykey <= SDLK_z ) {
+					arg |= mykey - SDLK_a + 'a';
+				} else if( mykey >= SDLK_0 && mykey <= SDLK_9 ) {
+					arg |= mykey - SDLK_0 + '0';
+				}
+				
+				switch (mykey) {
+					case SDLK_ESCAPE: arg |= I_ESCAPE; break;
+
+					case SDLK_HOME:      arg |= I_HOME; break;
+					case SDLK_END:       arg |= I_END; break;
+					case SDLK_LEFT:      arg |= I_LEFT; break;
+					case SDLK_UP:        arg |= I_UP; break;
+					case SDLK_RIGHT:     arg |= I_RIGHT; break;
+					case SDLK_DOWN:      arg |= I_DOWN; break;
+					case SDLK_PAGEUP:   arg |= I_PGUP; break;
+					case SDLK_PAGEDOWN: arg |= I_PGDN; break;
+					case SDLK_INSERT:    arg |= I_INSERT; break;
+
+					case SDLK_F1: arg |= I_F1; break;
+					case SDLK_F2: arg |= I_F2; break;
+					case SDLK_F3: arg |= I_F3; break;
+					case SDLK_F4: arg |= I_F4; break;
+					case SDLK_F5: arg |= I_F5; break;
+					case SDLK_F6: arg |= I_F6; break;
+					case SDLK_F7: arg |= I_F7; break;
+					case SDLK_F8: arg |= I_F8; break;
+					case SDLK_F9: arg |= I_F9; break;
+					case SDLK_F10: arg |= I_F10; break;
+					case SDLK_F11: arg |= I_F11; break;
+					case SDLK_F12: arg |= I_F12; break;
+
+					case SDLK_KP_ENTER: arg |= I_ENTER; break;
+					case SDLK_KP0: arg |= '0'; break;
+					case SDLK_KP1: arg |= '1'; break;
+					case SDLK_KP2: arg |= '2'; break;
+					case SDLK_KP3: arg |= '3'; break;
+					case SDLK_KP4: arg |= '4'; break;
+					case SDLK_KP5: arg |= '5'; break;
+					case SDLK_KP6: arg |= '6'; break;
+					case SDLK_KP7: arg |= '7'; break;
+					case SDLK_KP8: arg |= '8'; break;
+					case SDLK_KP9: arg |= '9'; break;
+					case SDLK_KP_MULTIPLY: arg |= '*'; break;
+					case SDLK_KP_MINUS: arg |= '-'; break;
+					case SDLK_KP_PLUS: arg |= '+'; break;
+					case SDLK_KP_DIVIDE: arg |= '/'; break;
+
+					default: break;
+				}
+
+				input_callback( in, I_KEYDOWN, arg );
+				break;
+		}
+	}
+}
+

Devix
() автор топика
Ответ на: комментарий от Devix

+static int sdl_is_interlaced( void )
+{
+    return 0;
+}
+
+static void sdl_wait_for_sync( int field )
+{
+}
+
+static void sdl_lock_output( void )
+{
+	SDL_LockYUVOverlay(overlay);
+}
+
+static void sdl_unlock_output( void )
+{
+	SDL_UnlockYUVOverlay(overlay);
+}
+
+static int sdl_can_read_from_buffer( void )
+{
+    return 1;
+}
+
+static int sdl_is_overscan_supported( void )
+{
+    return 1;
+}
+
+int sdl_is_exposed( void )
+{
+	return 1;
+}
+
+int sdl_is_fullscreen_supported( void )
+{
+	return 1;
+}
+
+int sdl_is_fullscreen( void )
+{
+	return full_screen;
+}
+
+int sdl_toggle_fullscreen( int width, int height )
+{
+	if (SDL_WM_ToggleFullScreen(screen) == 1) {
+		full_screen = full_screen == 0 ? 1 : 0;
+		return 1;
+	}
+	else
+		return 0;
+}
+
+void sdl_set_window_caption( const char *caption )
+{
+	SDL_WM_SetCaption(caption, NULL);
+}
+
+int sdl_is_alwaysontop( void )
+{
+	return 0;
+}
+
+int sdl_is_alwaysontop_supported( void )
+{
+	return 0;
+}
+
+int sdl_toggle_aspect( void )
+{
+	return 0;
+}
+
+int sdl_toggle_alwaysontop( void )
+{
+	return 0;
+}
+
+void sdl_update_xawtv_station( int frequency, int channel_id,
+							   const char *channel_name )
+{
+}
+
+void sdl_update_server_time( unsigned long timestamp )
+{
+}
+
+void sdl_set_window_position( int x, int y )
+{
+}
+
+void sdl_set_window_height( int window_height )
+{
+}
+
+void sdl_set_fullscreen_position( int pos )
+{
+}
+
+void sdl_set_matte( int width, int height )
+{
+}
+
+static output_api_t sdloutput =
+{
+    sdl_init,
+
+    sdl_set_input_size,
+
+    sdl_lock_output,
+    sdl_get_output,
+    sdl_get_stride,
+    sdl_can_read_from_buffer,
+    sdl_unlock_output,
+
+    sdl_is_exposed,
+    sdl_get_visible_width,
+    sdl_get_visible_height,
+    sdl_is_fullscreen,
+    sdl_is_alwaysontop,
+
+    sdl_is_fullscreen_supported,
+    sdl_is_alwaysontop_supported,
+    sdl_is_overscan_supported,
+
+    sdl_is_interlaced,
+    sdl_wait_for_sync,
+    sdl_show_frame,
+
+    sdl_toggle_aspect,
+    sdl_toggle_alwaysontop,
+    sdl_toggle_fullscreen,
+    sdl_set_window_caption,
+    sdl_update_xawtv_station,
+    sdl_update_server_time,
+
+    sdl_set_window_position,
+    sdl_set_window_height,
+    sdl_set_fullscreen_position,
+    sdl_set_matte,
+
+    sdl_poll_events,
+    sdl_quit
+};
+
+output_api_t *get_sdl_output( void )
+{
+    return &sdloutput;
+}
+
+#else
+
+output_api_t *get_sdl_output( void )
+{
+    return 0;
+}
+
+#endif
+
diff -Naur tvtime-1.0.2.orig/src/sdloutput.h tvtime-1.0.2/src/sdloutput.h
--- tvtime-1.0.2.orig/src/sdloutput.h	1970-01-01 03:00:00.000000000 +0300
+++ tvtime-1.0.2/src/sdloutput.h	2008-03-13 21:40:21.000000000 +0300
@@ -0,0 +1,33 @@
+/**
+ * Copyright (C) 2008 Ildar Ismagilov <devix@pop3.ru>.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *

Devix
() автор топика
Ответ на: комментарий от Devix

+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef SDLOUTPUT_H_INCLUDED
+#define SDLOUTPUT_H_INCLUDED
+
+#include "outputapi.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+output_api_t *get_sdl_output( void );
+
+#ifdef __cplusplus
+};
+#endif
+#endif /* SDLOUTPUT_H_INCLUDED */
diff -Naur tvtime-1.0.2.orig/src/tvtime.c tvtime-1.0.2/src/tvtime.c
--- tvtime-1.0.2.orig/src/tvtime.c	2005-09-08 06:55:54.000000000 +0400
+++ tvtime-1.0.2/src/tvtime.c	2008-03-13 21:40:21.000000000 +0300
@@ -64,6 +64,7 @@
 #include "performance.h"
 #include "taglines.h"
 #include "xvoutput.h"
+#include "sdloutput.h"
 #include "vbidata.h"
 #include "vbiscreen.h"
 #include "videofilter.h"
@@ -1210,6 +1211,7 @@
     int quiet_screenshots = 0;
     char prevloc[ 256 ];
     int i;
+	int videoout;
 
     ct = config_new();
     if( !ct ) {
@@ -1238,7 +1240,19 @@
     send_fields = config_get_send_fields( ct );
 
     /* Setup the output. */
-    output = get_xv_output();
+	videoout = config_get_videoout( ct );
+	switch (videoout) {
+		case XV_VIDEO_OUT:
+			output = get_xv_output();
+			break;
+		case SDL_VIDEO_OUT:
+			output = get_sdl_output();
+			break;
+		default:
+			lfprintf( stderr, _("Invalid video out value: %d.\n"),  videoout);
+			return 1;
+	}
+
 
     sixteennine = config_get_aspect( ct );
 
diff -Naur tvtime-1.0.2.orig/src/tvtimeconf.c tvtime-1.0.2/src/tvtimeconf.c
--- tvtime-1.0.2.orig/src/tvtimeconf.c	2005-09-08 08:07:56.000000000 +0400
+++ tvtime-1.0.2/src/tvtimeconf.c	2008-03-13 21:40:21.000000000 +0300
@@ -58,6 +58,7 @@
     int aspect;
     int squarepixels;
     int debug;
+	int videoout;
     int fullscreen;
     int alwaysontop;
     int priority;
@@ -594,6 +595,7 @@
     lfputs( _("  -b, --vbidevice=DEVICE     VBI device (defaults to /dev/vbi0).\n"), stderr );
     lfputs( _("  -c, --channel=CHANNEL      Tune to the specified channel on startup.\n"), stderr );
     lfputs( _("  -d, --device=DEVICE        video4linux device (defaults to /dev/video0).\n"), stderr );
+    lfputs( _("  -o, --videoout=DRIVER      Video out driver: xv or sdl.\n"), stderr );
     lfputs( _("  -f, --frequencies=NAME     The frequency table to use for the tuner.\n"
               "                             (defaults to us-cable).\n\n"
               "                             Valid values are:\n"
@@ -714,6 +716,7 @@
     ct->aspect = 0;
     ct->squarepixels = 1;
     ct->debug = 0;
+    ct->videoout = XV_VIDEO_OUT;
     ct->fullscreen = 0;
     ct->alwaysontop = 0;
     ct->priority = -10;
@@ -880,6 +883,7 @@
         { "geometry", 1, 0, 'g' },
         { "saveoptions", 0, 0, 'S' },
         { "inputwidth", 1, 0, 'I' },
+        { "videoout", 1, 0, 'o' },
         { "driver", 1, 0, 'D' },
         { "input", 1, 0, 'i' },
         { "channel", 1, 0, 'c' },
@@ -907,7 +911,7 @@
     int c;
 
     if( argc ) {
-        while( (c = getopt_long( argc, argv, "aAhkmMsSvF:r:g:I:d:b:i:c:n:D:f:x:X:t:l:Qg:",
+        while( (c = getopt_long( argc, argv, "aAhkmMsSvF:r:g:I:d:b:i:c:n:D:o:f:x:X:t:l:Qg:",
                 long_options, &option_index )) != -1 ) {
             switch( c ) {
             case 'a': ct->aspect = 1; break;
@@ -918,6 +922,19 @@
             case 's': ct->debug = 1; break;
             case 'S': saveoptions = 1; break;
             case 'v': ct->verbose = 1; break;
+            case 'o': 
+					  if (strcmp(optarg, "xv") == 0)
+						  ct->videoout = XV_VIDEO_OUT;
+					  else if (strcmp(optarg, "sdl") == 0)
+						  ct->videoout = SDL_VIDEO_OUT;
+					  else {
+                          lfprintf
+                              ( stderr,
+                                _("Invalid video out value: %s\n"),
+                                optarg);
+						  return 0;
+					  }
+					  break;
             case 't': if( ct->xmltvfile ) { free( ct->xmltvfile ); }
                       ct->xmltvfile = expand_user_path( optarg ); break;
             case 'l': if( ct->xmltvlanguage ) { free( ct->xmltvlanguage ); }
@@ -1431,6 +1448,11 @@
     return ct->send_fields;
 }
 
+int config_get_videoout( config_t *ct )
+{
+    return ct->videoout;
+}
+
 int config_get_debug( config_t *ct )
 {
     return ct->debug;
diff -Naur tvtime-1.0.2.orig/src/tvtimeconf.h tvtime-1.0.2/src/tvtimeconf.h
--- tvtime-1.0.2.orig/src/tvtimeconf.h	2005-08-14 21:00:11.000000000 +0400
+++ tvtime-1.0.2/src/tvtimeconf.h	2008-03-13 21:40:21.000000000 +0300
@@ -27,6 +27,9 @@
 extern "C" {
 #endif
 
+#define XV_VIDEO_OUT 1
+#define SDL_VIDEO_OUT 2
+
 /**
  * The config object represents the data contained in the tvtime config
  * file and specified on the command line, and also provides an API for
@@ -163,6 +166,7 @@
 int config_get_fullscreen( config_t *ct );
 int config_get_alwaysontop( config_t *ct );
 int config_get_priority( config_t *ct );
+int config_get_videoout( config_t *ct );
 uid_t config_get_uid( config_t *ct );
 const char *config_get_deinterlace_method( config_t *ct );
 int config_get_start_channel( config_t *ct );

Devix
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.