changeset 29809:e255f9571156

Remove CONFIG_TV_TELETEXT. DVB teletext support is nearly finished, it will be possible to read teletext from file, it will not be depending on reception any more.
author cehoyos
date Sat, 07 Nov 2009 16:40:42 +0000
parents 97594e5387c8
children c540d350f7ab
files Makefile cfg-common.h command.c configure input/input.c libmpcodecs/dec_teletext.h libvo/sub.c mpcommon.c stream/tvi_dshow.c stream/tvi_v4l.c stream/tvi_v4l2.c
diffstat 11 files changed, 1 insertions(+), 93 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Sat Nov 07 13:09:24 2009 +0000
+++ b/Makefile	Sat Nov 07 16:40:42 2009 +0000
@@ -272,7 +272,6 @@
                                         stream/frequencies.c stream/tvi_dummy.c
 SRCS_COMMON-$(TV_BSDBT848)           += stream/tvi_bsdbt848.c
 SRCS_COMMON-$(TV_DSHOW)              += stream/tvi_dshow.c
-SRCS_COMMON-$(TV_TELETEXT)           += libmpcodecs/dec_teletext.c
 SRCS_COMMON-$(TV_V4L1)               += stream/tvi_v4l.c  stream/audio_in.c
 SRCS_COMMON-$(TV_V4L2)               += stream/tvi_v4l2.c stream/audio_in.c
 SRCS_COMMON-$(UNRAR_EXEC)            += unrar_exec.c
@@ -378,6 +377,7 @@
               libmpcodecs/ad_msgsm.c \
               libmpcodecs/ad_pcm.c \
               libmpcodecs/dec_audio.c \
+              libmpcodecs/dec_teletext.c \
               libmpcodecs/dec_video.c \
               libmpcodecs/img_format.c \
               libmpcodecs/mp_image.c \
--- a/cfg-common.h	Sat Nov 07 13:09:24 2009 +0000
+++ b/cfg-common.h	Sat Nov 07 16:40:42 2009 +0000
@@ -125,12 +125,10 @@
 #endif /* CONFIG_ALSA */
 #endif /* defined(CONFIG_TV_V4L) || defined(CONFIG_TV_V4L2) */
 	{"adevice", &stream_tv_defaults.adevice, CONF_TYPE_STRING, 0, 0, 0, NULL},
-#ifdef CONFIG_TV_TELETEXT
 	{"tdevice", &stream_tv_defaults.teletext.device, CONF_TYPE_STRING, 0, 0, 0, NULL},
 	{"tpage", &stream_tv_defaults.teletext.page, CONF_TYPE_INT, CONF_RANGE, 100, 899, NULL},
 	{"tformat", &stream_tv_defaults.teletext.format, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL},
 	{"tlang", &stream_tv_defaults.teletext.lang, CONF_TYPE_INT, CONF_RANGE, -1, 0x7f, NULL},
-#endif /* CONFIG_TV_TELETEXT */
 	{"audioid", &stream_tv_defaults.audio_id, CONF_TYPE_INT, CONF_RANGE, 0, 9, NULL},
 #ifdef CONFIG_TV_DSHOW
 	{"hidden_video_renderer", &stream_tv_defaults.hidden_video_renderer, CONF_TYPE_FLAG, 0, 0, 1, NULL},
--- a/command.c	Sat Nov 07 13:09:24 2009 +0000
+++ b/command.c	Sat Nov 07 16:40:42 2009 +0000
@@ -1878,7 +1878,6 @@
 
 #endif
 
-#ifdef CONFIG_TV_TELETEXT
 static int mp_property_teletext_common(m_option_t * prop, int action, void *arg,
                   MPContext * mpctx)
 {
@@ -1959,9 +1958,6 @@
     return result;
 }
 
-
-#endif /* CONFIG_TV_TELETEXT */
-
 ///@}
 
 /// All properties available in MPlayer.
@@ -2114,8 +2110,6 @@
     { "tv_hue", mp_property_tv_color, CONF_TYPE_INT,
      M_OPT_RANGE, -100, 100, (void *) TV_COLOR_HUE },
 #endif
-
-#ifdef CONFIG_TV_TELETEXT
     { "teletext_page", mp_property_teletext_page, CONF_TYPE_INT,
      M_OPT_RANGE, 100, 899,  (void*)TV_VBI_CONTROL_GET_PAGE },
     { "teletext_subpage", mp_property_teletext_common, CONF_TYPE_INT,
@@ -2126,8 +2120,6 @@
      M_OPT_RANGE, 0, 3, (void*)TV_VBI_CONTROL_GET_FORMAT },
     { "teletext_half_page", mp_property_teletext_common, CONF_TYPE_INT,
      M_OPT_RANGE, 0, 2, (void*)TV_VBI_CONTROL_GET_HALF_PAGE },
