add new api to get drc info of media stream 66/69966/3 accepted/tizen/common/20160519.191319 accepted/tizen/ivi/20160519.085122 accepted/tizen/mobile/20160519.085054 accepted/tizen/tv/20160519.085036 accepted/tizen/wearable/20160519.085018 submit/tizen/20160519.011519
authorEunhae Choi <eunhae1.choi@samsung.com>
Tue, 17 May 2016 11:46:48 +0000 (20:46 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Tue, 17 May 2016 13:25:11 +0000 (22:25 +0900)
Change-Id: Ib4d567d2b473315f47c929594a4ec639e6c562d1

include/common/player_internal.h
include/wearable/player_internal.h
packaging/capi-media-player.spec
src/player.c
src/player_internal.c

index 0a90072..fc0db0d 100644 (file)
@@ -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
-
 /**
  * @}
  */
index 16c9cf4..d046b2c 100644 (file)
@@ -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.
index 241407d..21bb7f6 100644 (file)
@@ -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
index 52f74d9..a5bd87c 100644 (file)
@@ -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;
        }
index 76447c0..3e9a944 100644 (file)
@@ -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;
        }