brillcodec: write the result of decoding audio.
authorKitae Kim <kt920.kim@samsung.com>
Mon, 16 Sep 2013 10:52:52 +0000 (19:52 +0900)
committerKitae Kim <kt920.kim@samsung.com>
Mon, 16 Sep 2013 10:52:52 +0000 (19:52 +0900)
Some values such as sample_rate, channels and etc. have to be returned
because of caps negotiation in the gstreamer plugin.

Change-Id: I66b19555514098c11c7d0889a7b746ef9c7bd1f8
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
tizen/src/hw/maru_brill_codec.c

index 4c22e5bc1c4dd84f421040ed5ccb92b0654b846a..76e01242046faad7bc6b8d82e618dfca9ca75190 100644 (file)
@@ -1040,15 +1040,20 @@ static void write_codec_decode_video_data(AVCodecContext *avctx, int len,
 }
 
 // write the result of codec_decode_audio
-static void write_codec_decode_audio_data(int64_t channel_layout, int len,
-                                       int frame_size_ptr, uint8_t *mem_buf)
+static void write_codec_decode_audio_data(int sample_rate, int channel,
+                                        int64_t channel_layout, int len,
+                                        int frame_size_ptr, uint8_t *mem_buf)
 {
     int size = 0;
 
     TRACE("copy decode_audio. len %d, frame_size %d\n", len, frame_size_ptr);
 
-    memcpy(mem_buf, &channel_layout, sizeof(channel_layout));
-    size = sizeof(channel_layout);
+    memcpy(mem_buf, &sample_rate, sizeof(sample_rate));
+    size = sizeof(sample_rate);
+    memcpy(mem_buf + size, &channel, sizeof(channel));
+    size += sizeof(channel);
+    memcpy(mem_buf + size, &channel_layout, sizeof(channel_layout));
+    size += sizeof(channel_layout);
     memcpy(mem_buf + size, &len, sizeof(len));
     size += sizeof(len);
     memcpy(mem_buf + size, &frame_size_ptr, sizeof(frame_size_ptr));
@@ -1383,7 +1388,9 @@ static void codec_decode_audio(MaruBrillCodecState *s, int ctx_id, int f_id)
         }
     }
 
-    write_codec_decode_audio_data(avctx->channel_layout, len, frame_size_ptr, meta_buf);
+    write_codec_decode_audio_data(avctx->sample_rate, avctx->channels,
+                                avctx->channel_layout, len,
+                                frame_size_ptr, meta_buf);
 
     if (len > 0) {
         tempbuf = g_malloc0(frame_size_ptr);