pitch: add audio meta
authorEunhye Choi <eunhae1.choi@samsung.com>
Fri, 14 Feb 2020 07:59:05 +0000 (16:59 +0900)
committerEunhye Choi <eunhae1.choi@samsung.com>
Mon, 17 Feb 2020 07:18:11 +0000 (16:18 +0900)
- add audio meta info in case of non-interleaved layout
  which is required when it is converted to interleaved.

Change-Id: I8a7c03b9a40f9093e6f0416e53b75f14086d6b88

ext/soundtouch/gstpitch.cc
packaging/gst-plugins-bad.spec

index 89bab3f..1981a17 100644 (file)
@@ -459,8 +459,8 @@ gst_pitch_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
   return res;
 }
 
-/* generic convert function based on caps, no rate 
- * used here 
+/* generic convert function based on caps, no rate
+ * used here
  */
 static gboolean
 gst_pitch_convert (GstPitch * pitch,
@@ -890,6 +890,16 @@ gst_pitch_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
     GstBuffer *out_buffer;
 
     out_buffer = gst_pitch_prepare_buffer (pitch);
+
+#ifdef TIZEN_FEATURE_PITCH_AUDIO_META
+    gint samples =  GST_BUFFER_OFFSET (out_buffer);
+
+    if (GST_AUDIO_INFO_LAYOUT (&pitch->info) ==
+        GST_AUDIO_LAYOUT_NON_INTERLEAVED) {
+      gst_buffer_add_audio_meta (out_buffer, &pitch->info, samples, NULL);
+    }
+#endif
+
     if (out_buffer)
       return gst_pitch_forward_buffer (pitch, out_buffer);
   }
index 3e87b2e..f3ef650 100644 (file)
@@ -79,6 +79,7 @@ export CFLAGS+=" -Wall -g -fPIC\
   -fstack-protector-strong\
   -Wl,-z,relro\
   -D_FORTIFY_SOURCE=2"
+export CXXFLAGS+=" -DTIZEN_FEATURE_PITCH_AUDIO_META"
 
 %configure\
        --disable-static\