screenmirror: init screenmirror
[platform/core/api/efl-util.git] / include / efl_util_screenshot_extension.h
index d3ffc87..50fb8dd 100644 (file)
@@ -71,6 +71,108 @@ API int efl_util_screenshot_set_auto_rotation(efl_util_screenshot_h screenshot,
 API int efl_util_screenshot_get_auto_rotation(efl_util_screenshot_h screenshot, int *set);
 
 /**
+ * @platform
+ * @brief Definition for the screenmirror handle.
+ * @since_tizen 7.0
+ */
+typedef struct _efl_util_screenmirror_h * efl_util_screenmirror_h;
+
+/**
+ * @brief The screenmirror handler
+ * @details This handler will be called when mirror buffer is received.
+ * @since_tizen 7.0
+ */
+typedef void (*efl_util_screenmirror_handler)(efl_util_screenmirror_h screenmirror,
+                                              tbm_surface_h t_surface, void *user_data);
+
+/**
+ * @platform
+ * @brief Initializes a screenmirror.
+ * @since_tizen 7.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/screenshot
+ * @remarks The specific error code can be obtained using the get_last_result()
+ * method. Error codes are described in Exception section.
+ * @param[in] width width of the screenmirror surface
+ * @param[in] height height of the screenmirror surface
+ * @return #efl_util_screenmirror_h on success, otherwise @c NULL
+ * @retval #efl_util_screenmirror_h The screenmirror handle
+ * @exception #EFL_UTIL_ERROR_NONE Successful
+ * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
+ * @exception #EFL_UTIL_ERROR_SCREENSHOT_INIT_FAIL Initialization failure
+ * @exception #EFL_UTIL_ERROR_PERMISSION_DENIED No permission for screenmirror
+ * @see efl_util_screenmirror_deinitialize()
+ */
+API efl_util_screenmirror_h efl_util_screenmirror_initialize(int width, int height);
+
+/**
+ * @platform
+ * @brief Deinitializes the screenmirror.
+ * @since_tizen 7.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/screenshot
+ * @param[in]  screenmirror  #efl_util_screenmirror_h handle
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #EFL_UTIL_ERROR_NONE Successful
+ * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED No permission for screenmirror
+ * @see efl_util_screenmirror_initialize()
+ */
+API int efl_util_screenmirror_deinitialize(efl_util_screenmirror_h screenmirror);
+
+/**
+ * @platform
+ * @brief Set handler to get screenmirror buffer.
+ * @since_tizen 7.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/screenshot
+ * @param[in]  screenmirror  #efl_util_screenmirror_h handle
+ * @param[in]  func  mirror buffer get handler
+ * @param[in]  data  user data
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #EFL_UTIL_ERROR_NONE Successful
+ * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED No permission for screenmirror
+ * @see efl_util_screenmirror_initialize()
+ */
+API int efl_util_screenmirror_set_handler(efl_util_screenmirror_h screenmirror,
+                                          efl_util_screenmirror_handler func, void *data);
+
+/**
+ * @platform
+ * @brief Start the screenmirror.
+ * @since_tizen 7.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/screenshot
+ * @param[in]  screenmirror  #efl_util_screenmirror_h handle
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #EFL_UTIL_ERROR_NONE Successful
+ * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #EFL_UTIL_ERROR_SCREENSHOT_EXECUTION_FAIL Execution failure
+ * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED No permission for screenmirror
+ * @see efl_util_screenmirror_initialize()
+ */
+API int efl_util_screenmirror_start(efl_util_screenmirror_h screenmirror);
+
+/**
+ * @platform
+ * @brief Stop the screenmirror.
+ * @since_tizen 7.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/screenshot
+ * @param[in]  screenmirror  #efl_util_screenmirror_h handle
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #EFL_UTIL_ERROR_NONE Successful
+ * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #EFL_UTIL_ERROR_SCREENSHOT_EXECUTION_FAIL Execution failure
+ * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED No permission for screenmirror
+ * @see efl_util_screenmirror_initialize()
+ * @see efl_util_screenmirror_start();
+ */
+API int efl_util_screenmirror_stop(efl_util_screenmirror_h screenmirror);
+
+/**
  * @}
  */