summaryrefslogtreecommitdiffstats
path: root/stream/tvi_v4l2.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream/tvi_v4l2.c')
-rw-r--r--stream/tvi_v4l2.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c
index 786d42529e..1472d7b6d9 100644
--- a/stream/tvi_v4l2.c
+++ b/stream/tvi_v4l2.c
@@ -53,6 +53,7 @@ known issues:
#include <linux/videodev2.h>
#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"
@@ -88,14 +89,12 @@ typedef struct {
/* 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;
@@ -591,7 +590,6 @@ static int get_control(priv_t *priv, struct v4l2_control *control, int val_signe
return TVI_CONTROL_TRUE;
}
-#ifdef CONFIG_TV_TELETEXT
static int vbi_init(priv_t* priv,char* device)
{
int vbi_fd=0;
@@ -714,7 +712,6 @@ static void *vbi_grabber(void *data)
free(buf);
return NULL;
}
-#endif /* CONFIG_TV_TELETEXT */
static int control(priv_t *priv, int cmd, void *arg)
{
@@ -1038,7 +1035,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;
-#ifdef CONFIG_TV_TELETEXT
case TVI_CONTROL_VBI_INIT:
{
void* ptr;
@@ -1049,16 +1045,16 @@ static int control(priv_t *priv, int cmd, void *arg)
if(vbi_get_props(priv,&tsp)==TVI_CONTROL_TRUE)
{
ptr=&tsp;
- if(teletext_control(NULL,TV_VBI_CONTROL_START,&ptr)==TVI_CONTROL_TRUE)
+ 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;
}
- default:
- return teletext_control(priv->priv_vbi,cmd,arg);
-#endif
+ 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;
@@ -1105,7 +1101,6 @@ static int uninit(priv_t *priv)
{
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);
@@ -1122,9 +1117,6 @@ static int uninit(priv_t *priv)
free(priv->vbi_dev);
priv->vbi_dev=0;
}
-
-#endif
-
priv->shutdown = 1;
if(priv->video_grabber_thread)
pthread_join(priv->video_grabber_thread, NULL);
@@ -1560,13 +1552,11 @@ static int start(priv_t *priv)
}
}
-#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;