[0.3.108] Send codec data if media_packet has codec_data 36/197236/6 accepted/tizen/unified/20190128.061606 submit/tizen/20190123.015108
authorGilbok Lee <gilbok.lee@samsung.com>
Mon, 7 Jan 2019 05:11:19 +0000 (14:11 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Wed, 16 Jan 2019 02:32:44 +0000 (11:32 +0900)
Change-Id: Ief899eb5cb17c38e7fc859237cec05d4655bbe9c

packaging/capi-media-player.spec
src/player.c

index a205d07..ed2d62c 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-player
 Summary:    A Media Player API
-Version:    0.3.107
+Version:    0.3.108
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index e7ff79c..5ce8b72 100644 (file)
@@ -4256,6 +4256,8 @@ int player_push_media_stream(player_h player, media_packet_h packet)
        bool is_audio;
        bool is_eos;
        int arr_msg_len = 0;
+       char *codec_data = NULL;
+       unsigned int codec_data_size = 0;
 
        LOGD("ENTER");
 
@@ -4264,7 +4266,12 @@ int player_push_media_stream(player_h player, media_packet_h packet)
        media_packet_get_pts(packet, &push_media.pts);
        media_packet_get_format(packet, &format);
        media_packet_get_flags(packet, &push_media.flags);
+       if (media_packet_get_codec_data(packet, (void **)&codec_data, &codec_data_size) == MEDIA_PACKET_ERROR_NONE) {
+               if (codec_data_size > 0 && codec_data_size <= sizeof(push_media.codec_data))
+                       memcpy(push_media.codec_data, codec_data, codec_data_size);
+       }
 
+       push_media.codec_data_size = codec_data_size;
        push_media.buf_type = PUSH_MEDIA_BUF_TYPE_RAW;
 
        media_packet_is_video(packet, &is_video);