GST_DEBUG_CATEGORY_STATIC (rtpbasedepayload_debug);
#define GST_CAT_DEFAULT (rtpbasedepayload_debug)
+static GstStaticCaps ntp_reference_timestamp_caps =
+GST_STATIC_CAPS ("timestamp/x-ntp");
+
struct _GstRTPBaseDepayloadPrivate
{
GstClockTime npt_start;
GstClockTime dts;
GstClockTime duration;
+ GstClockTime ref_ts;
+
guint32 last_ssrc;
guint32 last_seqnum;
guint32 last_rtptime;
priv->dts = -1;
priv->pts = -1;
priv->duration = -1;
+ priv->ref_ts = -1;
priv->source_info = DEFAULT_SOURCE_INFO;
priv->max_reorder = DEFAULT_MAX_REORDER;
priv->auto_hdr_ext = DEFAULT_AUTO_HEADER_EXTENSION;
gboolean discont, buf_discont;
gint gap;
GstRTPBuffer rtp = { NULL };
+ GstReferenceTimestampMeta *meta;
+ GstCaps *ref_caps;
priv = filter->priv;
priv->process_flow_ret = GST_FLOW_OK;
if (G_UNLIKELY (!priv->negotiated))
goto not_negotiated;
+ /* Check for duplicate reference timestamp metadata */
+ ref_caps = gst_static_caps_get (&ntp_reference_timestamp_caps);
+ meta = gst_buffer_get_reference_timestamp_meta (in, ref_caps);
+ gst_caps_unref (ref_caps);
+ if (meta) {
+ guint64 ref_ts = meta->timestamp;
+ if (ref_ts == priv->ref_ts) {
+ /* Drop the redundant/duplicate reference timstamp metadata */
+ in = gst_buffer_make_writable (in);
+ gst_buffer_remove_meta (in, GST_META_CAST (meta));
+ } else {
+ priv->ref_ts = ref_ts;
+ }
+ }
+
if (G_UNLIKELY (!gst_rtp_buffer_map (in, GST_MAP_READ, &rtp)))
goto invalid_buffer;
filter->need_newsegment = !filter->priv->onvif_mode;
filter->priv->next_seqnum = -1;
+ filter->priv->ref_ts = -1;
gst_event_replace (&filter->priv->segment_event, NULL);
break;
case GST_EVENT_CAPS:
priv->play_speed = 1.0;
priv->play_scale = 1.0;
priv->clock_base = -1;
+ priv->ref_ts = -1;
priv->onvif_mode = FALSE;
priv->next_seqnum = -1;
priv->negotiated = FALSE;