-#endif
-
     { NULL, NULL, NULL, 0, 0, 0, NULL }
 };
 
@@ -2870,7 +2862,6 @@
 		tv_step_chanlist((tvi_handle_t *) (mpctx->demuxer->priv));
 	    break;
 #endif /* CONFIG_TV */
-#ifdef CONFIG_TV_TELETEXT
 	case MP_CMD_TV_TELETEXT_ADD_DEC:
 	{
 	    if (mpctx->demuxer->teletext)
@@ -2885,7 +2876,6 @@
 	                         &(cmd->args[0].v.i));
 	    break;
 	}
-#endif /* CONFIG_TV_TELETEXT */
 
 	case MP_CMD_SUB_LOAD:
 	    if (sh_video) {
--- a/configure	Sat Nov 07 13:09:24 2009 +0000
+++ b/configure	Sat Nov 07 16:40:42 2009 +0000
@@ -248,7 +248,6 @@
   --disable-tv-v4l1      disable Video4Linux TV interface [autodetect]
   --disable-tv-v4l2      disable Video4Linux2 TV interface [autodetect]
   --disable-tv-bsdbt848  disable BSD BT848 interface [autodetect]
-  --disable-tv-teletext  disable TV teletext interface [autodetect]
   --disable-pvr          disable Video4Linux2 MPEG PVR [autodetect]
   --disable-rtc          disable RTC (/dev/rtc) on Linux [autodetect]
   --disable-network      disable networking [enable]
@@ -668,7 +667,6 @@
 _tv_v4l2=auto
 _tv_bsdbt848=auto
 _tv_dshow=auto
-_tv_teletext=auto
 _pvr=auto
 _network=yes
 _winsock2_h=auto
@@ -1092,8 +1090,6 @@
   --disable-tv-v4l2)	_tv_v4l2=no	;;
   --enable-tv-dshow)	_tv_dshow=yes	;;
   --disable-tv-dshow)	_tv_dshow=no	;;
-  --enable-tv-teletext)    _tv_teletext=yes        ;;
-  --disable-tv-teletext)    _tv_teletext=no        ;;
   --enable-radio)       _radio=yes	;;
   --enable-radio-capture)       _radio_capture=yes	;;
   --disable-radio-capture)       _radio_capture=no	;;
@@ -7616,25 +7612,6 @@
 echores "$_tv_v4l2"
 
 
-echocheck "TV teletext interface"
-if test "$_tv_teletext" = auto ; then
-  _tv_teletext=no
-  if test "$_freetype" = yes && test "$_pthreads" = yes; then
-    if test "$_tv_v4l2" = yes || test "$_v4l" = yes || test "$_tv_dshow" = yes || test "$_dvbin" = yes; then
-      _tv_teletext=yes
-    fi
-  fi
-fi
-if test "$_tv_teletext" = yes ; then
-  def_tv_teletext='#define CONFIG_TV_TELETEXT 1'
-  _inputmodules="tv-teletext $_inputmodules"
-else
-  _noinputmodules="tv-teletext $_noinputmodules"
-  def_tv_teletext='#undef CONFIG_TV_TELETEXT'
-fi
-echores "$_tv_teletext"
-
-
 echocheck "Radio interface"
 if test "$_radio" = yes ; then
   def_radio='#define CONFIG_RADIO 1'
@@ -8352,7 +8329,6 @@
 TV = $_tv
 TV_BSDBT848 = $_tv_bsdbt848
 TV_DSHOW = $_tv_dshow
-TV_TELETEXT = $_tv_teletext
 TV_V4L  = $_tv_v4l
 TV_V4L1 = $_tv_v4l1
 TV_V4L2 = $_tv_v4l2
@@ -8749,7 +8725,6 @@
 $def_tv
 $def_tv_bsdbt848
 $def_tv_dshow
-$def_tv_teletext
 $def_tv_v4l
 $def_tv_v4l1
 $def_tv_v4l2
