add new api to set roi 88/85988/7
authorNAMJEONGYOON <just.nam@samsung.com>
Tue, 30 Aug 2016 05:01:15 +0000 (14:01 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Tue, 6 Sep 2016 05:13:19 +0000 (14:13 +0900)
Change-Id: I3235ba498a1d3c52d589a91778185d0fe174f97e

include/common/player.h
include/wearable/player.h
test/player_test.c

index 5b1aa43..8726c5f 100644 (file)
@@ -195,7 +195,7 @@ typedef enum {
        PLAYER_DISPLAY_MODE_FULL_SCREEN,        /**< Full-screen */
        PLAYER_DISPLAY_MODE_CROPPED_FULL,       /**< Cropped full-screen */
        PLAYER_DISPLAY_MODE_ORIGIN_OR_LETTER,   /**< Origin size (if surface size is larger than video size(width/height)) or Letter box (if video size(width/height) is larger than surface size) */
-       PLAYER_DISPLAY_MODE_DST_ROI,            /**< Dst ROI mode (Deprecated since [3.0]).*/
+       PLAYER_DISPLAY_MODE_DST_ROI,            /**< Dst ROI mode */
        PLAYER_DISPLAY_MODE_NUM
 } player_display_mode_e;
 
@@ -350,7 +350,7 @@ typedef void (*player_video_captured_cb)(unsigned char *data, int width, int hei
  *
  * @remarks This function is issued in the context of gstreamer so the UI update code should not be directly invoked.\n
  *          the packet should be released by media_packet_destroy() after use. \n
- *          Otherwises, decoder can't work more because it can't have enough buffer to fill decoded frame.
+ *          Otherwise, decoder can't work more because it can't have enough buffer to fill decoded frame.
  *
  * @param[in] pkt Reference pointer to the media packet
  * @param[in] user_data The user data passed from the callback registration function
@@ -407,7 +407,7 @@ typedef void (*player_video_stream_changed_cb) (int width, int height, int fps,
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_OUT_OF_MEMORY Out of memory
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
- * @retval #PLAYER_ERROR_RESOURCE_LIMIT Cannot create more instace due to resource(socket, thread, etc) limitation on system.
+ * @retval #PLAYER_ERROR_RESOURCE_LIMIT Cannot create more instance due to resource(socket, thread, etc) limitation on system.
  * @post The player state will be #PLAYER_STATE_IDLE.
  * @see player_destroy()
  */
@@ -892,10 +892,10 @@ int player_set_display(player_h player, player_display_type_e type, player_displ
  *          A registered callback is called on the internal thread of the player. \n
  *          A video frame can be retrieved using a registered callback as a media packet.\n
  *          The callback function holds the same buffer that will be drawn on the display device.\n
- *          So if you change the media packet in a registerd callback, it will be displayed on the device\n
+ *          So if you change the media packet in a registered callback, it will be displayed on the device\n
  *          and the media packet is available until it's destroyed by media_packet_destroy().\n
  *          The packet have to be destroyed as quickly as possible after rendering the packet\n
- *          and all the packets have to be destoryed before player_unprepare() is called.\n
+ *          and all the packets have to be destroyed before player_unprepare() is called.\n
  * @param[in] player The handle to the media player
  * @param[in] callback The callback function to be registered
  * @param[in] user_data The user data to be passed to the callback function
@@ -1149,6 +1149,23 @@ int player_set_display_mode(player_h player, player_display_mode_e mode);
 int player_get_display_mode(player_h player, player_display_mode_e *mode);
 
 /**
+ * @brief Sets the ROI(Region Of Interest) area of display.
+ * @since_tizen 3.0
+ * @remarks Before set display ROI area, #PLAYER_DISPLAY_MODE_DST_ROI should be set with player_set_display_mode().
+ *          The minimum value of width and height are 1.
+ * @param[in] player The handle to the media player
+ * @param[in] x X coordinate of area
+ * @param[in] y Y coordinate of area
+ * @param[in] width Width of area
+ * @param[in] height Height of area
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval  #PLAYER_ERROR_NONE Successful
+ * @retval  #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int player_set_display_roi_area(player_h player, int x, int y, int width, int height);
+
+/**
  * @brief Sets the visibility of the x surface video display
  * @since_tizen 2.3
  * @param[in] player   The handle to the media player
index d8e902a..cdafc2b 100755 (executable)
@@ -194,7 +194,7 @@ typedef enum {
        PLAYER_DISPLAY_MODE_FULL_SCREEN,        /**< Full-screen */
        PLAYER_DISPLAY_MODE_CROPPED_FULL,       /**< Cropped full-screen */
        PLAYER_DISPLAY_MODE_ORIGIN_OR_LETTER,   /**< Origin size (if surface size is larger than video size(width/height)) or Letter box (if video size(width/height) is larger than surface size) */
-       PLAYER_DISPLAY_MODE_DST_ROI,                    /**< Dst ROI mode (Deprecated since [3.0]).*/
+       PLAYER_DISPLAY_MODE_DST_ROI,                    /**< Dst ROI mode */
        PLAYER_DISPLAY_MODE_NUM
 } player_display_mode_e;
 
@@ -349,7 +349,7 @@ typedef void (*player_video_captured_cb)(unsigned char *data, int width, int hei
  *
  * @remarks This function is issued in the context of gstreamer so the UI update code should not be directly invoked.\n
  *          the packet should be released by media_packet_destroy() after use. \n
- *          Otherwises, decoder can't work more because it can't have enough buffer to fill decoded frame.
+ *          Otherwise, decoder can't work more because it can't have enough buffer to fill decoded frame.
  *
  * @param[in] pkt Reference pointer to the media packet
  * @param[in] user_data The user data passed from the callback registration function
@@ -405,7 +405,7 @@ typedef void (*player_video_stream_changed_cb) (int width, int height, int fps,
  * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #PLAYER_ERROR_OUT_OF_MEMORY Out of memory
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
- * @retval #PLAYER_ERROR_RESOURCE_LIMIT Cannot create more instace due to resource(socket, thread, etc) limitation on system.
+ * @retval #PLAYER_ERROR_RESOURCE_LIMIT Cannot create more instance due to resource(socket, thread, etc) limitation on system.
  * @post The player state will be #PLAYER_STATE_IDLE.
  * @see player_destroy()
  */
@@ -890,10 +890,10 @@ int player_set_display(player_h player, player_display_type_e type, player_displ
  *          A registered callback is called on the internal thread of the player. \n
  *          A video frame can be retrieved using a registered callback as a media packet.\n
  *          The callback function holds the same buffer that will be drawn on the display device.\n
- *          So if you change the media packet in a registerd callback, it will be displayed on the device\n
+ *          So if you change the media packet in a registered callback, it will be displayed on the device\n
  *          and the media packet is available until it's destroyed by media_packet_destroy().\n
  *          The packet have to be destroyed as quickly as possible after rendering the packet\n
- *          and all the packets have to be destoryed before player_unprepare() is called.\n
+ *          and all the packets have to be destroyed before player_unprepare() is called.\n
  * @param[in] player The handle to the media player
  * @param[in] callback The callback function to be registered
  * @param[in] user_data The user data to be passed to the callback function
@@ -1147,6 +1147,23 @@ int player_set_display_mode(player_h player, player_display_mode_e mode);
 int player_get_display_mode(player_h player, player_display_mode_e *mode);
 
 /**
+ * @brief Sets the ROI(Region Of Interest) area of display.
+ * @since_tizen 3.0
+ * @remarks Before set display ROI area, #PLAYER_DISPLAY_MODE_DST_ROI should be set with player_set_display_mode().
+ *          The minimum value of width and height are 1.
+ * @param[in] player The handle to the media player
+ * @param[in] x X coordinate of area
+ * @param[in] y Y coordinate of area
+ * @param[in] width Width of area
+ * @param[in] height Height of area
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval  #PLAYER_ERROR_NONE Successful
+ * @retval  #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int player_set_display_roi_area(player_h player, int x, int y, int width, int height);
+
+/**
  * @brief Sets the visibility of the x surface video display
  * @since_tizen 2.3.1
  * @param[in] player   The handle to the media player
index 1636059..a384c39 100644 (file)
@@ -1562,7 +1562,7 @@ static void get_display_mode()
 
 static void set_display_roi_area(int x, int y, int width, int height)
 {
-       //player_set_display_roi_area(g_player[0], x, y, width, height);
+       player_set_display_roi_area(g_player[0], x, y, width, height);
        g_print("                                                            ==> [Player_Test] Display roi area: [x(%d) y(%d) width(%d) height(%d)] \n", x, y, width, height);
 }