Merge branch 'tizen_gst_1.16.2' into tizen
[platform/upstream/gst-plugins-good.git] / gst / audioparsers / gstaacparse.c
index 1e6338d..93a5e0b 100644 (file)
@@ -262,6 +262,19 @@ gst_aac_parse_set_src_caps (GstAacParse * aacparse, GstCaps * sink_caps)
   if (stream_format)
     gst_structure_set (s, "stream-format", G_TYPE_STRING, stream_format, NULL);
 
+#ifdef TIZEN_FEATURE_AACPARSE_MODIFICATION
+  if (!gst_structure_get_value (s, "codec_data")) {
+    GstBuffer *codec_data_buffer;
+    GST_WARNING("Insert codec_data to src_caps");
+    /* The codec_data data is according to AudioSpecificConfig,
+       ISO/IEC 14496-3, 1.6.2.1 */
+    codec_data_buffer = gst_buffer_new_and_alloc (2);
+    gst_buffer_fill (codec_data_buffer, 0, codec_data, 2);
+    gst_caps_set_simple (src_caps, "codec_data", GST_TYPE_BUFFER, codec_data_buffer, NULL);
+    gst_buffer_unref (codec_data_buffer);
+  }
+#endif
+
   allowed = gst_pad_get_allowed_caps (GST_BASE_PARSE (aacparse)->srcpad);
   if (allowed && !gst_caps_can_intersect (src_caps, allowed)) {
     GST_DEBUG_OBJECT (GST_BASE_PARSE (aacparse)->srcpad,