From 82a8382f9c1b739c839a0a977f9ef8cbdc417c14 Mon Sep 17 00:00:00 2001 From: Jasson Rodriguez Date: Wed, 13 Jul 2022 10:01:39 -0600 Subject: [PATCH 1/2] Add parent meta to compensated buffers --- gst/interpipe/gstinterpipesrc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gst/interpipe/gstinterpipesrc.c b/gst/interpipe/gstinterpipesrc.c index 9799d8c..7614354 100644 --- a/gst/interpipe/gstinterpipesrc.c +++ b/gst/interpipe/gstinterpipesrc.c @@ -628,6 +628,7 @@ gst_inter_pipe_src_push_buffer (GstInterPipeIListener * iface, GstAppSrc *appsrc; GstFlowReturn ret; guint64 srcbasetime; + GstBuffer *parentbuffer; src = GST_INTER_PIPE_SRC (iface); appsrc = GST_APP_SRC (src); @@ -642,7 +643,10 @@ gst_inter_pipe_src_push_buffer (GstInterPipeIListener * iface, if (GST_INTER_PIPE_SRC_COMPENSATE_TIMESTAMP == src->stream_sync) { guint64 difftime; + parentbuffer = gst_buffer_ref (buffer); buffer = gst_buffer_make_writable (buffer); + gst_buffer_add_parent_buffer_meta (buffer, parentbuffer); + gst_buffer_unref (parentbuffer); srcbasetime = gst_element_get_base_time (GST_ELEMENT (appsrc)); From 5034a92c43580cf51c2cc8bce14efb8949d73167 Mon Sep 17 00:00:00 2001 From: Jasson Rodriguez Date: Tue, 26 Jul 2022 10:03:11 -0600 Subject: [PATCH 2/2] Add parent meta when using restart-ts --- gst/interpipe/gstinterpipesrc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst/interpipe/gstinterpipesrc.c b/gst/interpipe/gstinterpipesrc.c index 7614354..0f6b618 100644 --- a/gst/interpipe/gstinterpipesrc.c +++ b/gst/interpipe/gstinterpipesrc.c @@ -683,6 +683,11 @@ gst_inter_pipe_src_push_buffer (GstInterPipeIListener * iface, "Calculated Buffer Timestamp (PTS): %" GST_TIME_FORMAT, GST_TIME_ARGS (GST_BUFFER_PTS (buffer))); } else if (GST_INTER_PIPE_SRC_RESTART_TIMESTAMP == src->stream_sync) { + parentbuffer = gst_buffer_ref (buffer); + buffer = gst_buffer_make_writable (buffer); + gst_buffer_add_parent_buffer_meta (buffer, parentbuffer); + gst_buffer_unref (parentbuffer); + /* Remove the incoming timestamp to be generated according this basetime */ GST_BUFFER_PTS (buffer) = GST_CLOCK_TIME_NONE; GST_BUFFER_DTS (buffer) = GST_CLOCK_TIME_NONE;