summaryrefslogtreecommitdiff
path: root/gst/rtp/gstrtpopusdepay.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst/rtp/gstrtpopusdepay.c')
-rw-r--r--gst/rtp/gstrtpopusdepay.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gst/rtp/gstrtpopusdepay.c b/gst/rtp/gstrtpopusdepay.c
index af3237beb..abb7218e0 100644
--- a/gst/rtp/gstrtpopusdepay.c
+++ b/gst/rtp/gstrtpopusdepay.c
@@ -26,6 +26,7 @@
#include <string.h>
#include <stdlib.h>
#include <gst/rtp/gstrtpbuffer.h>
+#include <gst/audio/audio.h>
#include "gstrtpopusdepay.h"
GST_DEBUG_CATEGORY_STATIC (rtpopusdepay_debug);
@@ -137,6 +138,25 @@ gst_rtp_opus_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps)
return ret;
}
+static gboolean
+foreach_metadata (GstBuffer * inbuf, GstMeta ** meta, gpointer user_data)
+{
+ GstRTPOpusDepay *depay = user_data;
+ const GstMetaInfo *info = (*meta)->info;
+ const gchar *const *tags = gst_meta_api_type_get_tags (info->api);
+
+ if (!tags || (g_strv_length ((gchar **) tags) == 1
+ && gst_meta_api_type_has_tag (info->api,
+ g_quark_from_string (GST_META_TAG_AUDIO_STR)))) {
+ GST_DEBUG_OBJECT (depay, "keeping metadata %s", g_type_name (info->api));
+ } else {
+ GST_DEBUG_OBJECT (depay, "dropping metadata %s", g_type_name (info->api));
+ *meta = NULL;
+ }
+
+ return TRUE;
+}
+
static GstBuffer *
gst_rtp_opus_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
{
@@ -147,5 +167,9 @@ gst_rtp_opus_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
outbuf = gst_rtp_buffer_get_payload_buffer (&rtpbuf);
gst_rtp_buffer_unmap (&rtpbuf);
+ outbuf = gst_buffer_make_writable (outbuf);
+ /* Filter away all metas that are not sensible to copy */
+ gst_buffer_foreach_meta (outbuf, foreach_metadata, depayload);
+
return outbuf;
}