summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Decina <alessandro.d@gmail.com>2009-08-06 17:35:21 +0200
committerAlessandro Decina <alessandro.d@gmail.com>2009-08-07 13:40:41 +0200
commit4f783e2bca5d2cfef63886e9d487131ebd68e3b6 (patch)
tree36482f28bd61eed7083c5b8e5ed22345edac84ee
parentd777fb70ebda9476e2d801367cace126c589e3a6 (diff)
When ghosting a pad that has negotiated caps, set those caps to the ghost as well.
-rw-r--r--gnl/gnlghostpad.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gnl/gnlghostpad.c b/gnl/gnlghostpad.c
index 77cfe88..e17ce4c 100644
--- a/gnl/gnlghostpad.c
+++ b/gnl/gnlghostpad.c
@@ -722,7 +722,6 @@ gnl_object_ghost_pad_full (GnlObject * object, const gchar * name,
return NULL;
}
-
/* activate pad */
gst_pad_set_active (ghost, TRUE);
/* add it to element */
@@ -812,6 +811,17 @@ gnl_object_ghost_pad_set_target (GnlObject * object, GstPad * ghost,
if (!(gst_ghost_pad_set_target (GST_GHOST_PAD (ghost), target)))
return FALSE;
+ if (target) {
+ GstCaps *negotiated_caps;
+
+ /* if the target has negotiated caps, forward them to the ghost */
+ if ((negotiated_caps = gst_pad_get_negotiated_caps (target))) {
+ gst_pad_set_caps (ghost, negotiated_caps);
+ gst_caps_unref (negotiated_caps);
+ }
+ }
+
+
if (!GST_OBJECT_IS_FLOATING (ghost))
control_internal_pad (ghost, object);