From f1fbca4bdd35b7ceb636dac0b979fa1acca9e609 Mon Sep 17 00:00:00 2001 From: voroshil Date: Thu, 23 Aug 2007 16:09:30 +0000 Subject: Automatic TV channels scanning ability for MPlayer. Code is based on patch from Otvos Attila oattila at chello dot hu git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24125 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/tvi_v4l2.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'stream/tvi_v4l2.c') diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c index d808cc6838..10c92b3163 100644 --- a/stream/tvi_v4l2.c +++ b/stream/tvi_v4l2.c @@ -864,6 +864,14 @@ static int control(priv_t *priv, int cmd, void *arg) case TVI_CONTROL_TUN_GET_NORM: *(int *)arg = priv->standard.index; return TVI_CONTROL_TRUE; + case TVI_CONTROL_TUN_GET_SIGNAL: + if (ioctl(priv->video_fd, VIDIOC_G_TUNER, &priv->tuner) < 0) { + mp_msg(MSGT_TV, MSGL_ERR, "%s: ioctl get tuner failed: %s\n", + info.short_name, strerror(errno)); + return TVI_CONTROL_FALSE; + } + *(int*)arg=100*(priv->tuner.signal>>8)/255; + return TVI_CONTROL_TRUE; case TVI_CONTROL_TUN_SET_NORM: priv->standard.index = *(int *)arg; if (ioctl(priv->video_fd, VIDIOC_ENUMSTD, &priv->standard) < 0) { -- cgit v1.2.3