*/
int scmirroring_secondary_sink_set_ip_and_port(scmirroring_secondary_sink_h scmirroring_secondary_sink, const char *ip, const char *port);
-/**
- * @brief Pass window handle created by application and surface type(x11/evas).
- * @details This function will use handle created by the application to set the overlay &
- * display on the surface passed by the application
- *
- * @since_tizen 5.5
- *
- * @param[in] scmirroring_secondary_sink The handle to the screen mirroring secondary sink
- * @param[in] type Surface type(x11/evas)
- * @param[in] display_surface The display_surface created by application to force sink to display content over it
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SCMIRRORING_ERROR_NONE Successful
- * @retval #SCMIRRORING_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SCMIRRORING_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #SCMIRRORING_ERROR_INVALID_OPERATION Invalid operation
- * @retval #SCMIRRORING_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SCMIRRORING_ERROR_NOT_SUPPORTED Not supported
- * @retval #SCMIRRORING_ERROR_UNKNOWN Unknown Error
- *
- * @pre Create a screen mirroring sink handle by calling scmirroring_secondary_sink_create().
- *
- * @see scmirroring_secondary_sink_create()
- */
-int scmirroring_secondary_sink_set_display(scmirroring_secondary_sink_h scmirroring_secondary_sink, scmirroring_display_type_e type, void *display_surface);
-
-/**
- * @brief Sets resolutions of screen mirroring secondary sink.
- * @details This function sets resolutions of screen mirroring sink using scmirroring_resolution_e as following.
- * (ex. SCMIRRORING_RESOLUTION_1920x1080_P30 | SCMIRRORING_RESOLUTION_1280x720_P30)
- * Use it only when you want to set specific resolutions but if screen mirroring source dose not support
- * the resolutions which you set, the screen mirroring sink will be disconnected.
- *
- * @since_tizen 5.5
- *
- * @param[in] scmirroring_secondary_sink The handle to the screen mirroring secondary sink
- * @param[in] resolution Resolution of screen mirroring sink
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SCMIRRORING_ERROR_NONE Successful
- * @retval #SCMIRRORING_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SCMIRRORING_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #SCMIRRORING_ERROR_INVALID_OPERATION Invalid operation
- * @retval #SCMIRRORING_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SCMIRRORING_ERROR_NOT_SUPPORTED Not supported
- * @retval #SCMIRRORING_ERROR_UNKNOWN Unknown Error
- *
- * @pre Create a screen mirroring sink handle by calling scmirroring_secondary_sink_create().
- *
- * @see scmirroring_secondary_sink_create()
- */
-int scmirroring_secondary_sink_set_resolution(scmirroring_secondary_sink_h scmirroring_secondary_sink, int resolution);
-
/**
* @brief Prepares the screen mirroring sink handle and allocates specific resources.
* @since_tizen 5.5
*/
int scmirroring_secondary_sink_destroy(scmirroring_secondary_sink_h scmirroring_secondary_sink);
-/**
- * @brief Gets negotiated video codec of screen mirroring secondary sink.
- * @details The video codec is negotiated by screen mirroring source.
- *
- * @since_tizen 5.5
- *
- * @param[in] scmirroring_secondary_sink The handle to the screen mirroring secondary sink
- * @param[out] codec Codec of video
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SCMIRRORING_ERROR_NONE Successful
- * @retval #SCMIRRORING_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SCMIRRORING_ERROR_INVALID_OPERATION Invalid operation
- * @retval #SCMIRRORING_ERROR_NOT_SUPPORTED Not supported
- * @retval #SCMIRRORING_ERROR_UNKNOWN Unknown Error
- *
- * @pre Create a screen mirroring sink handle by calling scmirroring_secondary_sink_create().
- * @pre Register user callback by calling scmirroring_secondary_sink_set_state_changed_cb().
- * @pre Call scmirroring_secondary_sink_prepare()
- * @pre Call scmirroring_secondary_sink_connect()
- * @pre The screen mirroring state must be #SCMIRRORING_SINK_STATE_CONNECTED or #SCMIRRORING_SINK_STATE_PLAYING
- */
-int scmirroring_secondary_sink_get_negotiated_video_codec(scmirroring_secondary_sink_h *scmirroring_secondary_sink, scmirroring_video_codec_e *codec);
-
-/**
- * @brief Gets negotiated video resolution of screen mirroring secondary sink.
- * @details The video resolution is negotiated by screen mirroring source.
- *
- * @since_tizen 5.5
- *
- * @param[in] scmirroring_secondary_sink The handle to the screen mirroring secondary sink
- * @param[out] width Width of video
- * @param[out] height Height of video
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SCMIRRORING_ERROR_NONE Successful
- * @retval #SCMIRRORING_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SCMIRRORING_ERROR_INVALID_OPERATION Invalid operation
- * @retval #SCMIRRORING_ERROR_NOT_SUPPORTED Not supported
- * @retval #SCMIRRORING_ERROR_UNKNOWN Unknown Error
- *
- * @pre Create a screen mirroring sink handle by calling scmirroring_secondary_sink_create().
- * @pre Register user callback by calling scmirroring_secondary_sink_set_state_changed_cb().
- * @pre Call scmirroring_secondary_sink_prepare()
- * @pre Call scmirroring_secondary_sink_connect()
- * @pre The screen mirroring state must be #SCMIRRORING_SINK_STATE_CONNECTED or #SCMIRRORING_SINK_STATE_PLAYING
- */
-int scmirroring_secondary_sink_get_negotiated_video_resolution(scmirroring_secondary_sink_h *scmirroring_secondary_sink, int *width, int *height);
-
-/**
- * @brief Gets negotiated frame rate of screen mirroring secondary sink.
- * @details The video frame rate is negotiated by screen mirroring source.
- *
- * @since_tizen 5.5
- *
- * @param[in] scmirroring_secondary_sink The handle to the screen mirroring secondary sink
- * @param[out] frame_rate Frame rate of video
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SCMIRRORING_ERROR_NONE Successful
- * @retval #SCMIRRORING_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SCMIRRORING_ERROR_INVALID_OPERATION Invalid operation
- * @retval #SCMIRRORING_ERROR_NOT_SUPPORTED Not supported
- * @retval #SCMIRRORING_ERROR_UNKNOWN Unknown Error
- *
- * @pre Create a screen mirroring sink handle by calling scmirroring_secondary_sink_create().
- * @pre Register user callback by calling scmirroring_secondary_sink_set_state_changed_cb().
- * @pre Call scmirroring_secondary_sink_prepare()
- * @pre Call scmirroring_secondary_sink_connect()
- * @pre The screen mirroring state must be #SCMIRRORING_SINK_STATE_CONNECTED or #SCMIRRORING_SINK_STATE_PLAYING
- */
-int scmirroring_secondary_sink_get_negotiated_video_frame_rate(scmirroring_secondary_sink_h *scmirroring_secondary_sink, int *frame_rate);
-
/**
* @brief Gets negotiated audio codec of screen mirroring secondary sink.
* @details The audio codec is negotiated by screen mirroring source.
return ret;
}
-int scmirroring_secondary_sink_set_display(scmirroring_secondary_sink_h scmirroring_secondary_sink, scmirroring_display_type_e type, void *display_surface)
-{
- int ret = SCMIRRORING_ERROR_NONE;
-
- scmirroring_secondary_sink_s *handle = (scmirroring_secondary_sink_s *)scmirroring_secondary_sink;
-
- scmirroring_debug_fenter();
-
- scmirroring_retvm_if(handle == NULL, SCMIRRORING_ERROR_INVALID_PARAMETER, "scmirroring_secondary_sink is NULL");
- scmirroring_retvm_if(handle->magic_num != SCMIRRORING_MAGIC_NUMBER, SCMIRRORING_ERROR_INVALID_PARAMETER, "scmirroring_secondary_sink is invalid handle");
- scmirroring_retvm_if(display_surface == NULL, SCMIRRORING_ERROR_INVALID_PARAMETER, "display_surface is NULL");
-
- if ((type != SCMIRRORING_DISPLAY_TYPE_OVERLAY) && (type != SCMIRRORING_DISPLAY_TYPE_EVAS)) {
- scmirroring_error("Invalid display type [%d]", type);
- return SCMIRRORING_ERROR_INVALID_PARAMETER;
- }
-
- scmirroring_debug("display type(%d)", type);
-
- ret = mm_wfd_sink_set_attribute(handle->mm_handle, NULL, "display_surface_type", type, NULL);
- if (ret != MM_ERROR_NONE) {
- scmirroring_error("Fail to Set Display Type");
- return __scmirroring_secondary_sink_error_convert(__func__, ret);
- }
-
- ret = mm_wfd_sink_set_attribute(handle->mm_handle, NULL, "display_overlay", display_surface, sizeof(void *), NULL);
- if (ret != MM_ERROR_NONE) {
- scmirroring_error("Fail to Set Display Overlay");
- return __scmirroring_secondary_sink_error_convert(__func__, ret);
- }
-
- ret = mm_wfd_sink_set_attribute(handle->mm_handle, NULL, "display_visible", TRUE, NULL);
- if (ret != MM_ERROR_NONE) {
- scmirroring_error("Fail to Set Display Visible as TRUE");
- return __scmirroring_secondary_sink_error_convert(__func__, ret);
- }
-
- ret = __scmirroring_secondary_sink_error_convert(__func__, ret);
-
- scmirroring_debug_fleave();
-
- return ret;
-}
-
-int scmirroring_secondary_sink_set_resolution(scmirroring_secondary_sink_h scmirroring_secondary_sink, int resolution)
-{
- int ret = SCMIRRORING_ERROR_NONE;
-
- scmirroring_secondary_sink_s *handle = (scmirroring_secondary_sink_s *)scmirroring_secondary_sink;
-
- scmirroring_debug_fenter();
-
- scmirroring_retvm_if(handle == NULL, SCMIRRORING_ERROR_INVALID_PARAMETER, "scmirroring_secondary_sink is NULL");
- scmirroring_retvm_if(handle->magic_num != SCMIRRORING_MAGIC_NUMBER, SCMIRRORING_ERROR_INVALID_PARAMETER, "scmirroring_secondary_sink is invalid handle");
-
- if ((resolution < SCMIRRORING_RESOLUTION_UNKNOWN) || (resolution >= SCMIRRORING_RESOLUTION_MAX)) {
- scmirroring_error("Invalid resolution : %d", resolution);
- return SCMIRRORING_ERROR_INVALID_PARAMETER;
- }
-
- scmirroring_debug("resolution(%d)", resolution);
- ret = mm_wfd_sink_set_resolution(handle->mm_handle, resolution);
- if (ret != MM_ERROR_NONE) {
- scmirroring_error("Fail to Set resolution");
- return __scmirroring_secondary_sink_error_convert(__func__, ret);
- }
-
- ret = __scmirroring_secondary_sink_error_convert(__func__, ret);
-
- scmirroring_debug_fleave();
-
- return ret;
-}
int scmirroring_secondary_sink_pause(scmirroring_secondary_sink_h scmirroring_secondary_sink)
{
return ret;
}
-int scmirroring_secondary_sink_get_negotiated_video_codec(scmirroring_secondary_sink_h *scmirroring_secondary_sink, scmirroring_video_codec_e *codec)
-{
- int ret = SCMIRRORING_ERROR_NONE;
- int mm_codec = MM_WFD_SINK_VIDEO_CODEC_NONE;
-
- scmirroring_secondary_sink_s *handle = NULL;
- scmirroring_debug_fenter();
-
- scmirroring_retvm_if(scmirroring_secondary_sink == NULL, SCMIRRORING_ERROR_INVALID_PARAMETER, "scmirroring_secondary_sink* is NULL");
- scmirroring_retvm_if(codec == NULL, SCMIRRORING_ERROR_INVALID_PARAMETER, "codec is NULL");
-
- handle = (scmirroring_secondary_sink_s *)(*scmirroring_secondary_sink);
- scmirroring_retvm_if(handle == NULL, SCMIRRORING_ERROR_INVALID_PARAMETER, "handle is NULL");
- scmirroring_retvm_if(handle->magic_num != SCMIRRORING_MAGIC_NUMBER, SCMIRRORING_ERROR_INVALID_PARAMETER, "scmirroring_secondary_sink is invalid handle");
-
- *codec = SCMIRRORING_VIDEO_CODEC_NONE;
-
- ret = mm_wfd_sink_get_negotiated_video_codec(handle->mm_handle, &mm_codec);
- ret = __scmirroring_secondary_sink_error_convert(__func__, ret);
- if (ret != SCMIRRORING_ERROR_NONE)
- return ret;
-
- switch (mm_codec) {
- case MM_WFD_SINK_VIDEO_CODEC_H264:
- *codec = SCMIRRORING_VIDEO_CODEC_H264;
- break;
- default:
- *codec = SCMIRRORING_VIDEO_CODEC_NONE;
- break;
- }
-
- scmirroring_debug("codec: %d", *codec);
- scmirroring_debug_fleave();
-
- return ret;
-}
-
-int scmirroring_secondary_sink_get_negotiated_video_resolution(scmirroring_secondary_sink_h *scmirroring_secondary_sink, int *width, int *height)
-{
- int ret = SCMIRRORING_ERROR_NONE;
-
- scmirroring_secondary_sink_s *handle = NULL;
- scmirroring_debug_fenter();
-
- scmirroring_retvm_if(scmirroring_secondary_sink == NULL, SCMIRRORING_ERROR_INVALID_PARAMETER, "scmirroring_secondary_sink* is NULL");
- scmirroring_retvm_if(width == NULL, SCMIRRORING_ERROR_INVALID_PARAMETER, "width is NULL");
- scmirroring_retvm_if(height == NULL, SCMIRRORING_ERROR_INVALID_PARAMETER, "height is NULL");
-
- handle = (scmirroring_secondary_sink_s *)(*scmirroring_secondary_sink);
- scmirroring_retvm_if(handle == NULL, SCMIRRORING_ERROR_INVALID_PARAMETER, "handle is NULL");
- scmirroring_retvm_if(handle->magic_num != SCMIRRORING_MAGIC_NUMBER, SCMIRRORING_ERROR_INVALID_PARAMETER, "scmirroring_secondary_sink is invalid handle");
-
- *width = 0;
- *height = 0;
-
- ret = mm_wfd_sink_get_negotiated_video_resolution(handle->mm_handle, width, height);
- ret = __scmirroring_secondary_sink_error_convert(__func__, ret);
- if (ret != SCMIRRORING_ERROR_NONE)
- return ret;
-
- scmirroring_debug("width: %d, height: %d", *width, *height);
- scmirroring_debug_fleave();
-
- return ret;
-}
-
-int scmirroring_secondary_sink_get_negotiated_video_frame_rate(scmirroring_secondary_sink_h *scmirroring_secondary_sink, int *frame_rate)
-{
- int ret = SCMIRRORING_ERROR_NONE;
-
- scmirroring_secondary_sink_s *handle = NULL;
- scmirroring_debug_fenter();
-
- scmirroring_retvm_if(scmirroring_secondary_sink == NULL, SCMIRRORING_ERROR_INVALID_PARAMETER, "scmirroring_secondary_sink* is NULL");
- scmirroring_retvm_if(frame_rate == NULL, SCMIRRORING_ERROR_INVALID_PARAMETER, "frame_rate is NULL");
-
- handle = (scmirroring_secondary_sink_s *)(*scmirroring_secondary_sink);
- scmirroring_retvm_if(handle == NULL, SCMIRRORING_ERROR_INVALID_PARAMETER, "handle is NULL");
- scmirroring_retvm_if(handle->magic_num != SCMIRRORING_MAGIC_NUMBER, SCMIRRORING_ERROR_INVALID_PARAMETER, "scmirroring_secondary_sink is invalid handle");
-
- *frame_rate = 0;
-
- ret = mm_wfd_sink_get_negotiated_video_frame_rate(handle->mm_handle, frame_rate);
- ret = __scmirroring_secondary_sink_error_convert(__func__, ret);
- if (ret != SCMIRRORING_ERROR_NONE)
- return ret;
-
- scmirroring_debug("frame rate: %d", *frame_rate);
- scmirroring_debug_fleave();
-
- return ret;
-}
int scmirroring_secondary_sink_get_negotiated_audio_codec(scmirroring_secondary_sink_h *scmirroring_secondary_sink, scmirroring_audio_codec_e *codec)
{