GNOME Bugzilla – Bug 637686
[jpegenc] Improve sinkpad getcaps results
Last modified: 2010-12-21 18:38:24 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.
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
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.
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 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)
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