GNOME Bugzilla – Bug 791841
v4l2: Wrong structure used in gst_v4l2_video_enc_get_property (self->v4l2output instead of self->v4l2capture)
Last modified: 2018-01-12 14:23:01 UTC
When looking at gst_v4l2_video_enc_set_property (here https://github.com/GStreamer/gst-plugins-good/blob/master/sys/v4l2/gstv4l2videoenc.c#L61 ) then first and default cases uses self->v4l2output second case uses self->v4l2capture so far so good. Same in gst_v4l2_video_enc_get_property (here https://github.com/GStreamer/gst-plugins-good/blob/master/sys/v4l2/gstv4l2videoenc.c#L87 ) all three cases use self->v4l2output Furthermore https://github.com/GStreamer/gst-plugins-good/blob/master/sys/v4l2/gstv4l2videoenc.c#L98 uses PROP_IO_MODE instead of prop_id like in all other cases, which is perhaps not wrong, but breaks symmetry to all other cases. Similar code seems to be in https://github.com/GStreamer/gst-plugins-good/blob/master/sys/v4l2/gstv4l2videodec.c but there everything is ok. I am sorry, my knowledge is limited and cannot decide if correct nor can I create a suitable patch for this. Can someone help?
You are right, there's a bug in the getter at least. For the default to output, that I don't really know. It's unclear in V4L2 spec which controls applies to capture or to output. Most drivers ignores that for controls. I'll make a patch.
Created attachment 366706 [details] [review] v4l2videoenc: fix capture-io-mode property get
Created attachment 366707 [details] [review] v4l2videoenc: fold property set/get PROP_OUTPUT_IO_MODE case into default
Created attachment 366708 [details] [review] v4l2videoenc: add property set/get PROP_CAPTURE_IO_MODE error handling
Created attachment 366709 [details] [review] v4l2videodec: fold property set/get PROP_OUTPUT_IO_MODE case into default
Created attachment 366710 [details] [review] v4l2videodec: add property set/get PROP_CAPTURE_IO_MODE error handling
Review of attachment 366706 [details] [review]: Looks good, thanks.
Review of attachment 366707 [details] [review]: Ok.
Review of attachment 366708 [details] [review]: That one is redundant, we already have g_return_val_if_fail(), but ok.
Review of attachment 366709 [details] [review]: .
Review of attachment 366710 [details] [review]: .
Thanks for your work ! Attachment 366706 [details] pushed as 1898223 - v4l2videoenc: fix capture-io-mode property get Attachment 366707 [details] pushed as 5c0cf56 - v4l2videoenc: fold property set/get PROP_OUTPUT_IO_MODE case into default Attachment 366708 [details] pushed as f579ece - v4l2videoenc: add property set/get PROP_CAPTURE_IO_MODE error handling Attachment 366709 [details] pushed as 2cd772b - v4l2videodec: fold property set/get PROP_OUTPUT_IO_MODE case into default Attachment 366710 [details] pushed as d2f9040 - v4l2videodec: add property set/get PROP_CAPTURE_IO_MODE error handling