diff options
author | Olivier CrĂȘte <olivier.crete@collabora.co.uk> | 2009-04-20 20:00:15 -0400 |
---|---|---|
committer | Dave Robillard <dave@drobilla.net> | 2009-05-03 12:03:17 -0400 |
commit | 2707477e20124cbdd386e464b016b16d9ea6efd6 (patch) | |
tree | 93439211f4e4d43e65bf85e3f92ca4ce3a0c36d0 | |
parent | 30844e895122e8dab4a7fde9fbe0e4761a3ffeec (diff) | |
download | gst-plugins-bad-2707477e20124cbdd386e464b016b16d9ea6efd6.tar.gz gst-plugins-bad-2707477e20124cbdd386e464b016b16d9ea6efd6.tar.bz2 gst-plugins-bad-2707477e20124cbdd386e464b016b16d9ea6efd6.zip |
rtpmux: Set different caps depending on the input
-rw-r--r-- | gst/rtpmux/gstrtpmux.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gst/rtpmux/gstrtpmux.c b/gst/rtpmux/gstrtpmux.c index e5bc995b..2a045b94 100644 --- a/gst/rtpmux/gstrtpmux.c +++ b/gst/rtpmux/gstrtpmux.c @@ -67,6 +67,8 @@ typedef struct { gboolean have_clock_base; guint clock_base; + + GstCaps *out_caps; } GstRTPMuxPadPrivate; static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", @@ -248,6 +250,7 @@ free_pad_private (gpointer data, GObject * where_the_object_was) { GstRTPMuxPadPrivate *padpriv = data; + gst_caps_replace (&padpriv->out_caps, NULL); g_slice_free (GstRTPMuxPadPrivate, padpriv); } @@ -326,6 +329,7 @@ gst_rtp_mux_chain (GstPad * pad, GstBuffer * buffer) { GstRTPMux *rtp_mux; GstFlowReturn ret; + GstRTPMuxPadPrivate *padpriv = gst_pad_get_element_private (pad); rtp_mux = GST_RTP_MUX (gst_pad_get_parent (pad)); @@ -347,7 +351,7 @@ gst_rtp_mux_chain (GstPad * pad, GstBuffer * buffer) GST_BUFFER_SIZE (buffer), rtp_mux->seqnum, gst_rtp_buffer_get_timestamp (buffer)); - gst_buffer_set_caps (buffer, GST_PAD_CAPS (rtp_mux->srcpad)); + gst_buffer_set_caps (buffer, padpriv->out_caps); ret = gst_pad_push (rtp_mux->srcpad, buffer); @@ -383,7 +387,11 @@ gst_rtp_mux_setcaps (GstPad * pad, GstCaps * caps) GST_DEBUG_OBJECT (rtp_mux, "setting caps %" GST_PTR_FORMAT " on src pad..", caps); ret = gst_pad_set_caps (rtp_mux->srcpad, caps); - gst_caps_unref (caps); + + if (ret) + gst_caps_replace (&padpriv->out_caps, caps); + else + gst_caps_unref (caps); out: gst_object_unref (rtp_mux); |