From: Eunhae Choi Date: Mon, 8 Oct 2018 06:06:25 +0000 (+0900) Subject: [0.3.103] modify the seek cb handler X-Git-Tag: submit/tizen/20181109.060212~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=53d1d456f46d27d33b07745ee7098b4310d090b5;p=platform%2Fcore%2Fapi%2Fplayer.git [0.3.103] modify the seek cb handler - modify code to help code reading for each state case Change-Id: I9a212978ccc4b01fe3ec5ad5d00a944e82c41ca2 --- diff --git a/include/player.h b/include/player.h index 8b5d545..4f1cfae 100644 --- a/include/player.h +++ b/include/player.h @@ -2451,7 +2451,7 @@ int player_get_video_roi_area(player_h player, double *x_scale, double *y_scale, * @brief Sets the streaming buffering time. * @since_tizen 4.0 * @param[in] player The handle to the media player - * @param[in] prebuffer_ms The time duration of buffering data that must be prerolled to start playback. + * @param[in] prebuffer_ms The time duration of buffering data that must be prerolled to start playback * @param[in] rebuffer_ms The time duration of buffering data that must be prerolled to resume playback * if player is paused for buffering internally. * @return @c 0 on success, @@ -2469,7 +2469,7 @@ int player_set_streaming_buffering_time(player_h player, int prebuffer_ms, int r * @brief Gets the streaming buffering time. * @since_tizen 4.0 * @param[in] player The handle to the media player - * @param[out] prebuffer_ms The time duration of buffering data that must be prerolled to start playback. + * @param[out] prebuffer_ms The time duration of buffering data that must be prerolled to start playback * @param[out] rebuffer_ms The time duration of buffering data that must be prerolled to resume playback * if player enters pause state for buffering. * @return @c 0 on success, diff --git a/packaging/capi-media-player.spec b/packaging/capi-media-player.spec index caa9c0a..8e4c4c3 100644 --- a/packaging/capi-media-player.spec +++ b/packaging/capi-media-player.spec @@ -1,6 +1,6 @@ Name: capi-media-player Summary: A Media Player API -Version: 0.3.102 +Version: 0.3.103 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/player.c b/src/player.c index 6505597..2956c5b 100644 --- a/src/player.c +++ b/src/player.c @@ -470,6 +470,8 @@ static void set_null_user_cb_lock(callback_cb_info_s * cb_info, muse_player_even { bool lock = false; + LOGD("event %d cb will be cleared", event); + if (!cb_info) { LOGE("cb_info is NULL, event: %d", event); return; @@ -679,7 +681,15 @@ static void __seek_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *r int (*p_disp_set_evas_display_visible)(void *, bool) = NULL; #endif g_mutex_lock(&cb_info->seek_cb_mutex); - if (cb_info->user_cb[ev] && cb_info->seek_cb_state == PLAYER_SEEK_CB_STATE_NONE) { + + switch (cb_info->seek_cb_state) { + case PLAYER_SEEK_CB_STATE_NONE: + { + if (!cb_info->user_cb[ev]) { + LOGW("invalid seek callback info, skip"); + break; + } + #ifdef TIZEN_FEATURE_EVAS_RENDERER if (cb_info->evas_info && cb_info->evas_info->support_video) { if (cb_info->evas_info->handle && cb_info->evas_info->visible != EVAS_VISIBLE_FALSE) { @@ -701,9 +711,18 @@ static void __seek_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *r LOGD("call seek cb"); ((player_seek_completed_cb) cb_info->user_cb[ev]) (cb_info->user_data[ev]); set_null_user_cb(cb_info, ev); - } else { - LOGW("ignored. seek cb %p", cb_info->user_cb[ev]); + + break; } + case PLAYER_SEEK_CB_STATE_DROP: + case PLAYER_SEEK_CB_STATE_WAIT: /* not expected */ + LOGW("ignored. seek cb %p, state %d", cb_info->user_cb[ev], cb_info->seek_cb_state); + break; + default: + LOGE("invalid state value"); + break; + } + g_mutex_unlock(&cb_info->seek_cb_mutex); } @@ -2002,7 +2021,7 @@ int player_destroy(player_h player) #ifdef TIZEN_FEATURE_EVAS_RENDERER int (*p_disp_destroy_evas_display)(void **) = NULL; #endif - LOGD("ENTER"); + LOGD("ENTER %p", pc); /* clear cb and release mem */ set_null_user_cb_lock(pc->cb_info, MUSE_PLAYER_EVENT_TYPE_SEEK); @@ -2087,7 +2106,7 @@ int player_prepare(player_h player) player_cli_s *pc = (player_cli_s *) player; char *ret_buf = NULL; - LOGD("ENTER"); + LOGD("ENTER %p", pc); PLAYER_SEND_MSG(api, pc, ret_buf, ret); if (ret == PLAYER_ERROR_NONE) { @@ -2114,7 +2133,7 @@ int player_unprepare(player_h player) int (*p_disp_evas_display_retrieve_all_packets)(void *, bool) = NULL; player_state_e state = PLAYER_STATE_NONE; - LOGD("ENTER"); + LOGD("ENTER %p", pc); if (_get_current_state(pc, &state) != PLAYER_ERROR_NONE) { LOGE("Failed to get state"); @@ -2483,7 +2502,7 @@ int player_start(player_h player) player_cli_s *pc = (player_cli_s *) player; char *ret_buf = NULL; - LOGD("ENTER"); + LOGD("ENTER %p", pc); #ifdef TIZEN_FEATURE_EVAS_RENDERER int (*p_disp_set_evas_display_visible)(void *, bool) = NULL; @@ -2521,7 +2540,7 @@ int player_stop(player_h player) #ifdef TIZEN_FEATURE_EVAS_RENDERER int (*p_disp_set_evas_display_visible)(void *, bool) = NULL; #endif - LOGD("ENTER"); + LOGD("ENTER %p", pc); /* check player state */ if (_get_current_state(pc, &state) != PLAYER_ERROR_NONE) { @@ -2566,7 +2585,7 @@ int player_pause(player_h player) player_cli_s *pc = (player_cli_s *) player; char *ret_buf = NULL; - LOGD("ENTER"); + LOGD("ENTER %p", pc); PLAYER_SEND_MSG(api, pc, ret_buf, ret); g_free(ret_buf); @@ -2585,7 +2604,7 @@ static int _set_play_position(player_h player, int64_t pos, bool accurate, playe player_cli_s *pc = (player_cli_s *) player; char *ret_buf = NULL; - LOGD("ENTER"); + LOGD("ENTER %p", pc); if (!pc->cb_info) { LOGE("cb_info is null");