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 613789 - [jpegenc] Updating caps is not supported
[jpegenc] Updating caps is not supported
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.21
Other All
: Normal normal
: 0.10.22
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-03-24 11:36 UTC by Raimo Järvi
Modified: 2010-03-26 12:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix updating jpegenc caps (4.48 KB, patch)
2010-03-24 11:36 UTC, Raimo Järvi
needs-work Details | Review
Fix updating jpegenc sink caps (3.85 KB, patch)
2010-03-25 21:05 UTC, Raimo Järvi
committed Details | Review

Description Raimo Järvi 2010-03-24 11:36:00 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 1 Sebastian Dröge (slomo) 2010-03-25 07:10:12 UTC
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.
Comment 2 Raimo Järvi 2010-03-25 21:05:50 UTC
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.
Comment 3 Sebastian Dröge (slomo) 2010-03-26 12:35:44 UTC
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.