type = gst_caps_to_string(caps);
if (type) {
MD_I("Media type %s found, probability %d%%\n", type, probability);
- if (strstr(type, "quicktime") || (strstr(type, "audio/x-m4a"))) {
+ if (strstr(type, "quicktime") || (strstr(type, "audio/x-m4a")) || strstr(type, "x-3gp")) {
gst_handle->is_valid_container = true;
gst_handle->demux = gst_element_factory_make("qtdemux", NULL);
if (!gst_handle->demux) {
if (media_format_set_video_height(format, src_height))
goto ERROR;
}
+ } else if (gst_structure_has_name(struc, "video/x-h263")) {
+ gst_structure_get_int(struc, "width", &src_width);
+ gst_structure_get_int(struc, "height", &src_height);
+ if (media_format_set_video_mime(format, MEDIA_FORMAT_H263))
+ goto ERROR;
+ if (media_format_set_video_width(format, src_width))
+ goto ERROR;
+ if (media_format_set_video_height(format, src_height))
+ goto ERROR;
} else {
MD_I("Video mime not supported so far\n");
goto ERROR;
goto ERROR;
if (media_format_set_audio_bit(format, bit))
goto ERROR;
- }
- else {
+ } else if (gst_structure_has_name(struc, "audio/AMR")) {
+ gst_structure_get_int(struc, "channels", &channels);
+ gst_structure_get_int(struc, "rate", &rate);
+ gst_structure_get_int(struc, "bit", &bit);
+ if (media_format_set_audio_mime(format, MEDIA_FORMAT_AMR_NB))
+ goto ERROR;
+ if(channels == 0)
+ channels = 1; /* default */
+ if (media_format_set_audio_channel(format, channels))
+ goto ERROR;
+ if (media_format_set_audio_samplerate(format, rate))
+ goto ERROR;
+ if (bit == 0)
+ bit = 16; /* default */
+ if (media_format_set_audio_bit(format, bit))
+ goto ERROR;
+ } else if (gst_structure_has_name(struc, "audio/AMR-WB")) {
+ gst_structure_get_int(struc, "channels", &channels);
+ gst_structure_get_int(struc, "rate", &rate);
+ gst_structure_get_int(struc, "bit", &bit);
+ if (media_format_set_audio_mime(format, MEDIA_FORMAT_AMR_WB))
+ goto ERROR;
+ if(channels == 0)
+ channels = 1; /* default */
+ if (media_format_set_audio_channel(format, channels))
+ goto ERROR;
+ if (media_format_set_audio_samplerate(format, rate))
+ goto ERROR;
+ if (bit == 0)
+ bit = 16; /* default */
+ if (media_format_set_audio_bit(format, bit))
+ goto ERROR;
+ } else {
MD_I("Audio mime not supported so far\n");
goto ERROR;
}
if (v_mime == MEDIA_FORMAT_H264_SP || v_mime == MEDIA_FORMAT_H264_MP ||
v_mime == MEDIA_FORMAT_H264_HP) {
flag = 10;
- g_print("mediacodec_init_audio() for MEDIACODEC_H264\n");
+ g_print("mediacodec_init_video() for MEDIACODEC_H264\n");
mediacodec_init_video(MEDIACODEC_H264, flag, w, h);
+ } else if (v_mime == MEDIA_FORMAT_H263) {
+ g_print("mediacodec_init_video() for MEDIACODEC_H263\n");
+ flag = 10;
+ mediacodec_init_video(MEDIACODEC_H263, flag, w, h);
} else {
g_print("Not Supported YET- Need to add mime for validating with video codec\n");
return (void *)status;