if (player->media_stream_buffer_status_cb[type]) {
if (!callback)
- LOGD("[type:%d] will be clear.\n", type);
+ LOGD("[type:%s] will be clear", MMPLAYER_STREAM_TYPE_GET_NAME(type));
else
- LOGD("[type:%d] will be overwritten.\n", type);
+ LOGD("[type:%s] will be overwritten", MMPLAYER_STREAM_TYPE_GET_NAME(type));
}
player->media_stream_buffer_status_cb[type] = callback;
player->buffer_cb_user_param[type] = user_param;
- LOGD("player handle %p, type %d, callback %p\n", player, type,
- player->media_stream_buffer_status_cb[type]);
+ LOGD("player handle %p, type %s, callback %p",
+ player, MMPLAYER_STREAM_TYPE_GET_NAME(type), player->media_stream_buffer_status_cb[type]);
MMPLAYER_MEDIA_STREAM_CALLBACK_UNLOCK(player);
MMPLAYER_FLEAVE();
if (player->media_stream_seek_data_cb[type]) {
if (!callback)
- LOGD("[type:%d] will be clear.\n", type);
+ LOGD("[type:%s] will be clear", MMPLAYER_STREAM_TYPE_GET_NAME(type));
else
- LOGD("[type:%d] will be overwritten.\n", type);
+ LOGD("[type:%s] will be overwritten", MMPLAYER_STREAM_TYPE_GET_NAME(type));
}
player->media_stream_seek_data_cb[type] = callback;
player->seek_cb_user_param[type] = user_param;
- LOGD("player handle %p, type %d, callback %p\n", player, type,
- player->media_stream_seek_data_cb[type]);
+ LOGD("player handle %p, type %s, callback %p",
+ player, MMPLAYER_STREAM_TYPE_GET_NAME(type), player->media_stream_seek_data_cb[type]);
MMPLAYER_MEDIA_STREAM_CALLBACK_UNLOCK(player);
MMPLAYER_FLEAVE();
return MM_ERROR_INVALID_ARGUMENT;
}
- LOGD("type %d, max_size %llu\n", type, max_size);
+ LOGD("type:%s, max_size %llu", MMPLAYER_STREAM_TYPE_GET_NAME(type), max_size);
if ((element = __mmplayer_get_source_element(player, type))) {
- LOGD("update max_size of %s\n", GST_ELEMENT_NAME(element));
+ LOGD("update max_size of %s", GST_ELEMENT_NAME(element));
g_object_set(G_OBJECT(element), "max-bytes", max_size, NULL);
}
return MM_ERROR_INVALID_ARGUMENT;
}
- LOGD("type %d, min_per %u\n", type, min_percent);
+ LOGD("type:%s, min_per %u", MMPLAYER_STREAM_TYPE_GET_NAME(type), min_percent);
if ((element = __mmplayer_get_source_element(player, type))) {
- LOGD("update min_per of %s\n", GST_ELEMENT_NAME(element));
+ LOGD("update min_per of %s", GST_ELEMENT_NAME(element));
g_object_set(G_OBJECT(element), "min-percent", min_percent, NULL);
}
g_object_get(G_OBJECT(element), "max-bytes", &max_bytes, NULL);
if (max_bytes == 0) {
- LOGW("buffer max size is zero.");
+ LOGW("buffer max size is zero");
return MM_ERROR_NONE;
}
g_object_get(G_OBJECT(element), "current-level-bytes", ¤t_level_bytes, NULL);
if (max_bytes <= current_level_bytes) {
- LOGE("no available buffer space. type %d, max %"G_GUINT64_FORMAT", curr %"G_GUINT64_FORMAT, type, max_bytes, current_level_bytes);
+ LOGE("no available buffer space, type: %s, max %"G_GUINT64_FORMAT", curr %"G_GUINT64_FORMAT,
+ MMPLAYER_STREAM_TYPE_GET_NAME(type), max_bytes, current_level_bytes);
return MM_ERROR_PLAYER_BUFFER_SPACE;
}
current_level_per = (guint)(gst_util_guint64_to_gdouble(current_level_bytes)/gst_util_guint64_to_gdouble(max_bytes)*100);
- LOGD("type %d, min_per %u, curr_per %u max %"G_GUINT64_FORMAT" cur %"G_GUINT64_FORMAT,
- type, player->media_stream_buffer_min_percent[type],
+ LOGD("type: %s, min_per %u, curr_per %u max %"G_GUINT64_FORMAT" cur %"G_GUINT64_FORMAT,
+ MMPLAYER_STREAM_TYPE_GET_NAME(type), player->media_stream_buffer_min_percent[type],
current_level_per,
player->media_stream_buffer_max_size[type],
current_level_bytes);
goto ERROR;
}
+ if (MMPLAYER_CURRENT_STATE(player) != MM_PLAYER_STATE_PLAYING) {
+ /* the pushed pts should be lager than current position if it is not in playing state. */
+ LOGD("type:%s, curr pos: %"G_GINT64_FORMAT", pushed pts:%"G_GINT64_FORMAT", size:%"G_GUINT64_FORMAT,
+ MMPLAYER_STREAM_TYPE_GET_NAME(streamtype), player->last_position, (GstClockTime)pts, (guint64)size);
+ }
+
gst_app_src_push_buffer(GST_APP_SRC(element), _buffer);
+ } else {
+ LOGW("There is no data to push : buf %p, size %"G_GUINT64_FORMAT, buf, (guint64)size);
}
/* check eos */
}
if (is_eos) {
- LOGW("we got eos of stream type(%d)", streamtype);
+ LOGW("we got eos of stream type(%s)", MMPLAYER_STREAM_TYPE_GET_NAME(streamtype));
g_signal_emit_by_name(element, "end-of-stream", &ret);
}
g_object_get(G_OBJECT(element), "current-level-bytes", ¤t_level_bytes, NULL);
- LOGI("app-src: feed audio(%llu)\n", current_level_bytes);
+ LOGI("app-src: feed audio(%llu)", current_level_bytes);
MMPLAYER_MEDIA_STREAM_CALLBACK_LOCK(player);
if (player->media_stream_buffer_status_cb[type])
g_object_get(G_OBJECT(element), "current-level-bytes", ¤t_level_bytes, NULL);
- LOGI("app-src: feed video(%llu)\n", current_level_bytes);
+ LOGI("app-src: feed video(%llu)", current_level_bytes);
MMPLAYER_MEDIA_STREAM_CALLBACK_LOCK(player);
if (player->media_stream_buffer_status_cb[type])
MMPLAYER_RETURN_IF_FAIL(player);
- LOGI("app-src: feed subtitle\n");
+ LOGI("app-src: feed subtitle");
g_object_get(G_OBJECT(element), "current-level-bytes", ¤t_level_bytes, NULL);
MMPLAYER_RETURN_IF_FAIL(player);
- LOGI("app-src: audio buffer is full.\n");
+ LOGI("app-src: audio buffer is full");
g_object_get(G_OBJECT(element), "current-level-bytes", ¤t_level_bytes, NULL);
MMPLAYER_RETURN_IF_FAIL(player);
- LOGI("app-src: video buffer is full.\n");
+ LOGI("app-src: video buffer is full");
g_object_get(G_OBJECT(element), "current-level-bytes", ¤t_level_bytes, NULL);
MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
- LOGD("app-src: seek audio data %llu\n", position);
+ LOGD("app-src: seek audio data %llu", position);
MMPLAYER_MEDIA_STREAM_CALLBACK_LOCK(player);
if (player->media_stream_seek_data_cb[type])
MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
- LOGD("app-src: seek video data %llu\n", position);
+ LOGD("app-src: seek video data %llu", position);
MMPLAYER_MEDIA_STREAM_CALLBACK_LOCK(player);
if (player->media_stream_seek_data_cb[type])
player->media_stream_seek_data_cb[type](type, position, player->seek_cb_user_param[type]);
MMPLAYER_RETURN_VAL_IF_FAIL(player, FALSE);
- LOGD("app-src: seek subtitle data\n");
+ LOGD("app-src: seek subtitle data");
MMPLAYER_MEDIA_STREAM_CALLBACK_LOCK(player);
if (player->media_stream_seek_data_cb[type])
break;
default:
- LOGE("Invalid stream type %d", stream_type);
+ LOGE("Invalid stream type %s", MMPLAYER_STREAM_TYPE_GET_NAME(stream_type));
return MM_ERROR_COMMON_INVALID_ARGUMENT;
break;
}