--- a/input/input.c	Sat Nov 07 13:09:24 2009 +0000
+++ b/input/input.c	Sat Nov 07 16:40:42 2009 +0000
@@ -172,10 +172,8 @@
   { MP_CMD_LOADLIST, "loadlist", 1, { {MP_CMD_ARG_STRING, {0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
   { MP_CMD_RUN, "run", 1, { {MP_CMD_ARG_STRING,{0}}, {-1,{0}} } },
   { MP_CMD_VF_CHANGE_RECTANGLE, "change_rectangle", 2, { {MP_CMD_ARG_INT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}}}},
-#ifdef CONFIG_TV_TELETEXT
   { MP_CMD_TV_TELETEXT_ADD_DEC, "teletext_add_dec", 1, { {MP_CMD_ARG_STRING,{0}}, {-1,{0}} } },
   { MP_CMD_TV_TELETEXT_GO_LINK, "teletext_go_link", 1, { {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
-#endif
 
 #ifdef CONFIG_GUI
   { MP_CMD_GUI_LOADFILE, "gui_loadfile", 0, { {-1,{0}} } },
@@ -439,11 +437,9 @@
   { { 'n', 0 }, "tv_step_norm" },
   { { 'u', 0 }, "tv_step_chanlist" },
 #endif
-#ifdef CONFIG_TV_TELETEXT
   { { 'X', 0 }, "step_property teletext_mode 1" },
   { { 'W', 0 }, "step_property teletext_page 1" },
   { { 'Q', 0 }, "step_property teletext_page -1" },
-#endif
 #ifdef CONFIG_JOYSTICK
   { { JOY_AXIS0_PLUS, 0 }, "seek 10" },
   { { JOY_AXIS0_MINUS, 0 }, "seek -10" },
--- a/libmpcodecs/dec_teletext.h	Sat Nov 07 13:09:24 2009 +0000
+++ b/libmpcodecs/dec_teletext.h	Sat Nov 07 16:40:42 2009 +0000
@@ -34,11 +34,7 @@
 #define VBI_CONTROL_TRUE               1
 #define VBI_CONTROL_UNKNOWN           -1
 
-#ifdef CONFIG_TV_TELETEXT
 int teletext_control(void* p, int cmd, void *arg);
-#else
-#define teletext_control(p, cmd, arg) VBI_CONTROL_FALSE
-#endif
 
 /*
   TELETEXT controls (through teletext_control() )
--- a/libvo/sub.c	Sat Nov 07 13:09:24 2009 +0000
+++ b/libvo/sub.c	Sat Nov 07 16:40:42 2009 +0000
@@ -86,13 +86,11 @@
 font_desc_t* sub_font=NULL;
 
 unsigned char* vo_osd_text=NULL;
-#ifdef CONFIG_TV_TELETEXT
 void* vo_osd_teletext_page=NULL;
 int vo_osd_teletext_half = 0;
 int vo_osd_teletext_mode=0;
 int vo_osd_teletext_format=0;
 int vo_osd_teletext_scale=0;
-#endif
 int sub_unicode=0;
 int sub_utf8=0;
 int sub_pos=100;
@@ -274,7 +272,6 @@
 }
 #endif
 
-#ifdef CONFIG_TV_TELETEXT
 // renders char to a big per-object buffer where alpha and bitmap are separated
 static void tt_draw_alpha_buf(mp_osd_obj_t* obj, int x0,int y0, int w,int h, unsigned char* src, int stride,int fg,int bg,int alpha)
 {
@@ -516,7 +513,6 @@
     for(i=0;i<9;i++)
         free(buf[i]);
 }
-#endif
 
 int vo_osd_progbar_type=-1;
 int vo_osd_progbar_value=100;   // 0..256
@@ -1154,11 +1150,9 @@
 	case OSDTYPE_SUBTITLE:
 	    vo_update_text_sub(obj,dxs,dys);
 	    break;
-#ifdef CONFIG_TV_TELETEXT
 	case OSDTYPE_TELETEXT:
 	    vo_update_text_teletext(obj,dxs,dys);
 	    break;
-#endif
 	case OSDTYPE_PROGBAR:
 	    vo_update_text_progbar(obj,dxs,dys);
 	    break;
@@ -1230,9 +1224,7 @@
 #ifdef CONFIG_DVDNAV
     new_osd_obj(OSDTYPE_DVDNAV);
 #endif
-#ifdef CONFIG_TV_TELETEXT
     new_osd_obj(OSDTYPE_TELETEXT);
-#endif
 #ifdef CONFIG_FREETYPE
     force_load_font = 1;
 #endif
@@ -1273,9 +1265,7 @@
 #ifdef CONFIG_DVDNAV
         case OSDTYPE_DVDNAV:
 #endif
-#ifdef CONFIG_TV_TELETEXT
 	case OSDTYPE_TELETEXT:
-#endif
 	case OSDTYPE_OSD:
 	case OSDTYPE_SUBTITLE:
 	case OSDTYPE_PROGBAR:
--- a/mpcommon.c	Sat Nov 07 13:09:24 2009 +0000
+++ b/mpcommon.c	Sat Nov 07 16:40:42 2009 +0000
@@ -207,7 +207,6 @@
 
 void update_teletext(sh_video_t *sh_video, demuxer_t *demuxer, int reset)
 {
-#ifdef CONFIG_TV_TELETEXT
     int page_changed;
 
     if (!demuxer->teletext)
@@ -231,7 +230,6 @@
     vo_osd_changed(OSDTYPE_TELETEXT);
 
     teletext_control(demuxer->teletext,TV_VBI_CONTROL_MARK_UNCHANGED,NULL);
-#endif
 }
 
 int select_audio(demuxer_t* demuxer, int audio_id, char* audio_lang)
--- a/stream/tvi_dshow.c	Sat Nov 07 13:09:24 2009 +0000
+++ b/stream/tvi_dshow.c	Sat Nov 07 16:40:42 2009 +0000
@@ -2264,7 +2264,6 @@
     return priv->chains[1]->rbuf->blocksize;
 }
 
-#ifdef CONFIG_TV_TELETEXT
 static int vbi_get_props(priv_t* priv,tt_stream_props* ptsp)
 {
     if(!priv || !ptsp)
@@ -2310,7 +2309,6 @@
     }
     free(buf);
 }
-#endif /* CONFIG_TV_TELETEXT */
 
 /**
  * \brief fills given buffer with video data (usually one frame)
@@ -2355,9 +2353,7 @@
       rb->count--;
     LeaveCriticalSection(rb->pMutex);
 
-#ifdef CONFIG_TV_TELETEXT
     vbi_grabber(priv);
-#endif
     return pts;
 }
 
@@ -2546,7 +2542,6 @@
  */
 static HRESULT build_vbi_chain(priv_t *priv)
 {
-#ifdef CONFIG_TV_TELETEXT
     HRESULT hr;
 
     if(priv->chains[2]->rbuf)
@@ -2566,7 +2561,6 @@
             return 0;
         }
     }
-#endif
     return S_OK;
 }
 
@@ -2902,10 +2896,8 @@
             OLE_QUERYINTERFACE(priv->pBuilder,IID_IBaseFilter,pBF);
             OLE_CALL_ARGS(pBF,SetSyncSource,rc);
         }
-#ifdef CONFIG_TV_TELETEXT
        if(vbi_get_props(priv,&(priv->tsp))!=TVI_CONTROL_TRUE)
            break;
-#endif
         result = 1;
     } while(0);
 
@@ -2975,9 +2967,7 @@
     if (priv->dwRegister) {
         RemoveFromRot(priv->dwRegister);
     }
-#ifdef CONFIG_TV_TELETEXT
     teletext_control(priv->priv_vbi,TV_VBI_CONTROL_STOP,(void*)1);
-#endif
     //stop audio grabber thread
 
     if (priv->state && priv->pMediaControl) {
@@ -3482,7 +3472,6 @@
     case TVI_CONTROL_IMMEDIATE:
 	priv->immediate_mode = 1;
 	return TVI_CONTROL_TRUE;
-#ifdef CONFIG_TV_TELETEXT
     case TVI_CONTROL_VBI_INIT:
     {
         void* ptr;
@@ -3496,7 +3485,6 @@
     case TVI_CONTROL_GET_VBI_PTR:
         *(void **)arg=priv->priv_vbi;
         return TVI_CONTROL_TRUE;
-#endif
     }
     return TVI_CONTROL_UNKNOWN;
 }
--- a/stream/tvi_v4l.c	Sat Nov 07 13:09:24 2009 +0000
+++ b/stream/tvi_v4l.c	Sat Nov 07 16:40:42 2009 +0000
@@ -142,14 +142,12 @@
     long                        audio_recv_blocks_total;
     long                        audio_sent_blocks_total;
     long                        mjpeg_bufsize;
-#ifdef CONFIG_TV_TELETEXT
     char                        *vbi_dev;
     int                         vbi_fd;
     int                         vbi_bufsize;
     int                         vbi_shutdown;
     pthread_t                   vbi_grabber_thread;
     void                        *priv_vbi;
-#endif
 
     tv_param_t                  *tv_param;
 } priv_t;
@@ -676,7 +674,6 @@
 {
     unsigned long num;
 
-#ifdef CONFIG_TV_TELETEXT
     priv->vbi_shutdown=1;
     if(priv->vbi_grabber_thread)
         pthread_join(priv->vbi_grabber_thread, NULL);
@@ -694,8 +691,6 @@
         priv->vbi_dev=0;
     }
 
-#endif
-
     priv->shutdown = 1;
 
     mp_msg(MSGT_TV, MSGL_V, "Waiting for threads to finish... ");
@@ -782,7 +777,6 @@
     return cnt;
 }
 
