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 637686 - [jpegenc] Improve sinkpad getcaps results
[jpegenc] Improve sinkpad getcaps results
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
unspecified
Other All
: Normal normal
: 0.10.27
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-12-20 19:34 UTC by Thiago Sousa Santos
Modified: 2010-12-21 18:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
jpegenc: drop fixed caps from pad (1.06 KB, patch)
2010-12-20 19:34 UTC, Thiago Sousa Santos
rejected Details | Review
jpegenc: Adds another test case (5.56 KB, patch)
2010-12-20 19:34 UTC, Thiago Sousa Santos
committed Details | Review
jpegenc: sink pad's getcaps shouldn't use the src pad getcaps (1.18 KB, patch)
2010-12-21 16:50 UTC, Thiago Sousa Santos
committed Details | Review

Description Thiago Sousa Santos 2010-12-20 19:34:15 UTC
Currently jpegenc get_allowed_caps returns a caps with the current
width/height/framerate and this makes upstream elements wanting to
renegotiate to be forced to use that. This is particularly a problem
on camerabin2 that might want to change resolution after each capture.

Given that each jpeg image is independent from another, we should drop this
and, if this restriction is required because of a downstream muxer, it should
be the muxer's job to do the 'fixed caps' restriction.

I have writen a small test case to show the problem.

If I'm wrong about this, a solution is needed for camerabin2 to work.
Comment 1 Thiago Sousa Santos 2010-12-20 19:34:18 UTC
Created attachment 176781 [details] [review]
jpegenc: drop fixed caps from pad

jpeg images are independent from each other, so jpegenc should be
able to negotiate and accept a different caps for each buffer
it receives if upstream needs that.

In case a downstream muxer doesn't allow that, it is its job
to restrict the caps and not jpegenc's
Comment 2 Thiago Sousa Santos 2010-12-20 19:34:23 UTC
Created attachment 176782 [details] [review]
jpegenc: Adds another test case

Adds a test for jpegenc to check that is possible to negotiate and
push buffers with different resolution one after another.
Comment 3 Thiago Sousa Santos 2010-12-21 16:50:33 UTC
Created attachment 176844 [details] [review]
jpegenc: sink pad's getcaps shouldn't use the src pad getcaps

Instead of using get_allowed_caps on the srcpad, the sinkpad getcaps
should use the getcaps of the srcpad's peer. This way the srcpad
can keep using fixed_caps and sinkpad getcaps exposes all caps
that can be negotiated
Comment 4 Sebastian Dröge (slomo) 2010-12-21 17:15:40 UTC
Comment on attachment 176844 [details] [review]
jpegenc: sink pad's getcaps shouldn't use the src pad getcaps

Looks good

Changing the direction in a getcaps chain will cause infinite loops and other interesting things. (just think of an srcpad getcaps calling the sinkpad getcaps which then calls the srcpad getcaps)
Comment 5 Thiago Sousa Santos 2010-12-21 18:33:40 UTC
commit dde7af4b9d55463201d649427ad52b4642b6f945
Author: Thiago Santos <thiago.sousa.santos@collabora.co.uk>
Date:   Mon Dec 20 14:49:02 2010 -0300

    jpegenc: Adds another test case
    
    Adds a test for jpegenc to check that is possible to negotiate and
    push buffers with different resolution one after another.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=637686

commit dcbba0932dc579abd6aab4460fa1a416374eda1b
Author: Thiago Santos <thiago.sousa.santos@collabora.co.uk>
Date:   Tue Dec 21 13:37:40 2010 -0300

    jpegenc: sink pad's getcaps shouldn't use the src pad getcaps
    
    Instead of using get_allowed_caps on the srcpad, the sinkpad getcaps
    should use the getcaps of the srcpad's peer. This way the srcpad
    can keep using fixed_caps and sinkpad getcaps exposes all caps
    that can be negotiated
    
    https://bugzilla.gnome.org/show_bug.cgi?id=637686