summaryrefslogtreecommitdiff
path: root/gst/timecode/gsttimecodestamper.c
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-11-24 14:41:59 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-11-24 14:42:45 +0200
commit166c5333ca8518d2033cd51c4cd40283612b8b3c (patch)
tree51fc5f0cb9525b18af2fc511cdd1593ddae21e41 /gst/timecode/gsttimecodestamper.c
parentd1fa342b71be439105bef9836153b47ff3431934 (diff)
downloadgstreamer-plugins-bad-166c5333ca8518d2033cd51c4cd40283612b8b3c.tar.gz
timecodestamper: Remove all existing timecode metas if requested to override existing
Diffstat (limited to 'gst/timecode/gsttimecodestamper.c')
-rw-r--r--gst/timecode/gsttimecodestamper.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gst/timecode/gsttimecodestamper.c b/gst/timecode/gsttimecodestamper.c
index d9302895b..4cbdc683d 100644
--- a/gst/timecode/gsttimecodestamper.c
+++ b/gst/timecode/gsttimecodestamper.c
@@ -341,6 +341,16 @@ gst_timecodestamper_sink_event (GstBaseTransform * trans, GstEvent * event)
return ret;
}
+static gboolean
+remove_timecode_meta (GstBuffer * buffer, GstMeta ** meta, gpointer user_data)
+{
+ if (meta && *meta && (*meta)->info->api == GST_VIDEO_TIME_CODE_META_API_TYPE) {
+ *meta = NULL;
+ }
+
+ return TRUE;
+}
+
static GstFlowReturn
gst_timecodestamper_transform_ip (GstBaseTransform * vfilter,
GstBuffer * buffer)
@@ -350,10 +360,13 @@ gst_timecodestamper_transform_ip (GstBaseTransform * vfilter,
GST_OBJECT_LOCK (timecodestamper);
if (gst_buffer_get_video_time_code_meta (buffer)
- && timecodestamper->override_existing == FALSE) {
+ && !timecodestamper->override_existing) {
GST_OBJECT_UNLOCK (timecodestamper);
return GST_FLOW_OK;
+ } else if (timecodestamper->override_existing) {
+ gst_buffer_foreach_meta (buffer, remove_timecode_meta, NULL);
}
+
if (timecodestamper->source_clock != NULL) {
if (timecodestamper->current_tc->hours == 0
&& timecodestamper->current_tc->minutes == 0