-#ifdef CONFIG_TV_TELETEXT
 static int vbi_init(priv_t* priv,char* device)
 {
     int vbi_fd=0;
@@ -898,7 +892,6 @@
     free(buf);
     return NULL;
 }
-#endif /* CONFIG_TV_TELETEXT */
 
 static int start(priv_t *priv)
 {
@@ -1112,13 +1105,11 @@
         ioctl(priv->video_fd, VIDIOCSAUDIO, &priv->audio[priv->audio_id]);
     }
 
-#ifdef CONFIG_TV_TELETEXT
     /* start vbi thread */
     if(priv->priv_vbi){
         priv->vbi_shutdown = 0;
         pthread_create(&priv->vbi_grabber_thread, NULL, vbi_grabber, priv);
     }
-#endif
 
     /* launch capture threads */
     priv->shutdown = 0;
@@ -1512,7 +1503,6 @@
             priv->immediate_mode = 1;
             return TVI_CONTROL_TRUE;
         }
-#ifdef CONFIG_TV_TELETEXT
         case TVI_CONTROL_VBI_INIT:
         {
             void* ptr;
@@ -1533,7 +1523,6 @@
         case TVI_CONTROL_GET_VBI_PTR:
             *(void **)arg=priv->priv_vbi;
             return TVI_CONTROL_TRUE;
-#endif
     }
 
     return TVI_CONTROL_UNKNOWN;
