#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,
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;
&& (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
} 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");
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) {
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 */