bool __player_state_validate(player_s *handle, player_state_e threshold)
{
if (handle->state < threshold)
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
static int __set_callback(muse_player_event_e type, player_h player, void *callback, void *user_data)
if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_INTERRUPT]) {
int code = 0;
if (msg->union_type == MM_MSG_UNION_STATE) {
-
handle->state = __convert_player_state(msg->state.current);
LOGD("update player state to %d", handle->state);
if (ret != MM_ERROR_NONE)
LOGW("[%s] Failed to set display surface type 'MM_DISPLAY_SURFACE_NULL' (0x%x)", __FUNCTION__, ret);
} else {
+
+ /* FIXME : new funct path is needed to update video instead of set attr again */
ret = mm_player_get_attribute(handle->mm_handle, NULL, "display_visible", &visible, (char *)NULL);
if (ret != MM_ERROR_NONE) goto ERROR;
PLAYER_CHECK_CONDITION(size >= 0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
player_s *handle = (player_s *)player;
PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
-
char uri[PATH_MAX];
handle->is_media_stream = FALSE;
+
snprintf(uri, sizeof(uri), "mem:///ext=%s,size=%d", "", size);
int ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_CONTENT_URI, uri, strlen(uri), MM_PLAYER_MEMORY_SRC, data, size, (char *)NULL);
if (ret != MM_ERROR_NONE)
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(callback);
-
player_s *handle = (player_s *)player;
- if (handle->state != PLAYER_STATE_IDLE) {
- LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
- return PLAYER_ERROR_INVALID_STATE;
- }
+ PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
int ret = mm_player_set_video_stream_callback(handle->mm_handle, (mm_player_video_stream_callback)callback, user_data);
if (ret != MM_ERROR_NONE)
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(callback);
player_s *handle = (player_s *)player;
-
- if (handle->state != PLAYER_STATE_IDLE) {
- LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
- return PLAYER_ERROR_INVALID_STATE;
- }
+ PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
ret = mm_player_set_video_stream_changed_callback(handle->mm_handle, (mm_player_stream_changed_callback)__video_stream_changed_callback, (void *)handle);
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(callback);
player_s *handle = (player_s *)player;
+ PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
- if (handle->state != PLAYER_STATE_IDLE) {
- LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
- return PLAYER_ERROR_INVALID_STATE;
- }
/* the type can be expaned with default and text. */
if ((type != PLAYER_STREAM_TYPE_VIDEO) && (type != PLAYER_STREAM_TYPE_AUDIO)) {
LOGE("[%s] PLAYER_ERROR_INVALID_PARAMETER(type : %d)", __FUNCTION__, type);
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(callback);
player_s *handle = (player_s *)player;
+ PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
- if (handle->state != PLAYER_STATE_IDLE) {
- LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
- return PLAYER_ERROR_INVALID_STATE;
- }
/* the type can be expaned with default and text. */
if ((type != PLAYER_STREAM_TYPE_VIDEO) && (type != PLAYER_STREAM_TYPE_AUDIO)) {
LOGE("[%s] PLAYER_ERROR_INVALID_PARAMETER(type : %d)", __FUNCTION__, type);
PLAYER_INSTANCE_CHECK(player);
player_s *handle = (player_s *)player;
int ret = MM_ERROR_NONE;
-
- if (handle->state != PLAYER_STATE_IDLE) {
- LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
- return PLAYER_ERROR_INVALID_STATE;
- }
+ PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
ret = mm_player_set_streaming_buffering_time(handle->mm_handle, buffer_ms, rebuffer_ms);
if (ret != MM_ERROR_NONE)