--- a/stream/tvi_v4l2.c	Sat Nov 07 13:09:24 2009 +0000
+++ b/stream/tvi_v4l2.c	Sat Nov 07 16:40:42 2009 +0000
@@ -89,14 +89,12 @@
     /* video */
     char                        *video_dev;
     int                         video_fd;
-#ifdef CONFIG_TV_TELETEXT
     char                        *vbi_dev;
     int                         vbi_fd;
     int                         vbi_bufsize;
     int                         vbi_shutdown;
     pthread_t                   vbi_grabber_thread;
     void                        *priv_vbi;
-#endif
     int                         mp_format;
     struct v4l2_capability      capability;
     struct v4l2_input           input;
@@ -592,7 +590,6 @@
     return TVI_CONTROL_TRUE;
 }
 
-#ifdef CONFIG_TV_TELETEXT
 static int vbi_init(priv_t* priv,char* device)
 {
     int vbi_fd=0;
@@ -715,7 +712,6 @@
     free(buf);
     return NULL;
 }
-#endif /* CONFIG_TV_TELETEXT */
 
 static int control(priv_t *priv, int cmd, void *arg)
 {
@@ -1039,7 +1035,6 @@
         if (audio_in_set_samplerate(&priv->audio_in, *(int*)arg) < 0) return TVI_CONTROL_FALSE;
 //        setup_audio_buffer_sizes(priv);
         return TVI_CONTROL_TRUE;
-#ifdef CONFIG_TV_TELETEXT
     case TVI_CONTROL_VBI_INIT:
     {
         void* ptr;
@@ -1060,7 +1055,6 @@
     case TVI_CONTROL_GET_VBI_PTR:
         *(void **)arg=priv->priv_vbi;
         return TVI_CONTROL_TRUE;
-#endif
     }
     mp_msg(MSGT_TV, MSGL_V, "%s: unknown control: %d\n", info.short_name, cmd);
     return TVI_CONTROL_UNKNOWN;
@@ -1107,7 +1101,6 @@
 {
     int i, frames, dropped = 0;
 
-#ifdef CONFIG_TV_TELETEXT
     priv->vbi_shutdown=1;
     if(priv->vbi_grabber_thread)
         pthread_join(priv->vbi_grabber_thread, NULL);
@@ -1124,9 +1117,6 @@
         free(priv->vbi_dev);
 	priv->vbi_dev=0;
     }
-
-#endif
-
     priv->shutdown = 1;
     if(priv->video_grabber_thread)
         pthread_join(priv->video_grabber_thread, NULL);
@@ -1562,13 +1552,11 @@
         }
     }
 
-#ifdef CONFIG_TV_TELETEXT
     /* start vbi thread */
     if(priv->priv_vbi){
         priv->vbi_shutdown = 0;
         pthread_create(&priv->vbi_grabber_thread, NULL, vbi_grabber, priv);
     }
-#endif
     /* start audio thread */
     priv->shutdown = 0;
     priv->audio_skew_measure_time = 0;