jpegenc: sink pad's getcaps shouldn't use the src pad getcaps
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>
Tue, 21 Dec 2010 16:37:40 +0000 (13:37 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>
Tue, 21 Dec 2010 18:23:11 +0000 (15:23 -0300)
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

ext/jpeg/gstjpegenc.c

index e562867..60e2e99 100644 (file)
@@ -345,7 +345,7 @@ gst_jpegenc_getcaps (GstPad * pad)
   /* we want to proxy properties like width, height and framerate from the
      other end of the element */
 
-  othercaps = gst_pad_get_allowed_caps (jpegenc->srcpad);
+  othercaps = gst_pad_peer_get_caps_reffed (jpegenc->srcpad);
   if (othercaps == NULL ||
       gst_caps_is_empty (othercaps) || gst_caps_is_any (othercaps)) {
     caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));