Add precondition to webrtc_start() 74/244774/5
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 24 Sep 2020 06:17:38 +0000 (15:17 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 8 Oct 2020 07:03:56 +0000 (16:03 +0900)
The @pre command with the statement as below is added to the doxygen.
 - @pre webrtc_ice_candidate_cb() must be set by calling
   webrtc_set_ice_candidate_cb().

This condition is added because both offer and answer sides should
send ICE candidates after setting local description inevitably.

[Version] 0.1.32
[Issue Type] Improvement

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

index 1ebb5d86134ae79a57db2fad40229cb18bd7dd38..641c612672c0f5c3d654f91f547c066e835ff022 100644 (file)
@@ -238,6 +238,7 @@ int webrtc_create(webrtc_h *webrtc);
  * @retval #WEBRTC_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #WEBRTC_ERROR_INVALID_OPERATION Invalid operation
  * @retval #WEBRTC_ERROR_INVALID_STATE Invalid state
+ * @pre webrtc_ice_candidate_cb() must be set by calling webrtc_set_ice_candidate_cb().
  * @pre @a webrtc state must be set to #WEBRTC_STATE_IDLE.
  * @post @a webrtc state will be #WEBRTC_STATE_NEGOTIATING.
  * @see webrtc_create()
index 00629e4b595d8e56f81e276401ec01dedadd0bc9..0cd4d59aa5cc4a411128398d70a915f9c6178e59 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.1.31
+Version:    0.1.32
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index b80d39ef7df7b79146b19940d4f7fe5eec9bfe38..a8109bf642322029c3cd1f17caf264961331a70c 100644 (file)
@@ -168,6 +168,7 @@ int webrtc_start(webrtc_h webrtc)
 
        g_mutex_lock(&_webrtc->mutex);
 
+       RET_VAL_WITH_UNLOCK_IF(_webrtc->ice_candidate_cb.callback == NULL, WEBRTC_ERROR_INVALID_OPERATION, &_webrtc->mutex, "the ice candidate callback should be set");
        RET_VAL_WITH_UNLOCK_IF(_webrtc->state != WEBRTC_STATE_IDLE, WEBRTC_ERROR_INVALID_STATE, &_webrtc->mutex, "the state should be IDLE");
        RET_VAL_WITH_UNLOCK_IF(_webrtc->gst.webrtcbin == NULL, WEBRTC_ERROR_INVALID_OPERATION, &_webrtc->mutex, "webrtcbin is NULL");