diff options
author | voroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-08-23 16:09:30 +0000 |
---|---|---|
committer | voroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-08-23 16:09:30 +0000 |
commit | f1fbca4bdd35b7ceb636dac0b979fa1acca9e609 (patch) | |
tree | c04e7a27a93c5e0600527963875dc00590c177e3 /stream/tvi_v4l2.c | |
parent | ffac6ce7eba3dea5878f3eb482a11e9ab7606455 (diff) | |
download | mpv-f1fbca4bdd35b7ceb636dac0b979fa1acca9e609.tar.bz2 mpv-f1fbca4bdd35b7ceb636dac0b979fa1acca9e609.tar.xz |
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
Diffstat (limited to 'stream/tvi_v4l2.c')
-rw-r--r-- | stream/tvi_v4l2.c | 8 |
1 files changed, 8 insertions, 0 deletions
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) { |