webrtc_internal: Add webrtc_media_source_set_video_loopback_to_ecore_wl() 96/261996/3
authorSangchul Lee <sc11.lee@samsung.com>
Fri, 30 Jul 2021 08:53:46 +0000 (17:53 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 3 Aug 2021 02:25:43 +0000 (11:25 +0900)
Some parameter types are corrected.

[Version] 0.2.64
[Issue Type] Internal API

Change-Id: I6eb146ee7914150cfdcb4cdf1c32660b1a1e1123
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
include/webrtc.h
include/webrtc_internal.h
packaging/capi-media-webrtc.spec
src/webrtc.c
src/webrtc_internal.c

index ddb64e0579303a6b4ab7ce0a7acfcaad186c056c..7463b3b56d8672876352f3563d79fb58a78c4b41 100644 (file)
@@ -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);
 
 /**
  * @}
index 59f99b8e9528916e635880c352eb1343e5efab65..0eddfbf6c90ba12a27ada352f8eb71c805954604 100644 (file)
@@ -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.
index 52fecbb975eed9a9335790916ffae3949c47b985..a7d5c78a295f7f388664ad0c62633359c07e2570 100644 (file)
@@ -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
index 63fbee1a7ec804710f0091e84493a39edf7b38ae..2091d19f442a90d16ba9ac10f4a23684b9a0f4a4 100644 (file)
@@ -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;
index 6996789a2699e123131763f050c82817e56985f0..e0c48f11dfc8b4892b4aa7335407f93c051eb4de 100644 (file)
@@ -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;