Sync with 2.4 (Added demuxer support for 3gp(h263 and amr codec) file) 11/48511/1 accepted/tizen/mobile/20151008.134309 accepted/tizen/tv/20151008.134333 accepted/tizen/wearable/20151008.134353 submit/tizen/20151008.061828 tizen_3.0.m2.a1_mobile_release tizen_3.0.m2.a1_tv_release
authorDeepak Srivastava <srivastava.d@samsung.com>
Tue, 22 Sep 2015 09:15:07 +0000 (14:45 +0530)
committerDeepak Srivastava <srivastava.d@samsung.com>
Tue, 22 Sep 2015 09:16:14 +0000 (14:46 +0530)
Change-Id: I70d11cb3a693861de877b4e0b3ea048523de2d9d
Signed-off-by: Deepak Srivastava <srivastava.d@samsung.com>
src/port_gst/mediademuxer_port_gst.c
test/mediademuxer_test.c

index c5c61fb..a2c235d 100755 (executable)
@@ -465,7 +465,7 @@ static void __gst_cb_typefind(GstElement *tf, guint probability,
        type = gst_caps_to_string(caps);
        if (type) {
                MD_I("Media type %s found, probability %d%%\n", type, probability);
-               if (strstr(type, "quicktime") || (strstr(type, "audio/x-m4a"))) {
+               if (strstr(type, "quicktime") || (strstr(type, "audio/x-m4a")) || strstr(type, "x-3gp")) {
                        gst_handle->is_valid_container = true;
                        gst_handle->demux = gst_element_factory_make("qtdemux", NULL);
                        if (!gst_handle->demux) {
@@ -761,6 +761,15 @@ int _set_mime_video(media_format_h format, track *head)
                        if (media_format_set_video_height(format, src_height))
                                goto ERROR;
                }
+       } else if (gst_structure_has_name(struc, "video/x-h263")) {
+               gst_structure_get_int(struc, "width", &src_width);
+               gst_structure_get_int(struc, "height", &src_height);
+               if (media_format_set_video_mime(format, MEDIA_FORMAT_H263))
+                       goto ERROR;
+               if (media_format_set_video_width(format, src_width))
+                       goto ERROR;
+               if (media_format_set_video_height(format, src_height))
+                       goto ERROR;
        } else {
                MD_I("Video mime not supported so far\n");
                goto ERROR;
@@ -873,8 +882,39 @@ int _set_mime_audio(media_format_h format, track *head)
                        goto ERROR;
                if (media_format_set_audio_bit(format, bit))
                        goto ERROR;
-       }
-       else {
+       } else if (gst_structure_has_name(struc, "audio/AMR")) {
+               gst_structure_get_int(struc, "channels", &channels);
+               gst_structure_get_int(struc, "rate", &rate);
+               gst_structure_get_int(struc, "bit", &bit);
+               if (media_format_set_audio_mime(format, MEDIA_FORMAT_AMR_NB))
+                       goto ERROR;
+               if(channels == 0)
+                       channels = 1; /* default */
+               if (media_format_set_audio_channel(format, channels))
+                       goto ERROR;
+               if (media_format_set_audio_samplerate(format, rate))
+                       goto ERROR;
+               if (bit == 0)
+                       bit = 16; /* default */
+               if (media_format_set_audio_bit(format, bit))
+                       goto ERROR;
+       } else if (gst_structure_has_name(struc, "audio/AMR-WB")) {
+               gst_structure_get_int(struc, "channels", &channels);
+               gst_structure_get_int(struc, "rate", &rate);
+               gst_structure_get_int(struc, "bit", &bit);
+               if (media_format_set_audio_mime(format, MEDIA_FORMAT_AMR_WB))
+                       goto ERROR;
+               if(channels == 0)
+                       channels = 1; /* default */
+               if (media_format_set_audio_channel(format, channels))
+                       goto ERROR;
+               if (media_format_set_audio_samplerate(format, rate))
+                       goto ERROR;
+               if (bit == 0)
+                       bit = 16; /* default */
+               if (media_format_set_audio_bit(format, bit))
+                       goto ERROR;
+       } else {
                MD_I("Audio mime not supported so far\n");
                goto ERROR;
        }
index 485056a..f460329 100755 (executable)
@@ -605,8 +605,12 @@ void *_fetch_video_data(void *ptr)
                if (v_mime == MEDIA_FORMAT_H264_SP || v_mime == MEDIA_FORMAT_H264_MP ||
                        v_mime == MEDIA_FORMAT_H264_HP) {
                        flag = 10;
-                       g_print("mediacodec_init_audio() for MEDIACODEC_H264\n");
+                       g_print("mediacodec_init_video() for MEDIACODEC_H264\n");
                        mediacodec_init_video(MEDIACODEC_H264, flag, w, h);
+               } else if (v_mime == MEDIA_FORMAT_H263) {
+                       g_print("mediacodec_init_video() for MEDIACODEC_H263\n");
+                       flag = 10;
+                       mediacodec_init_video(MEDIACODEC_H263, flag, w, h);
                } else {
                        g_print("Not Supported YET- Need to add mime for validating with video codec\n");
                        return (void *)status;