Fix bug of checking the PCM format 71/211271/2 accepted/tizen_5.5_unified_mobile_hotfix tizen_5.5_mobile_hotfix accepted/tizen/5.5/unified/20191031.030930 accepted/tizen/5.5/unified/mobile/hotfix/20201027.065522 accepted/tizen/unified/20190805.042907 submit/tizen/20190805.012955 submit/tizen_5.5/20191031.000002 submit/tizen_5.5_mobile_hotfix/20201026.185102 tizen_5.5.m2_release
authorGilbok Lee <gilbok.lee@samsung.com>
Thu, 1 Aug 2019 02:28:12 +0000 (11:28 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Thu, 1 Aug 2019 06:40:47 +0000 (15:40 +0900)
[Version] 0.1.20
[Issue Type] Fix bugs

Change-Id: I1b6532a28085d8b88ede8b74fe7b38d7a6feab10

packaging/capi-mediamuxer.spec
src/port_gst/mediamuxer_port_gst.c

index b1ec240..4b58b97 100644 (file)
@@ -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
index 390c271..d391e29 100644 (file)
@@ -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 */