diff options
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) { |