From: Sangchul Lee Date: Fri, 30 Jul 2021 08:53:46 +0000 (+0900) Subject: webrtc_internal: Add webrtc_media_source_set_video_loopback_to_ecore_wl() X-Git-Tag: submit/tizen/20210804.071712~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9b186eeae582646d158a4d3d424a808762d9b12d;p=platform%2Fcore%2Fapi%2Fwebrtc.git webrtc_internal: Add webrtc_media_source_set_video_loopback_to_ecore_wl() Some parameter types are corrected. [Version] 0.2.64 [Issue Type] Internal API Change-Id: I6eb146ee7914150cfdcb4cdf1c32660b1a1e1123 Signed-off-by: Sangchul Lee --- diff --git a/include/webrtc.h b/include/webrtc.h index ddb64e05..7463b3b5 100644 --- a/include/webrtc.h +++ b/include/webrtc.h @@ -1182,7 +1182,7 @@ int webrtc_unset_encoded_video_frame_cb(webrtc_h webrtc); * @pre Add media source to @a webrtc to get @a source_id by calling webrtc_add_media_source(). * @see webrtc_media_source_set_video_loopback() */ -int webrtc_media_source_set_audio_loopback(webrtc_h webrtc, unsigned source_id, sound_stream_info_h stream_info, unsigned int *track_id); +int webrtc_media_source_set_audio_loopback(webrtc_h webrtc, unsigned int source_id, sound_stream_info_h stream_info, unsigned int *track_id); /** * @brief Sets a video loopback to render the video frames of the media source. @@ -1205,7 +1205,7 @@ int webrtc_media_source_set_audio_loopback(webrtc_h webrtc, unsigned source_id, * @pre Add media source to @a webrtc to get @a source_id by calling webrtc_add_media_source(). * @see webrtc_media_source_set_audio_loopback() */ -int webrtc_media_source_set_video_loopback(webrtc_h webrtc, unsigned source_id, webrtc_display_type_e type, webrtc_display_h display, unsigned int *track_id); +int webrtc_media_source_set_video_loopback(webrtc_h webrtc, unsigned int source_id, webrtc_display_type_e type, webrtc_display_h display, unsigned int *track_id); /** * @} diff --git a/include/webrtc_internal.h b/include/webrtc_internal.h index 59f99b8e..0eddfbf6 100644 --- a/include/webrtc_internal.h +++ b/include/webrtc_internal.h @@ -102,6 +102,28 @@ typedef void (*webrtc_signaling_message_cb)(webrtc_signaling_message_type_e type */ int webrtc_set_ecore_wl_display(webrtc_h webrtc, unsigned int track_id, void *ecore_wl_window); +/** + * @internal + * @brief Sets a video loopback to render the video frames of the media source to an ecore wayland display. + * @details The following media source types are available for this function:\n + * #WEBRTC_MEDIA_SOURCE_TYPE_VIDEOTEST\n + * #WEBRTC_MEDIA_SOURCE_TYPE_CAMERA\n + * #WEBRTC_MEDIA_SOURCE_TYPE_SCREEN\n + * #WEBRTC_MEDIA_SOURCE_TYPE_FILE + * @since_tizen 6.5 + * @param[in] webrtc WebRTC handle + * @param[in] source_id The video source id + * @param[in] ecore_wl_window The ecore wayland window handle + * @param[out] track_id The track id (optional, this can be NULL) + * @return @c 0 on success, + * otherwise a negative error value + * @retval #WEBRTC_ERROR_NONE Successful + * @retval #WEBRTC_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WEBRTC_ERROR_INVALID_OPERATION Invalid operation + * @pre Add media source to @a webrtc to get @a source_id by calling webrtc_add_media_source(). + */ +int webrtc_media_source_set_video_loopback_to_ecore_wl(webrtc_h webrtc, unsigned int source_id, void *ecore_wl_window, unsigned int *track_id); + /** * @internal * @brief Adds an internal media source. diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index 52fecbb9..a7d5c78a 100644 --- a/packaging/capi-media-webrtc.spec +++ b/packaging/capi-media-webrtc.spec @@ -1,6 +1,6 @@ Name: capi-media-webrtc Summary: A WebRTC library in Tizen Native API -Version: 0.2.63 +Version: 0.2.64 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/webrtc.c b/src/webrtc.c index 63fbee1a..2091d19f 100644 --- a/src/webrtc.c +++ b/src/webrtc.c @@ -754,7 +754,7 @@ int webrtc_unset_encoded_video_frame_cb(webrtc_h webrtc) return WEBRTC_ERROR_NONE; } -int webrtc_media_source_set_audio_loopback(webrtc_h webrtc, unsigned source_id, sound_stream_info_h stream_info, unsigned int *track_id) +int webrtc_media_source_set_audio_loopback(webrtc_h webrtc, unsigned int source_id, sound_stream_info_h stream_info, unsigned int *track_id) { int ret = WEBRTC_ERROR_NONE; webrtc_s *_webrtc = (webrtc_s*)webrtc; @@ -772,7 +772,7 @@ int webrtc_media_source_set_audio_loopback(webrtc_h webrtc, unsigned source_id, return ret; } -int webrtc_media_source_set_video_loopback(webrtc_h webrtc, unsigned source_id, webrtc_display_type_e type, webrtc_display_h display, unsigned int *track_id) +int webrtc_media_source_set_video_loopback(webrtc_h webrtc, unsigned int source_id, webrtc_display_type_e type, webrtc_display_h display, unsigned int *track_id) { int ret = WEBRTC_ERROR_NONE; webrtc_s *_webrtc = (webrtc_s*)webrtc; diff --git a/src/webrtc_internal.c b/src/webrtc_internal.c index 6996789a..e0c48f11 100644 --- a/src/webrtc_internal.c +++ b/src/webrtc_internal.c @@ -41,6 +41,24 @@ int webrtc_set_ecore_wl_display(webrtc_h webrtc, unsigned int track_id, void *ec return ret; } +int webrtc_media_source_set_video_loopback_to_ecore_wl(webrtc_h webrtc, unsigned int source_id, void *ecore_wl_window, unsigned int *track_id) +{ + int ret = WEBRTC_ERROR_NONE; + webrtc_s *_webrtc = (webrtc_s*)webrtc; + + RET_VAL_IF(_webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL"); + RET_VAL_IF(source_id == 0, WEBRTC_ERROR_INVALID_PARAMETER, "source_id is 0"); + RET_VAL_IF(ecore_wl_window == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "ecore_wl_window is NULL"); + + g_mutex_lock(&_webrtc->mutex); + + ret = _set_video_loopback(webrtc, source_id, WEBRTC_DISPLAY_TYPE_ECORE_WL, ecore_wl_window, track_id); + + g_mutex_unlock(&_webrtc->mutex); + + return ret; +} + int webrtc_add_media_source_internal(webrtc_h webrtc, webrtc_media_source_type_internal_e type, unsigned int *source_id) { int ret = WEBRTC_ERROR_NONE;