diff options
Diffstat (limited to 'stream')
-rw-r--r-- | stream/stream_tv.c | 6 | ||||
-rw-r--r-- | stream/tv.c | 17 | ||||
-rw-r--r-- | stream/tv.h | 6 | ||||
-rw-r--r-- | stream/tvi_dshow.c | 39 | ||||
-rw-r--r-- | stream/tvi_v4l2.c | 78 |
5 files changed, 18 insertions, 128 deletions
diff --git a/stream/stream_tv.c b/stream/stream_tv.c index fb2090fd09..4bd373fd10 100644 --- a/stream/stream_tv.c +++ b/stream/stream_tv.c @@ -70,12 +70,6 @@ tv_param_t stream_tv_defaults = { 0, //hue 0, //saturation -1, //gain - { - NULL, //tdevice - 0, //tformat - 100, //tpage - 0, //tlang - }, 0, //scan_autostart 50, //scan_threshold 0.5, //scan_period diff --git a/stream/tv.c b/stream/tv.c index 3ce7264691..9ca0c72dcc 100644 --- a/stream/tv.c +++ b/stream/tv.c @@ -43,7 +43,6 @@ #include "libaf/af_format.h" #include "libmpcodecs/img_format.h" -#include "libmpcodecs/dec_teletext.h" #include "libavutil/avstring.h" #include "osdep/timer.h" @@ -380,8 +379,6 @@ int tv_set_norm(tvi_handle_t *tvh, char* norm) mp_tmsg(MSGT_TV, MSGL_ERR, "Error: Cannot set norm!\n"); return 0; } - teletext_control(tvh->demuxer->teletext,TV_VBI_CONTROL_RESET, - &tvh->tv_param->teletext); return 1; } @@ -395,8 +392,6 @@ static int tv_set_norm_i(tvi_handle_t *tvh, int norm) return 0; } - teletext_control(tvh->demuxer->teletext,TV_VBI_CONTROL_RESET, - &tvh->tv_param->teletext); return 1; } @@ -705,10 +700,6 @@ static demuxer_t* demux_open_tv(demuxer_t *demuxer) if (!tvh->functions->init(tvh->priv)) return NULL; tvh->demuxer = demuxer; - tvh->functions->control(tvh->priv,TVI_CONTROL_VBI_INIT, - &(tvh->tv_param->teletext.device)); - tvh->functions->control(tvh->priv,TVI_CONTROL_GET_VBI_PTR, - &demuxer->teletext); if (!open_tv(tvh)){ tv_uninit(tvh); @@ -850,9 +841,6 @@ no_audio: if(funcs->control(tvh->priv,TVI_CONTROL_VID_SET_GAIN,&tvh->tv_param->gain)!=TVI_CONTROL_TRUE) mp_msg(MSGT_TV,MSGL_WARN,"Unable to set gain control!\n"); - teletext_control(demuxer->teletext,TV_VBI_CONTROL_RESET, - &tvh->tv_param->teletext); - return demuxer; } @@ -863,7 +851,6 @@ static void demux_close_tv(demuxer_t *demuxer) tv_uninit(tvh); free(tvh); demuxer->priv=NULL; - demuxer->teletext=NULL; } int tv_set_color_options(tvi_handle_t *tvh, int opt, int value) @@ -932,8 +919,6 @@ int tv_set_freq(tvi_handle_t *tvh, unsigned long freq) mp_tmsg(MSGT_TV, MSGL_V, "Current frequency: %lu (%.3f)\n", freq, (float)freq/16); } - teletext_control(tvh->demuxer->teletext,TV_VBI_CONTROL_RESET, - &tvh->tv_param->teletext); return 1; } @@ -1114,8 +1099,6 @@ int tv_step_norm(tvi_handle_t *tvh) return 0; } } - teletext_control(tvh->demuxer->teletext,TV_VBI_CONTROL_RESET, - &tvh->tv_param->teletext); return 1; } diff --git a/stream/tv.h b/stream/tv.h index 6919fa20b8..699033664b 100644 --- a/stream/tv.h +++ b/stream/tv.h @@ -25,7 +25,6 @@ #ifndef MPLAYER_TV_H #define MPLAYER_TV_H -#include "libmpcodecs/dec_teletext.h" #include "libmpdemux/demuxer.h" typedef struct tv_param_s { @@ -65,7 +64,6 @@ typedef struct tv_param_s { int hue; int saturation; int gain; - struct tt_param teletext; int scan; int scan_threshold; @@ -222,10 +220,6 @@ typedef struct { #define TVI_CONTROL_SPC_SET_INPUT 0x402 /* set input channel (tv,s-video,composite..) */ #define TVI_CONTROL_SPC_GET_NORMID 0x403 /* get normid from norm name */ -//tvi_* ioctl (not dec_teletext.c !!!) -#define TVI_CONTROL_VBI_INIT 0x501 ///< vbi init -#define TVI_CONTROL_GET_VBI_PTR 0x502 ///< get teletext private pointer - int tv_set_color_options(tvi_handle_t *tvh, int opt, int val); int tv_get_color_options(tvi_handle_t *tvh, int opt, int* val); #define TV_COLOR_BRIGHTNESS 1 diff --git a/stream/tvi_dshow.c b/stream/tvi_dshow.c index 3e17d9cb99..2781c76032 100644 --- a/stream/tvi_dshow.c +++ b/stream/tvi_dshow.c @@ -76,7 +76,6 @@ #include <stdio.h> #include "libmpcodecs/img_format.h" -#include "libmpcodecs/dec_teletext.h" #include "libaf/af_format.h" #include "osdep/timer.h" @@ -201,6 +200,15 @@ typedef struct priv { tv_param_t* tv_param; ///< TV parameters } priv_t; +typedef struct tt_stream_props_s{ + int sampling_rate; + int samples_per_line; + int offset; + int count[2]; ///< number of lines in first and second fields + int interlaced; ///< vbi data are interlaced + int bufsize; ///< required buffer size +} tt_stream_props; + #include "tvi_def.h" /** @@ -2344,7 +2352,6 @@ static void vbi_grabber(priv_t* priv) buf=calloc(1,rb->blocksize); for(i=0; i<23 && rb->count; i++){ memcpy(buf,rb->ringbuffer[rb->head],rb->blocksize); - teletext_control(priv->priv_vbi,TV_VBI_CONTROL_DECODE_PAGE,&buf); rb->head = (rb->head + 1) % rb->buffersize; rb->count--; } @@ -2588,20 +2595,6 @@ static HRESULT build_vbi_chain(priv_t *priv) if(priv->chains[2]->rbuf) return S_OK; - if(priv->tv_param->teletext.device) - { - priv->chains[2]->rbuf=calloc(1,sizeof(grabber_ringbuffer_t)); - if(!priv->chains[2]->rbuf) - return E_OUTOFMEMORY; - - init_ringbuffer(priv->chains[2]->rbuf,24,priv->tsp.bufsize); - - hr=build_sub_graph(priv, priv->chains[2],&PIN_CATEGORY_VBI); - if(FAILED(hr)){ - mp_tmsg(MSGT_TV, MSGL_ERR, "tvi_dshow: Unable to build VBI chain of capture graph. Error:0x%x\n",(unsigned int)hr); - return 0; - } - } return S_OK; } @@ -3012,7 +3005,6 @@ static int uninit(priv_t * priv) if (priv->dwRegister) { RemoveFromRot(priv->dwRegister); } - teletext_control(priv->priv_vbi,TV_VBI_CONTROL_STOP,(void*)1); //stop audio grabber thread if (priv->state && priv->pMediaControl) { @@ -3517,19 +3509,6 @@ static int control(priv_t * priv, int cmd, void *arg) case TVI_CONTROL_IMMEDIATE: priv->immediate_mode = 1; return TVI_CONTROL_TRUE; - case TVI_CONTROL_VBI_INIT: - { - void* ptr; - ptr=&(priv->tsp); - if(teletext_control(NULL,TV_VBI_CONTROL_START,&ptr)==VBI_CONTROL_TRUE) - priv->priv_vbi=ptr; - else - priv->priv_vbi=NULL; - return TVI_CONTROL_TRUE; - } - case TVI_CONTROL_GET_VBI_PTR: - *(void **)arg=priv->priv_vbi; - return TVI_CONTROL_TRUE; } return TVI_CONTROL_UNKNOWN; } diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c index a3be9e799a..0490677961 100644 --- a/stream/tvi_v4l2.c +++ b/stream/tvi_v4l2.c @@ -57,7 +57,6 @@ known issues: #endif #include "mp_msg.h" #include "libmpcodecs/img_format.h" -#include "libmpcodecs/dec_teletext.h" #include "libaf/af_format.h" #include "tv.h" #include "audio_in.h" @@ -163,6 +162,15 @@ typedef struct priv { tv_param_t *tv_param; } priv_t; +typedef struct tt_stream_props_s{ + int sampling_rate; + int samples_per_line; + int offset; + int count[2]; ///< number of lines in first and second fields + int interlaced; ///< vbi data are interlaced + int bufsize; ///< required buffer size +} tt_stream_props; + #include "tvi_def.h" static void *audio_grabber(void *data); @@ -594,52 +602,6 @@ static int get_control(priv_t *priv, struct v4l2_control *control, int val_signe return TVI_CONTROL_TRUE; } -static int vbi_init(priv_t* priv,char* device) -{ - int vbi_fd=0; - struct v4l2_capability cap; - struct v4l2_format fmt; - int res; - - if(!device) - return TVI_CONTROL_FALSE; - - priv->vbi_dev=strdup(device); - - vbi_fd=open(priv->vbi_dev,O_RDWR); - if(vbi_fd<0){ - mp_msg(MSGT_TV,MSGL_ERR,"vbi: could not open device %s\n",priv->vbi_dev); - return TVI_CONTROL_FALSE; - } - - if(ioctl(vbi_fd,VIDIOC_QUERYCAP,&cap)<0){ - mp_msg(MSGT_TV,MSGL_ERR,"vbi: Query capabilities failed for %s\n",priv->vbi_dev); - close(vbi_fd); - return TVI_CONTROL_FALSE; - } - if(!(cap.capabilities & V4L2_CAP_VBI_CAPTURE)){ - mp_msg(MSGT_TV,MSGL_ERR,"vbi: %s does not support VBI capture\n",priv->vbi_dev); - close(vbi_fd); - return TVI_CONTROL_FALSE; - } - - memset(&fmt,0,sizeof(struct v4l2_format)); - fmt.type=V4L2_BUF_TYPE_VBI_CAPTURE; - if((res=ioctl(vbi_fd,VIDIOC_G_FMT,&fmt))<0){ - mp_msg(MSGT_TV,MSGL_ERR,"vbi: Query format failed: %x\n",res); - close(vbi_fd); - return TVI_CONTROL_FALSE; - } - if(fmt.fmt.vbi.sample_format!=V4L2_PIX_FMT_GREY){ - mp_msg(MSGT_TV,MSGL_ERR,"vbi: format 0x%x is not supported\n",fmt.fmt.vbi.sample_format); - close(vbi_fd); - return TVI_CONTROL_FALSE; - } - priv->vbi_fd=vbi_fd; - mp_msg(MSGT_TV,MSGL_DBG3,"vbi: init ok\n"); - return TVI_CONTROL_TRUE; -} - static int vbi_get_props(priv_t* priv,tt_stream_props* ptsp) { struct v4l2_format fmt; @@ -710,7 +672,6 @@ static void *vbi_grabber(void *data) seq=0; } prev_seq=seq; - teletext_control(priv->priv_vbi,TV_VBI_CONTROL_DECODE_PAGE,&buf); mp_msg(MSGT_TV,MSGL_DBG3,"grabber: seq:%d\n",seq); } free(buf); @@ -1034,26 +995,6 @@ static int control(priv_t *priv, int cmd, void *arg) if (audio_in_set_samplerate(&priv->audio_in, *(int*)arg) < 0) return TVI_CONTROL_FALSE; // setup_audio_buffer_sizes(priv); return TVI_CONTROL_TRUE; - case TVI_CONTROL_VBI_INIT: - { - void* ptr; - tt_stream_props tsp; - - if (vbi_init(priv,*(char**)arg)!=TVI_CONTROL_TRUE) - return TVI_CONTROL_FALSE; - if(vbi_get_props(priv,&tsp)==TVI_CONTROL_TRUE) - { - ptr=&tsp; - if(teletext_control(NULL,TV_VBI_CONTROL_START,&ptr)==VBI_CONTROL_TRUE) - priv->priv_vbi=ptr; - else - priv->priv_vbi=NULL; - } - return TVI_CONTROL_TRUE; - } - case TVI_CONTROL_GET_VBI_PTR: - *(void **)arg=priv->priv_vbi; - return TVI_CONTROL_TRUE; } mp_msg(MSGT_TV, MSGL_V, "%s: unknown control: %d\n", info.short_name, cmd); return TVI_CONTROL_UNKNOWN; @@ -1103,7 +1044,6 @@ static int uninit(priv_t *priv) if(priv->vbi_grabber_thread) pthread_join(priv->vbi_grabber_thread, NULL); - teletext_control(priv->priv_vbi,TV_VBI_CONTROL_STOP,(void*)1); priv->priv_vbi=NULL; if(priv->vbi_fd){ |