summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorcehoyos <cehoyos@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-11-07 12:31:05 +0000
committercehoyos <cehoyos@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-11-07 12:31:05 +0000
commit423c415534f7393c07247b87ab4d95f6d0635474 (patch)
treedd986257786302c543d7a1807b4c310d15883276 /stream
parent1698db0726e4b7c11f4dc47dfc823df5ab1cd80d (diff)
downloadmpv-423c415534f7393c07247b87ab4d95f6d0635474.tar.bz2
mpv-423c415534f7393c07247b87ab4d95f6d0635474.tar.xz
Separate teletext from tv support.
Path by Francesco Lavra, francescolavra interfree it git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29848 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/tv.c21
-rw-r--r--stream/tv.h10
-rw-r--r--stream/tvi_dshow.c7
-rw-r--r--stream/tvi_v4l.c5
-rw-r--r--stream/tvi_v4l2.c5
5 files changed, 31 insertions, 17 deletions
diff --git a/stream/tv.c b/stream/tv.c
index 7e7ba263fa..b27486d086 100644
--- a/stream/tv.c
+++ b/stream/tv.c
@@ -334,7 +334,8 @@ int tv_set_norm(tvi_handle_t *tvh, char* norm)
mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_CannotSetNorm);
return 0;
}
- tvh->functions->control(tvh->priv,TV_VBI_CONTROL_RESET,tvh->tv_param);
+ teletext_control(tvh->demuxer->teletext,TV_VBI_CONTROL_RESET,
+ &tvh->tv_param->teletext);
return 1;
}
@@ -348,7 +349,8 @@ int tv_set_norm_i(tvi_handle_t *tvh, int norm)
return 0;
}
- tvh->functions->control(tvh->priv,TV_VBI_CONTROL_RESET,tvh->tv_param);
+ teletext_control(tvh->demuxer->teletext,TV_VBI_CONTROL_RESET,
+ &tvh->tv_param->teletext);
return 1;
}
@@ -669,7 +671,11 @@ static demuxer_t* demux_open_tv(demuxer_t *demuxer)
if(!(tvh=tv_begin(demuxer->stream->priv))) return NULL;
if (!tvh->functions->init(tvh->priv)) return NULL;
- tvh->functions->control(tvh->priv,TVI_CONTROL_VBI_INIT,&(tvh->tv_param->tdevice));
+ 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);
@@ -812,7 +818,8 @@ 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");
- funcs->control(tvh->priv,TV_VBI_CONTROL_RESET,tvh->tv_param);
+ teletext_control(demuxer->teletext,TV_VBI_CONTROL_RESET,
+ &tvh->tv_param->teletext);
return demuxer;
}
@@ -893,7 +900,8 @@ int tv_set_freq(tvi_handle_t *tvh, unsigned long freq)
mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_CurrentFrequency,
freq, (float)freq/16);
}
- tvh->functions->control(tvh->priv,TV_VBI_CONTROL_RESET,tvh->tv_param);
+ teletext_control(tvh->demuxer->teletext,TV_VBI_CONTROL_RESET,
+ &tvh->tv_param->teletext);
return 1;
}
@@ -1074,7 +1082,8 @@ int tv_step_norm(tvi_handle_t *tvh)
return 0;
}
}
- tvh->functions->control(tvh->priv,TV_VBI_CONTROL_RESET,tvh->tv_param);
+ 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 abcbb0b680..48ff88ecc2 100644
--- a/stream/tv.h
+++ b/stream/tv.h
@@ -25,6 +25,9 @@
#ifndef MPLAYER_TV_H
#define MPLAYER_TV_H
+#include "libmpcodecs/dec_teletext.h"
+#include "libmpdemux/demuxer.h"
+
typedef struct tv_param_s {
char *freq;
char *channel;
@@ -62,10 +65,7 @@ typedef struct tv_param_s {
int hue;
int saturation;
int gain;
- char *tdevice; ///< teletext device
- int tformat; ///< teletext display format
- int tpage; ///< start teletext page
- int tlang; ///< primary language code
+ struct tt_param teletext;
int scan;
int scan_threshold;
@@ -125,6 +125,7 @@ typedef struct tvi_handle_s {
const tvi_functions_t *functions;
void *priv;
int seq;
+ demuxer_t *demuxer;
/* specific */
int norm;
@@ -220,6 +221,7 @@ typedef struct {
//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);
diff --git a/stream/tvi_dshow.c b/stream/tvi_dshow.c
index 28bf0a141f..40951a698e 100644
--- a/stream/tvi_dshow.c
+++ b/stream/tvi_dshow.c
@@ -2552,7 +2552,7 @@ static HRESULT build_vbi_chain(priv_t *priv)
if(priv->chains[2]->rbuf)
return S_OK;
- if(priv->tv_param->tdevice)
+ if(priv->tv_param->teletext.device)
{
priv->chains[2]->rbuf=calloc(1,sizeof(grabber_ringbuffer_t));
if(!priv->chains[2]->rbuf)
@@ -3493,8 +3493,9 @@ static int control(priv_t * priv, int cmd, void *arg)
priv->priv_vbi=NULL;
return TVI_CONTROL_TRUE;
}
- default:
- return teletext_control(priv->priv_vbi,cmd,arg);
+ case TVI_CONTROL_GET_VBI_PTR:
+ *(void **)arg=priv->priv_vbi;
+ return TVI_CONTROL_TRUE;
#endif
}
return TVI_CONTROL_UNKNOWN;
diff --git a/stream/tvi_v4l.c b/stream/tvi_v4l.c
index a674722ec3..eb09610d34 100644
--- a/stream/tvi_v4l.c
+++ b/stream/tvi_v4l.c
@@ -1530,8 +1530,9 @@ static int control(priv_t *priv, int cmd, void *arg)
}
return TVI_CONTROL_TRUE;
}
- default:
- return teletext_control(priv->priv_vbi,cmd,arg);
+ case TVI_CONTROL_GET_VBI_PTR:
+ *(void **)arg=priv->priv_vbi;
+ return TVI_CONTROL_TRUE;
#endif
}
diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c
index a47ea11400..fe2789e24d 100644
--- a/stream/tvi_v4l2.c
+++ b/stream/tvi_v4l2.c
@@ -1057,8 +1057,9 @@ static int control(priv_t *priv, int cmd, void *arg)
}
return TVI_CONTROL_TRUE;
}
- default:
- return teletext_control(priv->priv_vbi,cmd,arg);
+ 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);