Fixed bug in muxing 3gp container with amr audio 37/56837/3 accepted/tizen/mobile/20160114.011311 accepted/tizen/tv/20160114.011327 accepted/tizen/wearable/20160114.011344 submit/tizen/20160113.063342
authorMahesh Kondiparthi <kd.mahesh@samsung.com>
Wed, 13 Jan 2016 05:02:51 +0000 (10:32 +0530)
committerMahesh Kondiparthi <kd.mahesh@samsung.com>
Wed, 13 Jan 2016 05:27:44 +0000 (21:27 -0800)
One can validate the same with option 23.

Change-Id: I4a2321341389383880fb773b57d6125c05aa4cbf
Signed-off-by: Mahesh Kondiparthi <kd.mahesh@samsung.com>
src/port_gst/mediamuxer_port_gst.c

index 0230248..a5e10f5 100644 (file)
@@ -520,10 +520,10 @@ mx_ret_e _gst_create_pipeline(mxgst_handle_t *gst_handle)
                                                MEDIA_FORMAT_ERROR_INVALID_OPERATION) {
                                                if (mimetype == MEDIA_FORMAT_AAC_LC || mimetype == MEDIA_FORMAT_AAC_HE || mimetype == MEDIA_FORMAT_AAC_HE_PS)
                                                        current->parser = gst_element_factory_make("aacparse", str_parser);
+                                                else if (mimetype == MEDIA_FORMAT_PCM || (mimetype == MEDIA_FORMAT_AMR_NB && gst_handle->muxed_format == MEDIAMUXER_CONTAINER_FORMAT_3GP))
+                                                       MX_I("Do Nothing, as there is no need of parser for wav & 3pg(amr-nb) \n");
                                                else if (mimetype == MEDIA_FORMAT_AMR_NB || mimetype == MEDIA_FORMAT_AMR_WB)
                                                        current->parser = gst_element_factory_make("amrparse", str_parser);
-                                               else if (mimetype == MEDIA_FORMAT_PCM)
-                                                       MX_I("Do Nothing, as there is no need of parser for wav\n");
                                        } else {
                                                MX_E("Can't retrive mimetype for the current track. Unsupported MIME Type. Proceeding to the next track\n");
                                        }
@@ -535,7 +535,9 @@ mx_ret_e _gst_create_pipeline(mxgst_handle_t *gst_handle)
                                        }
 
                                        gst_bin_add_many(GST_BIN(gst_handle->pipeline), current->appsrc, NULL);
-                                       if (mimetype != MEDIA_FORMAT_PCM) {
+                                       if (mimetype == MEDIA_FORMAT_PCM || (mimetype == MEDIA_FORMAT_AMR_NB && gst_handle->muxed_format == MEDIAMUXER_CONTAINER_FORMAT_3GP)) {
+                                               MX_I("Do Nothing, as there is no need of parser for wav & 3pg(amr-nb) \n");
+                                       } else {
                                                if (!current->parser) {
                                                        MX_E("One element (audio-parser) could not be created. Exiting.\n");
                                                        ret = MEDIAMUXER_ERROR_RESOURCE_LIMIT;
@@ -553,6 +555,7 @@ mx_ret_e _gst_create_pipeline(mxgst_handle_t *gst_handle)
                                                G_CALLBACK(_audio_start_feed), current);
                                        g_signal_connect(current->appsrc, "enough-data",
                                                G_CALLBACK(_audio_stop_feed), current);
+                                       g_object_set (current->appsrc, "format", GST_FORMAT_TIME, NULL);
 #else
                                        g_object_set(current->appsrc, "block", TRUE, NULL);
                                        gst_app_src_set_stream_type((GstAppSrc *)current->appsrc,
@@ -561,7 +564,8 @@ mx_ret_e _gst_create_pipeline(mxgst_handle_t *gst_handle)
                                        /* For wav, wavenc is muxer */
                                        if (gst_handle->muxed_format == MEDIAMUXER_CONTAINER_FORMAT_WAV
                                                || gst_handle->muxed_format == MEDIAMUXER_CONTAINER_FORMAT_AMR_NB
-                                               || gst_handle->muxed_format == MEDIAMUXER_CONTAINER_FORMAT_AMR_WB) {
+                                               || gst_handle->muxed_format == MEDIAMUXER_CONTAINER_FORMAT_AMR_WB
+                                               || (gst_handle->muxed_format == MEDIAMUXER_CONTAINER_FORMAT_3GP && mimetype == MEDIA_FORMAT_AMR_NB)) {
                                                gst_element_link(current->appsrc, gst_handle->muxer);
                                        } else {
                                                gst_element_link(current->appsrc, current->parser);