- Should QUERYCAP report capabilities for only the current device node or
'system wide'?
-- Are tuner audio modes other than MONO and STEREO allowed for FM receivers?
-
- If I set a tuner audio mode to something that is not supported by the hardware,
should the driver return an error, or silently modify the audio mode, or just
accept it?
- ditto V4L2_FBUF_CAP_EXTERNOVERLAY: do bytesperline, sizeimage and base need to be
set or not? Determine for overlay and output overlay.
-- RGB pixel formats: endianess issues: two tables in the spec.
+- RGB pixel formats: endianness issues: two tables in the spec.
- Duplicate controls: V4L2_CID_EXPOSURE (user class) and V4L2_CID_EXPOSURE_ABSOLUTE
(camera class).
static int checkTuner(struct node *node, const struct v4l2_tuner &tuner,
unsigned t, v4l2_std_id std)
{
- bool valid_modes[5] = { true, false, false, true, false };
+ bool valid_modes[5] = { true, false, false, false, false };
bool tv = !node->is_radio;
enum v4l2_tuner_type type = tv ? V4L2_TUNER_ANALOG_TV : V4L2_TUNER_RADIO;
__u32 audmode;
return fail("did not expect to see V4L2_TUNER_CAP_LOW set for a tv tuner\n");
if (!tv && !(tuner.capability & V4L2_TUNER_CAP_LOW))
return fail("V4L2_TUNER_CAP_LOW was not set for a radio tuner\n");
+ if (tv && std == V4L2_STD_NTSC_M && (tuner.capability & V4L2_TUNER_CAP_LANG1))
+ return fail("LANG1 capability, but NTSC-M standard\n");
if (tuner.rangelow >= tuner.rangehigh)
return fail("rangelow >= rangehigh\n");
if (tuner.rangelow == 0 || tuner.rangehigh == 0xffffffff)
return fail("LANG1 subchan, but NTSC-M standard\n");
if (tuner.audmode > V4L2_TUNER_MODE_LANG1_LANG2)
return fail("invalid audio mode\n");
- // Ambiguous whether this is allowed or not
- // if (!tv && tuner.audmode > V4L2_TUNER_MODE_STEREO)
- // return -16;
+ if (!tv && tuner.audmode > V4L2_TUNER_MODE_STEREO)
+ return fail("invalid audio mode for radio device\n");
if (tuner.signal > 65535)
return fail("signal too large\n");
if (tuner.capability & V4L2_TUNER_CAP_STEREO)
valid_modes[V4L2_TUNER_MODE_STEREO] = true;
+ if (tuner.capability & V4L2_TUNER_CAP_LANG1)
+ valid_modes[V4L2_TUNER_MODE_LANG1] = true;
if (tuner.capability & V4L2_TUNER_CAP_LANG2) {
valid_modes[V4L2_TUNER_MODE_LANG2] = true;
valid_modes[V4L2_TUNER_MODE_LANG1_LANG2] = true;
fail("failure to get new tuner audmode\n");
if (tun.audmode > V4L2_TUNER_MODE_LANG1_LANG2)
return fail("invalid new audmode\n");
- // Ambiguous whether this is allowed or not
- // if (!tv && tun.audmode > V4L2_TUNER_MODE_STEREO)
- // return -21;
- // if (!valid_modes[tun.audmode])
- // return fail("accepted invalid audmode %d\n", audmode);
+ if (!valid_modes[tun.audmode])
+ return fail("accepted invalid audmode %d\n", audmode);
}
return 0;
}