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 740403 - v4l2object: reuse caps framerate if not overwritten by v4l2 device
v4l2object: reuse caps framerate if not overwritten by v4l2 device
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.2.4
Other Linux
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-11-20 07:22 UTC by Peter Seiderer
Modified: 2015-01-23 00:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] v4l2object: reuse caps framerate if not overwritten by v4l2 device (1.69 KB, patch)
2014-11-20 07:22 UTC, Peter Seiderer
committed Details | Review
[PATCH] v4l2object: Always set format (4.24 KB, text/plain)
2014-12-09 20:16 UTC, Nicolas Dufresne (ndufresne)
  Details

Description Peter Seiderer 2014-11-20 07:22:15 UTC
Created attachment 291057 [details] [review]
[PATCH] v4l2object: reuse caps framerate if not overwritten by v4l2 device

This patch enables gstreamer buffer duration setting when using v4l2src on freescale i.mx6 (which enables correct mp4mux muxing after encoding).

Maybe this is to much a workaround and the right thing to do would be
to fix the vl42 kernel driver to fill in the numerator/denominator
values...
Comment 1 Nicolas Dufresne (ndufresne) 2014-11-20 14:23:11 UTC
I take note of this patch. Clearly we need to change something as I don't see any protection against denominator 0 (division by zero). I think the kernel behaviour is wrong, but I'll need to prove it from the spec. At least in that situation we so S_PARMS worked, it's just weird that the driver is taking this extra time to clear the structure.
Comment 2 Nicolas Dufresne (ndufresne) 2014-12-09 20:16:52 UTC
Created attachment 292413 [details]
[PATCH] v4l2object: Always set format


Right now we try to be clever by detecting if device format have
changed or not, and skip setting format in this case. This is valid
behaviour with V4L2, but it's also very error prone. The rational
for not setting these all the time is for speed, though I can't
measure any noticeable gain on any HW I own. Also, until recently,
we where doing get/set on the format for each format we where
probing, making it near to impossible that the format would match.
This also fixes bug where we where skipping frame-rate setting if
format didn't change.

https://bugzilla.gnome.org/show_bug.cgi?id=740403
---
 sys/v4l2/gstv4l2object.c | 70 +-----------------------------------------------
 1 file changed, 1 insertion(+), 69 deletions(-)
Comment 3 Nicolas Dufresne (ndufresne) 2014-12-09 20:19:09 UTC
Here's my response to that. I'm would appreciate some input (at least making sure it fixes the issue you are seeing).

The context is that until recently, we had terrible hack that would get/set format while probing. This was actually leading toward format changing all the time. Clearly that had drastic performance issue, since getting/setting format thousands of times can take time. Though there is no measurable rational for avoiding a single format set, and this code has been the source of bugs for a long time. So I think we should just strip it up, and always set the format and the framerate.
Comment 4 Nicolas Dufresne (ndufresne) 2014-12-09 23:39:09 UTC
I'm sorry, this was the wrong bug, similar name. Ignore comment 2 and 3
Comment 5 Nicolas Dufresne (ndufresne) 2015-01-22 23:40:15 UTC
Review of attachment 291057 [details] [review]:

Re-read this one, and I think it's a fair workaround.
Comment 6 Nicolas Dufresne (ndufresne) 2015-01-23 00:07:58 UTC
Comment on attachment 291057 [details] [review]
[PATCH] v4l2object: reuse caps framerate if not overwritten by v4l2 device

Merged in git master:

commit c88e042458cf8f612ccb8680c9305eb287fdc2cd
Author: Peter Seiderer <ps.report@gmx.net>
Date:   Fri Nov 14 12:59:31 2014 +0100

    v4l2object: reuse caps framerate if not overwritten by v4l2 device
    
    Enables duration setting in v4l2src.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=740403