MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_INVALID_HANDLE);
/* cleanup stuffs */
- MMPLAYER_FREEIF(player->type);
+ MMPLAYER_FREEIF(player->type_caps_str);
player->no_more_pad = FALSE;
player->num_dynamic_pad = 0;
}
MMPLAYER_FREEIF(player->album_art);
- if (player->type_caps) {
- gst_caps_unref(player->type_caps);
- player->type_caps = NULL;
- }
-
if (player->v_stream_caps) {
gst_caps_unref(player->v_stream_caps);
player->v_stream_caps = NULL;
MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
MMPLAYER_RETURN_VAL_IF_FAIL(duration, MM_ERROR_COMMON_INVALID_ARGUMENT);
- if (g_strrstr(player->type, "video/mpegts"))
+ if (g_strrstr(player->type_caps_str, "video/mpegts"))
__mmplayer_update_duration_value(player);
*duration = player->duration;
__mmplayer_update_content_type_info(mmplayer_t *player)
{
MMPLAYER_FENTER();
- MMPLAYER_RETURN_IF_FAIL(player && player->type);
+ MMPLAYER_RETURN_IF_FAIL(player && player->type_caps_str);
- if (__mmplayer_is_midi_type(player->type)) {
+ if (__mmplayer_is_midi_type(player->type_caps_str)) {
player->bypass_audio_effect = TRUE;
return;
}
return;
}
- if (g_strrstr(player->type, "application/x-hls")) {
+ if (g_strrstr(player->type_caps_str, "application/x-hls")) {
/* If it can't know exact type when it parses uri because of redirection case,
* it will be fixed by typefinder or when doing autoplugging.
*/
player->profile.uri_type = MM_PLAYER_URI_TYPE_HLS;
player->streamer->is_adaptive_streaming = TRUE;
- } else if (g_strrstr(player->type, "application/dash+xml")) {
+ } else if (g_strrstr(player->type_caps_str, "application/dash+xml")) {
player->profile.uri_type = MM_PLAYER_URI_TYPE_DASH;
player->streamer->is_adaptive_streaming = TRUE;
}
/* in case of TS, fixed buffering mode should be used because player can not get exact duration time */
- if ((player->streamer->is_adaptive_streaming) || (g_strrstr(player->type, "video/mpegts"))) {
+ if ((player->streamer->is_adaptive_streaming) || (g_strrstr(player->type_caps_str, "video/mpegts"))) {
player->streamer->buffering_req.mode = MM_PLAYER_BUFFERING_MODE_FIXED;
if (player->streamer->buffering_req.rebuffer_time <= MIN_BUFFERING_TIME) { /* if user did not set the rebuffer value */
MMPLAYER_RETURN_IF_FAIL(player && tf && caps);
- /* store type string */
- if (player->type_caps) {
- gst_caps_unref(player->type_caps);
- player->type_caps = NULL;
- }
-
- player->type_caps = gst_caps_copy(caps);
- MMPLAYER_LOG_GST_CAPS_TYPE(player->type_caps);
-
- MMPLAYER_FREEIF(player->type);
- player->type = gst_caps_to_string(caps);
- if (player->type)
+ MMPLAYER_LOG_GST_CAPS_TYPE(caps);
+ MMPLAYER_FREEIF(player->type_caps_str);
+ player->type_caps_str = gst_caps_to_string(caps);
+ if (player->type_caps_str)
LOGD("[handle: %p] media type %s found, probability %d%% / %d",
- player, player->type, probability, gst_caps_get_size(caps));
+ player, player->type_caps_str, probability, gst_caps_get_size(caps));
if ((!MMPLAYER_IS_RTSP_STREAMING(player)) &&
- (g_strrstr(player->type, "audio/x-raw-int"))) {
+ (g_strrstr(player->type_caps_str, "audio/x-raw-int"))) {
LOGE("not support media format");
if (player->msg_posted == FALSE) {
if (!_mmplayer_gst_create_decoder(player, pad, caps)) {
gboolean async = FALSE;
- LOGE("failed to autoplug %s", player->type);
+ LOGE("failed to autoplug %s", player->type_caps_str);
mm_attrs_get_int_by_name(player->attrs, "profile_prepare_async", &async);
/* NOTE : in case of ts streaming, player could not get the correct duration info *
* skip the pull mode(file or ring buffering) setting. */
if (dur_bytes > 0) {
- if (!g_strrstr(player->type, "video/mpegts")) {
+ if (!g_strrstr(player->type_caps_str, "video/mpegts")) {
type = MUXED_BUFFER_TYPE_MEM_RING_BUFFER;
player->streamer->ring_buffer_size = player->ini.http_ring_buffer_size;
}
this function need to be updated according to the supported media format
@see player->ini.audio_offload_media_format */
- if (__mmplayer_is_only_mp3_type(player->type)) {
+ if (__mmplayer_is_only_mp3_type(player->type_caps_str)) {
LOGD("offload supportable media format type");
return TRUE;
}
MMPLAYER_FENTER();
MMPLAYER_RETURN_VAL_IF_FAIL(player && player->attrs, FALSE);
- LOGD("current stream : %s, sink: %s", player->type, player->ini.audio_offload_sink_element);
+ LOGD("current stream : %s, sink: %s", player->type_caps_str, player->ini.audio_offload_sink_element);
if (!__mmplayer_is_offload_supported_type(player))
goto DONE;
LOGD("[handle: %p] found new element [%s] to link", player, factory_name);
/* store type string */
- if (player->type == NULL) {
- player->type = gst_caps_to_string(caps);
+ if (player->type_caps_str == NULL) {
+ player->type_caps_str = gst_caps_to_string(caps);
__mmplayer_update_content_type_info(player);
}
player->pipeline->mainbin[MMPLAYER_M_ADAPTIVE_DEMUX].id = MMPLAYER_M_ADAPTIVE_DEMUX;
player->pipeline->mainbin[MMPLAYER_M_ADAPTIVE_DEMUX].gst = element;
- MMPLAYER_FREEIF(player->type);
+ MMPLAYER_FREEIF(player->type_caps_str);
if (g_strrstr(factory_name, "hlsdemux")) {
- player->type = g_strdup("application/x-hls");
+ player->type_caps_str = g_strdup("application/x-hls");
player->profile.uri_type = MM_PLAYER_URI_TYPE_HLS;
} else if (g_strrstr(factory_name, "dashdemux")) {
- player->type = g_strdup("application/dash+xml");
+ player->type_caps_str = g_strdup("application/dash+xml");
player->profile.uri_type = MM_PLAYER_URI_TYPE_DASH;
} else {
LOGE("not supported type");
if (g_strrstr(factory_name, "mpegaudioparse")) {
if ((MMPLAYER_IS_HTTP_STREAMING(player)) &&
- (__mmplayer_is_only_mp3_type(player->type))) {
+ (__mmplayer_is_only_mp3_type(player->type_caps_str))) {
LOGD("[mpegaudioparse] set streaming pull mode.");
g_object_set(G_OBJECT(element), "http-pull-mp3dec", TRUE, NULL);
}
* So, if it's not set yet, fill it with found data.
*/
if (!audio_codec) {
- if (g_strrstr(player->type, "audio/midi"))
+ if (g_strrstr(player->type_caps_str, "audio/midi"))
audio_codec = "MIDI";
- else if (g_strrstr(player->type, "audio/x-amr"))
+ else if (g_strrstr(player->type_caps_str, "audio/x-amr"))
audio_codec = "AMR";
- else if (g_strrstr(player->type, "audio/mpeg")
- && !g_strrstr(player->type, "mpegversion=(int)1"))
+ else if (g_strrstr(player->type_caps_str, "audio/mpeg")
+ && !g_strrstr(player->type_caps_str, "mpegversion=(int)1"))
audio_codec = "AAC";
else
audio_codec = "unknown";