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 733616 - v4l2object: code cleanup
v4l2object: code cleanup
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-07-23 17:14 UTC by Aurélien Zanelli
Modified: 2014-07-28 12:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
v4l2: set debug messages according to device type and IO mode (1.54 KB, patch)
2014-07-23 17:15 UTC, Aurélien Zanelli
committed Details | Review
v4l2sink: use directly 'obj' instead of 'v4l2sink->v4l2object' (1.57 KB, patch)
2014-07-23 17:15 UTC, Aurélien Zanelli
committed Details | Review
v4l2object: get current bufferpool min and max in propose_allocation() (1.16 KB, patch)
2014-07-23 17:16 UTC, Aurélien Zanelli
rejected Details | Review

Description Aurélien Zanelli 2014-07-23 17:14:21 UTC
Currently, gst_v4l2_object_propose_allocation() always propose a pool with default min-buffers and max-buffers. But configured v4l2 bufferpool could have different values, for instance when v4l2 device can't allocate, max-buffers is reduced to min-buffers.

I also attached patch with some fix for debug messages and minor refactoring.
Comment 1 Aurélien Zanelli 2014-07-23 17:15:21 UTC
Created attachment 281492 [details] [review]
v4l2: set debug messages according to device type and IO mode
Comment 2 Aurélien Zanelli 2014-07-23 17:15:49 UTC
Created attachment 281493 [details] [review]
v4l2sink: use directly 'obj' instead of 'v4l2sink->v4l2object'
Comment 3 Aurélien Zanelli 2014-07-23 17:16:29 UTC
Created attachment 281494 [details] [review]
v4l2object: get current bufferpool min and max in propose_allocation()

The interesting one :)
Comment 4 Nicolas Dufresne (ndufresne) 2014-07-23 18:17:08 UTC
Review of attachment 281492 [details] [review]:

Good catch, will merge soon.
Comment 5 Nicolas Dufresne (ndufresne) 2014-07-23 18:17:40 UTC
Review of attachment 281493 [details] [review]:

Cosmetic, but I'm fine with that.
Comment 6 Nicolas Dufresne (ndufresne) 2014-07-23 18:25:42 UTC
Review of attachment 281494 [details] [review]:

No, that isn't right. Propose allocation shall return it's minimum, regardless if a pool was configured or not. It's upstream element role to deactivate the pool if he want to renegotiate it. The only thing missing here is code that read the CID MIN_BUFFERS_FOR_INPUT, and upgrade the minimum from that (basically min = MAX(MIN_BUFFERS_FOR_INPUT, GST_V4L2_MIN_BUFFERS). See BaseSrc code of an example of how to re-negotiate a buffer pool (though even there, I think it should be improved a bit).
Comment 7 Aurélien Zanelli 2014-07-25 13:23:05 UTC
(In reply to comment #6)
> Review of attachment 281494 [details] [review]:
> 
> No, that isn't right. Propose allocation shall return it's minimum, regardless
> if a pool was configured or not. 
It makes sense.

> The only thing missing here is code that
> read the CID MIN_BUFFERS_FOR_INPUT, and upgrade the minimum from that
> (basically min = MAX(MIN_BUFFERS_FOR_INPUT, GST_V4L2_MIN_BUFFERS).
I could implement this part if you want


> See BaseSrc code of an example of how to re-negotiate a buffer pool 

Thanks for the reference.
Comment 8 Nicolas Dufresne (ndufresne) 2014-07-25 14:25:43 UTC
(In reply to comment #7) 
> > The only thing missing here is code that
> > read the CID MIN_BUFFERS_FOR_INPUT, and upgrade the minimum from that
> > (basically min = MAX(MIN_BUFFERS_FOR_INPUT, GST_V4L2_MIN_BUFFERS).
> I could implement this part if you want

Sure, but should have it's own bug probably. I didn't have any drivers that implemented that yet. I wonder is ayaka, in it's encoder branch have that patch already.

Btw, thanks for looking into this, it's all a bit tricky to get allocation negotiated and not blindly set.
Comment 9 Nicolas Dufresne (ndufresne) 2014-07-25 17:49:23 UTC
Comment on attachment 281492 [details] [review]
v4l2: set debug messages according to device type and IO mode

commit 57ae11ac6f5c6821d265cb240aeb21aa056a8041
Author: Aurélien Zanelli <aurelien.zanelli@parrot.com>
Date:   Wed Jul 23 18:39:50 2014 +0200

    v4l2: set debug messages according to device type and IO mode
    
    https://bugzilla.gnome.org/show_bug.cgi?id=733616
Comment 10 Nicolas Dufresne (ndufresne) 2014-07-25 17:49:45 UTC
Comment on attachment 281493 [details] [review]
v4l2sink: use directly 'obj' instead of 'v4l2sink->v4l2object'

commit de799f4d8435d579f8c8ecc1aec6852589a5a6d4
Author: Aurélien Zanelli <aurelien.zanelli@parrot.com>
Date:   Wed Jul 23 18:40:10 2014 +0200

    v4l2sink: use directly 'obj' instead of 'v4l2sink->v4l2object'
    
    https://bugzilla.gnome.org/show_bug.cgi?id=733616
Comment 11 Nicolas Dufresne (ndufresne) 2014-07-25 17:52:24 UTC
I'm a bit puzzled what to do with this bug now, as the fix for the actual issue will be in OMX. Do you mind if I rename it to cleanup/varia and mark as closed ?
Comment 12 Aurélien Zanelli 2014-07-28 07:08:23 UTC
(In reply to comment #11)
> I'm a bit puzzled what to do with this bug now, as the fix for the actual issue
> will be in OMX. Do you mind if I rename it to cleanup/varia and mark as closed
> ?

It's ok for me.