After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 791841 - v4l2: Wrong structure used in gst_v4l2_video_enc_get_property (self->v4l2output instead of self->v4l2capture)
v4l2: Wrong structure used in gst_v4l2_video_enc_get_property (self->v4l2outp...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-12-21 12:23 UTC by Marie Maurer
Modified: 2018-01-12 14:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
v4l2videoenc: fix capture-io-mode property get (948 bytes, patch)
2018-01-12 09:30 UTC, Peter Seiderer
committed Details | Review
v4l2videoenc: fold property set/get PROP_OUTPUT_IO_MODE case into default (1.32 KB, patch)
2018-01-12 09:30 UTC, Peter Seiderer
committed Details | Review
v4l2videoenc: add property set/get PROP_CAPTURE_IO_MODE error handling (1.43 KB, patch)
2018-01-12 09:31 UTC, Peter Seiderer
committed Details | Review
v4l2videodec: fold property set/get PROP_OUTPUT_IO_MODE case into default (1.32 KB, patch)
2018-01-12 09:32 UTC, Peter Seiderer
committed Details | Review
v4l2videodec: add property set/get PROP_CAPTURE_IO_MODE error handling (1.43 KB, patch)
2018-01-12 09:33 UTC, Peter Seiderer
committed Details | Review

Description Marie Maurer 2017-12-21 12:23:57 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?
Comment 1 Nicolas Dufresne (ndufresne) 2017-12-21 14:36:54 UTC
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.
Comment 2 Peter Seiderer 2018-01-12 09:30:08 UTC
Created attachment 366706 [details] [review]
v4l2videoenc: fix capture-io-mode property get
Comment 3 Peter Seiderer 2018-01-12 09:30:48 UTC
Created attachment 366707 [details] [review]
v4l2videoenc: fold property set/get PROP_OUTPUT_IO_MODE case into default
Comment 4 Peter Seiderer 2018-01-12 09:31:23 UTC
Created attachment 366708 [details] [review]
v4l2videoenc: add property set/get PROP_CAPTURE_IO_MODE error handling
Comment 5 Peter Seiderer 2018-01-12 09:32:21 UTC
Created attachment 366709 [details] [review]
v4l2videodec: fold property set/get PROP_OUTPUT_IO_MODE case into default
Comment 6 Peter Seiderer 2018-01-12 09:33:35 UTC
Created attachment 366710 [details] [review]
v4l2videodec: add property set/get PROP_CAPTURE_IO_MODE error handling
Comment 7 Nicolas Dufresne (ndufresne) 2018-01-12 14:17:29 UTC
Review of attachment 366706 [details] [review]:

Looks good, thanks.
Comment 8 Nicolas Dufresne (ndufresne) 2018-01-12 14:19:18 UTC
Review of attachment 366707 [details] [review]:

Ok.
Comment 9 Nicolas Dufresne (ndufresne) 2018-01-12 14:20:41 UTC
Review of attachment 366708 [details] [review]:

That one is redundant, we already have g_return_val_if_fail(), but ok.
Comment 10 Nicolas Dufresne (ndufresne) 2018-01-12 14:20:56 UTC
Review of attachment 366709 [details] [review]:

.
Comment 11 Nicolas Dufresne (ndufresne) 2018-01-12 14:21:05 UTC
Review of attachment 366710 [details] [review]:

.
Comment 12 Nicolas Dufresne (ndufresne) 2018-01-12 14:22:03 UTC
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