From: Eunhae Choi Date: Tue, 17 May 2016 11:46:48 +0000 (+0900) Subject: add new api to get drc info of media stream X-Git-Tag: accepted/tizen/common/20160519.191319^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F66%2F69966%2F3;p=platform%2Fcore%2Fapi%2Fplayer.git add new api to get drc info of media stream Change-Id: Ib4d567d2b473315f47c929594a4ec639e6c562d1 --- diff --git a/include/common/player_internal.h b/include/common/player_internal.h index 0a90072..fc0db0d 100644 --- a/include/common/player_internal.h +++ b/include/common/player_internal.h @@ -222,6 +222,47 @@ int player_set_media_stream_buffer_status_cb_ex(player_h player, player_stream_t */ int player_unset_media_stream_buffer_status_cb_ex(player_h player, player_stream_type_e type); +/** + * @brief Sets DRC(dynamic resolution change) information of media stream data. + * @since_tizen 3.0 + * @remarks This API is used for media stream playback only. + * If the hw codec can not support drc, app have to set DRC information before calling player_prepare(). + * @param[in] player The handle to the media player + * @param[in] drc The drc status: (@c true = drc, @c false = non drc) + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PLAYER_ERROR_NONE Successful + * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state + * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter + * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). + */ +int player_set_media_stream_dynamic_resolution(player_h player, bool drc); + +#ifdef HAVE_WAYLAND +/** + * @brief Sets the ecore wayland video display. + * @since_tizen 3.0 + * @remarks This API support PLAYER_DISPLAY_TYPE_OVERLAY type only. + * @param[in] player The handle to the media player + * @param[in] type The display type + * @param[in] ecore_wl_window The ecore wayland window handle + * @param[in] x the x coordinate of window + * @param[in] y the y coordinate of window + * @param[in] width the width of window + * @param[in] height the height of window + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PLAYER_ERROR_NONE Successful + * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation + * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state + * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. + * @see player_set_display_rotation + */ +int player_set_ecore_wl_display(player_h player, player_display_type_e type, Ecore_Wl_Window *ecore_wl_window, int x, int y, int width, int height); + +#endif + #ifdef TIZEN_TV /** * @brief Called when no free space in buffer. @@ -382,31 +423,6 @@ int player_set_display_parent_win_id(player_h player, int win_id); #endif -#ifdef HAVE_WAYLAND -/** - * @brief Sets the ecore wayland video display. - * @since_tizen 3.0 - * @remarks This API support PLAYER_DISPLAY_TYPE_OVERLAY type only. - * @param[in] player The handle to the media player - * @param[in] type The display type - * @param[in] ecore_wl_window The ecore wayland window handle - * @param[in] x the x coordinate of window - * @param[in] y the y coordinate of window - * @param[in] width the width of window - * @param[in] height the height of window - * @return @c 0 on success, - * otherwise a negative error value - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED. - * @see player_set_display_rotation - */ -int player_set_ecore_wl_display(player_h player, player_display_type_e type, Ecore_Wl_Window *ecore_wl_window, int x, int y, int width, int height); - -#endif - /** * @} */ diff --git a/include/wearable/player_internal.h b/include/wearable/player_internal.h index 16c9cf4..d046b2c 100644 --- a/include/wearable/player_internal.h +++ b/include/wearable/player_internal.h @@ -158,6 +158,22 @@ int player_set_media_stream_buffer_status_cb_ex(player_h player, player_stream_t */ int player_unset_media_stream_buffer_status_cb_ex(player_h player, player_stream_type_e type); +/** + * @brief Sets DRC(dynamic resolution change) information of media stream data. + * @since_tizen 3.0 + * @remarks This API is used for media stream playback only. + * If the hw codec can not support drc, app have to set DRC information before calling player_prepare(). + * @param[in] player The handle to the media player + * @param[in] drc The drc status: (@c true = drc, @c false = non drc) + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PLAYER_ERROR_NONE Successful + * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state + * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter + * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). + */ +int player_set_media_stream_dynamic_resolution(player_h player, bool drc); + #ifdef HAVE_WAYLAND /** * @brief Sets the ecore wayland video display. diff --git a/packaging/capi-media-player.spec b/packaging/capi-media-player.spec index 241407d..21bb7f6 100644 --- a/packaging/capi-media-player.spec +++ b/packaging/capi-media-player.spec @@ -3,7 +3,7 @@ Name: capi-media-player Summary: A Media Player API -Version: 0.3.6 +Version: 0.3.7 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/player.c b/src/player.c index 52f74d9..a5bd87c 100644 --- a/src/player.c +++ b/src/player.c @@ -485,8 +485,7 @@ static void __seek_cb_handler(callback_cb_info_s * cb_info, char *recvMsg) 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 { + } else { LOGW("ignored. seek cb %p, block %d", cb_info->user_cb[ev], cb_info->block_seek_cb); } g_mutex_unlock(&cb_info->seek_cb_mutex); @@ -903,23 +902,23 @@ static void _player_event_queue_destroy(callback_cb_info_s * cb_info) } -static void _player_event_queue_remove (player_event_queue * ev_queue, int ev) +static void _player_event_queue_remove(player_event_queue * ev_queue, int ev) { GList *item; g_mutex_lock(&ev_queue->qlock); - item = g_queue_peek_head_link (ev_queue->queue); + item = g_queue_peek_head_link(ev_queue->queue); while (item) { GList *next = item->next; _player_cb_data *cb_data = (_player_cb_data *)item->data; if (cb_data && cb_data->int_data == ev) { - LOGD ("removing '%p (ev:%d)' from event queue", cb_data, cb_data->int_data); + LOGD("removing '%p (ev:%d)' from event queue", cb_data, cb_data->int_data); g_free(cb_data->buf); g_free(cb_data); - g_queue_delete_link (ev_queue->queue, item); + g_queue_delete_link(ev_queue->queue, item); } item = next; } diff --git a/src/player_internal.c b/src/player_internal.c index 76447c0..3e9a944 100644 --- a/src/player_internal.c +++ b/src/player_internal.c @@ -258,6 +258,21 @@ int player_unset_evas_object_cb(player_h player) return MM_ERROR_NONE; } +int player_set_media_stream_dynamic_resolution(player_h player, bool drc) +{ + PLAYER_INSTANCE_CHECK(player); + int ret = PLAYER_ERROR_NONE; + muse_player_api_e api = MUSE_PLAYER_API_SET_MEDIA_STREAM_DYNAMIC_RESOLUTION; + player_cli_s *pc = (player_cli_s *) player; + char *ret_buf = NULL; + + LOGD("ENTER"); + + player_msg_send1(api, pc, ret_buf, ret, INT, drc); + g_free(ret_buf); + return ret; +} + #ifdef HAVE_WAYLAND int player_set_ecore_wl_display(player_h player, player_display_type_e type, Ecore_Wl_Window *ecore_wl_window, int x, int y, int width, int height) { @@ -274,7 +289,7 @@ int player_set_ecore_wl_display(player_h player, player_display_type_e type, Eco Ecore_Wl_Window *wl_window = NULL; LOGD("ENTER"); - if (type !=PLAYER_DISPLAY_TYPE_OVERLAY) { + if (type != PLAYER_DISPLAY_TYPE_OVERLAY) { LOGE("Display type(%d) is not overlay", type); return PLAYER_ERROR_INVALID_PARAMETER; }