summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Crête <olivier.crete@collabora.co.uk>2008-08-12 16:46:07 (GMT)
committerOlivier Crête <olivier.crete@collabora.co.uk>2008-10-06 01:53:01 (GMT)
commitdc3383c1a8cc13cc7bba886e8375aa283a3def95 (patch)
treeff78728fbdc3d7bb84d4ba2547e9ac3ccd6b68ec
parent3299c72002816a60b3308c749a753768011b0cd7 (diff)
downloadgst-plugins-farsight-tester-dc3383c1a8cc13cc7bba886e8375aa283a3def95.tar.gz
gst-plugins-farsight-tester-dc3383c1a8cc13cc7bba886e8375aa283a3def95.tar.xz
Take the clock-base stored from the last setcaps
-rw-r--r--gst/rtpmux/gstrtpmux.c39
1 files changed, 8 insertions, 31 deletions
diff --git a/gst/rtpmux/gstrtpmux.c b/gst/rtpmux/gstrtpmux.c
index 9af27ba..14c1a06 100644
--- a/gst/rtpmux/gstrtpmux.c
+++ b/gst/rtpmux/gstrtpmux.c
@@ -339,41 +339,18 @@ gst_rtp_mux_release_pad (GstElement * element, GstPad *pad)
gst_element_remove_pad (element, pad);
}
-static guint32
-gst_rtp_mux_get_buffer_ts_base (GstRTPMux * rtp_mux, GstBuffer * buffer)
-{
- GstCaps *caps;
- GstStructure *structure;
- const GValue *value;
- guint32 ts_base;
-
- caps = gst_buffer_get_caps (buffer);
- g_return_val_if_fail (caps != NULL, 0);
-
- structure = gst_caps_get_structure (caps, 0);
- g_return_val_if_fail (structure != NULL, 0);
-
- value = gst_structure_get_value (structure, "clock-base");
-
- if (value)
- ts_base = g_value_get_uint (value);
- else
- ts_base = 0;
-
- gst_caps_unref (caps);
-
- GST_DEBUG_OBJECT (rtp_mux, "sink's ts-base: %u", ts_base);
- return ts_base;
-}
-
/* Put our own clock-base on the buffer */
static void
-gst_rtp_mux_readjust_rtp_timestamp (GstRTPMux * rtp_mux, GstBuffer * buffer)
+gst_rtp_mux_readjust_rtp_timestamp (GstRTPMux * rtp_mux, GstPad * pad,
+ GstBuffer * buffer)
{
guint32 ts;
- guint32 sink_ts_base;
+ guint32 sink_ts_base = 0;
+ GstRTPMuxPadPrivate *padpriv = gst_pad_get_element_private (pad);
+
+ if (padpriv->have_base)
+ sink_ts_base = padpriv->clock_base;
- sink_ts_base = gst_rtp_mux_get_buffer_ts_base (rtp_mux, buffer);
ts = gst_rtp_buffer_get_timestamp (buffer) - sink_ts_base + rtp_mux->ts_base;
GST_DEBUG_OBJECT (rtp_mux, "Re-adjusting RTP ts %u to %u",
gst_rtp_buffer_get_timestamp (buffer), ts);
@@ -394,7 +371,7 @@ gst_rtp_mux_chain (GstPad * pad, GstBuffer * buffer)
GST_LOG_OBJECT (rtp_mux, "setting RTP seqnum %d", rtp_mux->seqnum);
gst_rtp_buffer_set_seq (buffer, rtp_mux->seqnum);
gst_rtp_buffer_set_ssrc (buffer, rtp_mux->current_ssrc);
- gst_rtp_mux_readjust_rtp_timestamp (rtp_mux, buffer);
+ gst_rtp_mux_readjust_rtp_timestamp (rtp_mux, pad, buffer);
GST_DEBUG_OBJECT (rtp_mux, "Pushing packet size %d, seq=%d, ts=%u",
GST_BUFFER_SIZE (buffer), rtp_mux->seqnum - 1);