GNOME Bugzilla – Bug 613789
[jpegenc] Updating caps is not supported
Last modified: 2010-03-26 12:35:51 UTC
Created attachment 156964 [details] [review] Fix updating jpegenc caps The jpegenc element apparently doesn't support updating caps of the sink pad. I have a pipeline where jpegenc is used for taking snapshots of the video and when video caps change (e.g. video aspect ratio changes), there is a "not-negotiated" error (apparently because jpegenc rejects the new caps). Attached is a proposed patch that fixes this. I basically copied the behaviour from pngenc, I don't know if it's the right approach. The patch does the following: - Remove getcaps function - Don't use fixed caps for sink pad - Simplify setcaps function, because it's only used for sink pad
Comment on attachment 156964 [details] [review] Fix updating jpegenc caps The getcaps function definitely makes sense here for the sinkpad because it transforms the downstream caps to the supported upstream caps. If you remove it, negotiation will be broken. The setcaps changes look fine though... same goes for the use_fixed_caps() removal. For the srcpad you should use fixed_caps and removal of the getcaps function is fine too.
Created attachment 157110 [details] [review] Fix updating jpegenc sink caps Thanks for the review, here's an updated patch. I guess the only fix that is really necessary for fixing the bug is calling use_fixed_caps for src pad instead of sink pad. BTW, getcaps function was never set for src pad, it was set twice for sink pad.
commit 10f092dc61a58a1de536df1544c172694cd9391b Author: Raimo Järvi <raimo.jarvi@gmail.com> Date: Fri Mar 26 13:34:17 2010 +0100 jpegenc: Set correct getcaps/setcaps functions on srcpads and simplify them This fixes downstream negotiation, upstream negotiation isn't really supported by jpegenc yet. Fixes bug #613789.