playsink: fix caps negotiation through the new convenience bins
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 6 Oct 2011 14:38:49 +0000 (15:38 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 6 Oct 2011 18:43:43 +0000 (20:43 +0200)
The bins' getcaps was bypassing the inner elements, and thus
failing to account for the caps transformations they allow,
which caused YUV video pipelines to fail with ximagesink, which
does not support YUV, even though the convenience bin includes
a colorspace converter for just this purpose.

https://bugzilla.gnome.org/show_bug.cgi?id=660816

gst/playback/gstplaysinkaudioconvert.c
gst/playback/gstplaysinkvideoconvert.c

index 8e405d2636b8383d76ec788bbb29199734171231..2c28c6eca0739513e8d8dc640ef9c5a957280fb2 100644 (file)
@@ -351,10 +351,7 @@ gst_play_sink_audio_convert_getcaps (GstPad * pad)
   GstPad *otherpad, *peer;
 
   GST_PLAY_SINK_AUDIO_CONVERT_LOCK (self);
-  if (pad == self->srcpad)
-    otherpad = gst_object_ref (self->sinkpad);
-  else
-    otherpad = gst_object_ref (self->srcpad);
+  otherpad = gst_ghost_pad_get_target (GST_GHOST_PAD_CAST (pad));
   GST_PLAY_SINK_AUDIO_CONVERT_UNLOCK (self);
 
   peer = gst_pad_get_peer (otherpad);
index cf765ce96987bf2abec96d5e32a2663890cb540e..8b22a644e6af8df70c0be694c251a10f72dd0a24 100644 (file)
@@ -331,10 +331,7 @@ gst_play_sink_video_convert_getcaps (GstPad * pad)
   GstPad *otherpad, *peer;
 
   GST_PLAY_SINK_VIDEO_CONVERT_LOCK (self);
-  if (pad == self->srcpad)
-    otherpad = gst_object_ref (self->sinkpad);
-  else
-    otherpad = gst_object_ref (self->srcpad);
+  otherpad = gst_ghost_pad_get_target (GST_GHOST_PAD_CAST (pad));
   GST_PLAY_SINK_VIDEO_CONVERT_UNLOCK (self);
 
   peer = gst_pad_get_peer (otherpad);