From d15a0af6e4d7647d8647ef75db54ab7806e1c0e2 Mon Sep 17 00:00:00 2001 From: Gilbok Lee Date: Thu, 1 Aug 2019 11:28:12 +0900 Subject: [PATCH] Fix bug of checking the PCM format [Version] 0.1.20 [Issue Type] Fix bugs Change-Id: I1b6532a28085d8b88ede8b74fe7b38d7a6feab10 --- packaging/capi-mediamuxer.spec | 2 +- src/port_gst/mediamuxer_port_gst.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packaging/capi-mediamuxer.spec b/packaging/capi-mediamuxer.spec index b1ec240..4b58b97 100644 --- a/packaging/capi-mediamuxer.spec +++ b/packaging/capi-mediamuxer.spec @@ -1,6 +1,6 @@ Name: capi-mediamuxer Summary: A Media Muxer library in Tizen Native API -Version: 0.1.19 +Version: 0.1.20 Release: 1 Group: Multimedia/API License: Apache-2.0 diff --git a/src/port_gst/mediamuxer_port_gst.c b/src/port_gst/mediamuxer_port_gst.c index 390c271..d391e29 100644 --- a/src/port_gst/mediamuxer_port_gst.c +++ b/src/port_gst/mediamuxer_port_gst.c @@ -25,7 +25,9 @@ #define WRITE_POLL_PERIOD 100 #define SEND_FULL_CAPS_VIA_CODEC_DATA /* For debug purpose */ #define ASYCHRONOUS_WRITE /* write sample is not blocking */ -#define MEDIA_FORMAT_PCM_MASK 0x1500 + +#define MEDIA_FORMAT_IS_PCM(format) ((format & MEDIA_FORMAT_PCM) == MEDIA_FORMAT_PCM) + static int gst_muxer_init(MMHandleType *pHandle); static int gst_muxer_set_data_sink(MMHandleType pHandle, char *uri, @@ -368,7 +370,7 @@ static GstCaps * __gst_codec_specific_caps(media_format_h format) break; } - if (mimetype & MEDIA_FORMAT_PCM_MASK) { + if (MEDIA_FORMAT_IS_PCM(mimetype)) { if (!new_caps) { MX_E("Fail to make simple caps"); return NULL; @@ -540,7 +542,7 @@ static int gst_muxer_add_track(MMHandleType pHandle, && (mimetype == MEDIA_FORMAT_AAC_LC || mimetype == MEDIA_FORMAT_AAC_HE || mimetype == MEDIA_FORMAT_AAC_HE_PS || mimetype == MEDIA_FORMAT_AMR_NB)) || (mx_handle_gst->muxed_format == MEDIAMUXER_CONTAINER_FORMAT_WAV - && (mimetype & MEDIA_FORMAT_PCM_MASK)) + && (MEDIA_FORMAT_IS_PCM(mimetype))) || (mx_handle_gst->muxed_format == MEDIAMUXER_CONTAINER_FORMAT_AAC_ADTS && (mimetype == MEDIA_FORMAT_AAC)) || (mx_handle_gst->muxed_format == MEDIAMUXER_CONTAINER_FORMAT_AMR_NB @@ -961,7 +963,7 @@ mx_ret_e _gst_create_pipeline(mxgst_handle_t *gst_handle) } else if (mimetype == MEDIA_FORMAT_AMR || mimetype == MEDIA_FORMAT_AMR_NB || mimetype == MEDIA_FORMAT_AMR_WB) { current->parser = gst_element_factory_make("amrparse", str_parser); MX_I("make amrparse element"); - } else if (mimetype & MEDIA_FORMAT_PCM_MASK) { + } else if (MEDIA_FORMAT_IS_PCM(mimetype)) { MX_I("Do Nothing, as there is no need of parser for wav"); } else { MX_I("Do Nothing"); @@ -978,7 +980,7 @@ mx_ret_e _gst_create_pipeline(mxgst_handle_t *gst_handle) gst_bin_add_many(GST_BIN(gst_handle->pipeline), current->appsrc, NULL); if (gst_handle->muxed_format == MEDIAMUXER_CONTAINER_FORMAT_AAC_ADTS - || mimetype & MEDIA_FORMAT_PCM_MASK) { + || MEDIA_FORMAT_IS_PCM(mimetype)) { MX_I("Do Nothing, as there is no need of parser for wav and AAC_ADTS"); } else { if (!current->parser) { @@ -1007,7 +1009,7 @@ mx_ret_e _gst_create_pipeline(mxgst_handle_t *gst_handle) g_object_set(current->appsrc, "max-bytes", 3 * 1024 * 1024, NULL); - if (mimetype & MEDIA_FORMAT_PCM_MASK) + if (MEDIA_FORMAT_IS_PCM(mimetype)) g_object_set(current->appsrc, "do-timestamp", TRUE, NULL); /* For wav, wavenc is muxer */ -- 2.7.4