diff --git a/v4l2.c b/v4l2.c index ee833c12..c1badd79 100644 --- a/v4l2.c +++ b/v4l2.c @@ -629,6 +629,54 @@ print_v4l2_control(struct tcb *const tcp, const kernel_ulong_t arg, return 1; } +#include "xlat/v4l2_tuner_types.h" +#include "xlat/v4l2_tuner_capabilities.h" +#include "xlat/v4l2_tuner_rxsubchanses.h" +#include "xlat/v4l2_tuner_audmodes.h" + +static int +print_v4l2_tuner(struct tcb *const tcp, const kernel_ulong_t arg, + const bool is_get) +{ + struct v4l2_tuner c; + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &c)) + return RVAL_DECODED | 1; + tprintf("{index=%u", c.index); + if (is_get) + return 0; + tprints(", "); + } else { + if (syserror(tcp) || umove(tcp, arg, &c) < 0) { + tprints("}"); + return 1; + } + tprints(is_get ? ", " : " => "); + } + + tprints("name="); + print_quoted_string((const char *) c.name, sizeof(c.name), + QUOTE_0_TERMINATED); + tprints(", type="); + printxval(v4l2_tuner_types, c.type, "V4L2_TUNER_TYPE_???"); + tprints(", capability="); + printxval(v4l2_tuner_capabilities, c.capability, + "V4L2_TUNER_CAP_???"); + tprintf(", rangelow=%u, rangehigh=%u, rxsubchans=", + c.rangelow, c.rangehigh); + printxval(v4l2_tuner_rxsubchanses, c.rxsubchans, + "V4L2_TUNER_SUB_???"); + tprints(", audmode="); + printxval(v4l2_tuner_audmodes, c.audmode, + "V4L2_TUNER_MODE_???"); + tprintf(", signal=%d, afc=%d", c.signal, c.afc); + + if (exiting(tcp)) + tprints("}"); + return 1; +} + #include "xlat/v4l2_control_types.h" #include "xlat/v4l2_control_flags.h" @@ -971,6 +1019,10 @@ MPERS_PRINTER_DECL(int, v4l2_ioctl, struct tcb *const tcp, case VIDIOC_S_CTRL: /* RW */ return print_v4l2_control(tcp, arg, code == VIDIOC_G_CTRL); + case VIDIOC_G_TUNER: /* RW */ + case VIDIOC_S_TUNER: /* RW */ + return print_v4l2_tuner(tcp, arg, code == VIDIOC_G_TUNER); + case VIDIOC_QUERYCTRL: /* RW */ return print_v4l2_queryctrl(tcp, arg); diff --git a/xlat/v4l2_tuner_audmodes.in b/xlat/v4l2_tuner_audmodes.in new file mode 100644 index 00000000..82decabf --- /dev/null +++ b/xlat/v4l2_tuner_audmodes.in @@ -0,0 +1,6 @@ +V4L2_TUNER_MODE_MONO +V4L2_TUNER_MODE_STEREO +V4L2_TUNER_MODE_LANG2 +V4L2_TUNER_MODE_SAP +V4L2_TUNER_MODE_LANG1 +V4L2_TUNER_MODE_LANG1_LANG2 diff --git a/xlat/v4l2_tuner_capabilities.in b/xlat/v4l2_tuner_capabilities.in new file mode 100644 index 00000000..4aec41eb --- /dev/null +++ b/xlat/v4l2_tuner_capabilities.in @@ -0,0 +1,14 @@ +V4L2_TUNER_CAP_LOW +V4L2_TUNER_CAP_NORM +V4L2_TUNER_CAP_HWSEEK_BOUNDED +V4L2_TUNER_CAP_HWSEEK_WRAP +V4L2_TUNER_CAP_STEREO +V4L2_TUNER_CAP_LANG2 +V4L2_TUNER_CAP_SAP +V4L2_TUNER_CAP_LANG1 +V4L2_TUNER_CAP_RDS +V4L2_TUNER_CAP_RDS_BLOCK_IO +V4L2_TUNER_CAP_RDS_CONTROLS +V4L2_TUNER_CAP_FREQ_BANDS +V4L2_TUNER_CAP_HWSEEK_PROG_LIM +V4L2_TUNER_CAP_1HZ diff --git a/xlat/v4l2_tuner_rxsubchanses.in b/xlat/v4l2_tuner_rxsubchanses.in new file mode 100644 index 00000000..c6d59e95 --- /dev/null +++ b/xlat/v4l2_tuner_rxsubchanses.in @@ -0,0 +1,6 @@ +V4L2_TUNER_SUB_MONO +V4L2_TUNER_SUB_STEREO +V4L2_TUNER_SUB_LANG2 +V4L2_TUNER_SUB_SAP +V4L2_TUNER_SUB_LANG1 +V4L2_TUNER_SUB_RDS diff --git a/xlat/v4l2_tuner_types.in b/xlat/v4l2_tuner_types.in new file mode 100644 index 00000000..59a9f3a3 --- /dev/null +++ b/xlat/v4l2_tuner_types.in @@ -0,0 +1,6 @@ +V4L2_TUNER_RADIO +V4L2_TUNER_ANALOG_TV +V4L2_TUNER_DIGITAL_TV +V4L2_TUNER_ADC +V4L2_TUNER_SDR +V4L2_TUNER_RF