diff options
author | Mathieu Duponchelle <mathieu.duponchelle@opencreed.com> | 2015-06-04 19:03:51 +0200 |
---|---|---|
committer | Mathieu Duponchelle <mathieu.duponchelle@opencreed.com> | 2015-06-04 19:16:40 +0200 |
commit | 2ad27e4c138949ae0cff8584723706b929bd6e56 (patch) | |
tree | 964c946a157a2d26734fc9c38cefda4765f07026 /gst/audioresample | |
parent | 579967278a734b16b24bf179063d3b7bb724b099 (diff) |
audioresample: copy metadata that only has the "audio" tag.
https://bugzilla.gnome.org/show_bug.cgi?id=750406
Diffstat (limited to 'gst/audioresample')
-rw-r--r-- | gst/audioresample/gstaudioresample.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gst/audioresample/gstaudioresample.c b/gst/audioresample/gstaudioresample.c index a268ebc91..8e1f197fb 100644 --- a/gst/audioresample/gstaudioresample.c +++ b/gst/audioresample/gstaudioresample.c @@ -133,6 +133,8 @@ static gboolean gst_audio_resample_set_caps (GstBaseTransform * base, GstCaps * incaps, GstCaps * outcaps); static GstFlowReturn gst_audio_resample_transform (GstBaseTransform * base, GstBuffer * inbuf, GstBuffer * outbuf); +static gboolean gst_audio_resample_transform_meta (GstBaseTransform * trans, + GstBuffer * outbuf, GstMeta * meta, GstBuffer * inbuf); static gboolean gst_audio_resample_sink_event (GstBaseTransform * base, GstEvent * event); static gboolean gst_audio_resample_start (GstBaseTransform * base); @@ -201,6 +203,8 @@ gst_audio_resample_class_init (GstAudioResampleClass * klass) GST_DEBUG_FUNCPTR (gst_audio_resample_transform); GST_BASE_TRANSFORM_CLASS (klass)->sink_event = GST_DEBUG_FUNCPTR (gst_audio_resample_sink_event); + GST_BASE_TRANSFORM_CLASS (klass)->transform_meta = + GST_DEBUG_FUNCPTR (gst_audio_resample_transform_meta); GST_BASE_TRANSFORM_CLASS (klass)->passthrough_on_same_caps = TRUE; } @@ -1247,6 +1251,23 @@ gst_audio_resample_transform (GstBaseTransform * base, GstBuffer * inbuf, } static gboolean +gst_audio_resample_transform_meta (GstBaseTransform * trans, GstBuffer * outbuf, + GstMeta * meta, GstBuffer * inbuf) +{ + const GstMetaInfo *info = meta->info; + const gchar *const *tags; + + 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))) + return TRUE; + + return FALSE; +} + +static gboolean gst_audio_resample_query (GstPad * pad, GstObject * parent, GstQuery * query) { GstAudioResample *resample = GST_AUDIO_RESAMPLE (parent); |