webrtc: Add error condition in webrtc_set_display() 88/258888/2
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 27 May 2021 06:43:48 +0000 (15:43 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 27 May 2021 06:58:41 +0000 (15:58 +0900)
The track added callback will be invoked even if the encoded video frame callback
has been set. Within this callback, this patch let webrtc_set_display() return
the invalid operation error by looking the encoded video frame callback is set,
not by _is_owner_of_track_build_context() the previous one.

Doxygen is also updated.

[Version] 0.1.173
[Issue Type] Improvement

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

index c7e1b5a46f51f5b38ad68f8b5cdb82c3095b2d58..ab456aec7cd54a706d48d2d9b74603eb92d4a79e 100644 (file)
@@ -820,7 +820,8 @@ int webrtc_set_transceiver_direction(webrtc_h webrtc, unsigned int source_id, we
 /**
  * @brief Set a display to the media track.
  * @since_tizen 6.5
- * @remarks Call this function within webrtc_track_added_cb(), otherwise #WEBRTC_ERROR_INVALID_OPERATION will be returned.
+ * @remarks Call this function within webrtc_track_added_cb(), otherwise #WEBRTC_ERROR_INVALID_OPERATION will be returned.\n
+ *          If webrtc_set_encoded_video_frame_cb() has been called, it will return #WEBRTC_ERROR_INVALID_OPERATION.
  * @param[in] webrtc      WebRTC handle
  * @param[in] track_id    The track id
  * @param[in] type        The display type
index d06becfc33c402a98f611e7d32673e6143ce90ba..e673c03450e6efd54e7237584cf230a26ec7c954 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.1.172
+Version:    0.1.173
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index b06e7d704c62872a86299b78775c14038140bd57..42a4945f9b2a9d55a08f1eb18eacc1f7672f5e3e 100644 (file)
@@ -519,7 +519,8 @@ int webrtc_set_display(webrtc_h webrtc, unsigned int track_id, webrtc_display_ty
 
        g_mutex_lock(&_webrtc->mutex);
 
-       RET_VAL_WITH_UNLOCK_IF(_webrtc->track_added_cb.callback == NULL, WEBRTC_ERROR_INVALID_OPERATION, &_webrtc->mutex, "callback was not set");
+       RET_VAL_WITH_UNLOCK_IF(_webrtc->track_added_cb.callback == NULL, WEBRTC_ERROR_INVALID_OPERATION, &_webrtc->mutex, "track added callback was not set");
+       RET_VAL_WITH_UNLOCK_IF(_webrtc->encoded_video_frame_cb.callback, WEBRTC_ERROR_INVALID_OPERATION, &_webrtc->mutex, "encoded video frame callback was set");
        RET_VAL_WITH_UNLOCK_IF(!_is_owner_of_track_build_context(_webrtc, track_id), WEBRTC_ERROR_INVALID_OPERATION, &_webrtc->mutex,
                        "this function should be called within the track added callback");