From beb4c8e84be4f3fa8cc3ccc5fe9ba4e21929561c Mon Sep 17 00:00:00 2001 From: Mahesh Kondiparthi Date: Wed, 13 Jan 2016 10:32:51 +0530 Subject: [PATCH] Fixed bug in muxing 3gp container with amr audio One can validate the same with option 23. Change-Id: I4a2321341389383880fb773b57d6125c05aa4cbf Signed-off-by: Mahesh Kondiparthi --- src/port_gst/mediamuxer_port_gst.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/port_gst/mediamuxer_port_gst.c b/src/port_gst/mediamuxer_port_gst.c index 0230248..a5e10f5 100644 --- a/src/port_gst/mediamuxer_port_gst.c +++ b/src/port_gst/mediamuxer_port_gst.c @@ -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); -- 2.7.4