From: Sangchul Lee Date: Wed, 3 Apr 2024 02:01:33 +0000 (+0900) Subject: Remove state constraint on functions for configuration X-Git-Tag: accepted/tizen/unified/20240618.010058~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F50%2F308950%2F1;p=platform%2Fcore%2Fapi%2Fwebrtc.git Remove state constraint on functions for configuration Functions below are revised. : webrtc_set_stun_server() : webrtc_add_turn_server() : webrtc_set_bundle_policy() : webrtc_set_ice_transport_policy() [Version] 1.0.3 [Issue Type] Release state constraint Change-Id: I8235391d57ec42d2886aeba2fcbdc511f7a7628d Signed-off-by: Sangchul Lee --- diff --git a/include/webrtc.h b/include/webrtc.h index cc19922d..875c1404 100644 --- a/include/webrtc.h +++ b/include/webrtc.h @@ -1992,15 +1992,14 @@ int webrtc_media_source_unset_video_loopback(webrtc_h webrtc, unsigned int sourc /** * @brief Sets a STUN server URL. * @since_tizen 6.5 - * @remarks Regarding STUN, refer to the RFC7064(https://tools.ietf.org/html/rfc7064). + * @remarks Regarding STUN, refer to the RFC7064(https://tools.ietf.org/html/rfc7064).\n + * #WEBRTC_ERROR_INVALID_STATE will no longer occur. (Since 9.0) * @param[in] webrtc WebRTC handle * @param[in] stun_server The STUN server URL of the form stun://host:port * @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_STATE Invalid state - * @pre @a webrtc state must be set to #WEBRTC_STATE_IDLE. */ int webrtc_set_stun_server(webrtc_h webrtc, const char *stun_server); @@ -2020,15 +2019,14 @@ int webrtc_get_stun_server(webrtc_h webrtc, char **stun_server); /** * @brief Adds a TURN server URL. * @since_tizen 6.5 - * @remarks Regarding TURN, refer to the RFC7065(https://tools.ietf.org/html/rfc7065). + * @remarks Regarding TURN, refer to the RFC7065(https://tools.ietf.org/html/rfc7065).\n + * #WEBRTC_ERROR_INVALID_STATE will no longer occur. (Since 9.0) * @param[in] webrtc WebRTC handle * @param[in] turn_server The TURN server URL of the form turn(s)://username:password@@host:port * @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_STATE Invalid state - * @pre @a webrtc state must be set to #WEBRTC_STATE_IDLE. * @see webrtc_foreach_turn_server() */ int webrtc_add_turn_server(webrtc_h webrtc, const char *turn_server); @@ -2051,14 +2049,13 @@ int webrtc_foreach_turn_server(webrtc_h webrtc, webrtc_turn_server_cb callback, /** * @brief Sets a bundle policy. * @since_tizen 7.0 + * @remarks #WEBRTC_ERROR_INVALID_STATE will no longer occur. (Since 9.0) * @param[in] webrtc WebRTC handle * @param[in] policy The bundle policy * @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_STATE Invalid state - * @pre @a webrtc state must be set to #WEBRTC_STATE_IDLE. * @see webrtc_get_bundle_policy() */ int webrtc_set_bundle_policy(webrtc_h webrtc, webrtc_bundle_policy_e policy); @@ -2080,14 +2077,13 @@ int webrtc_get_bundle_policy(webrtc_h webrtc, webrtc_bundle_policy_e *policy); /** * @brief Sets a ICE transport policy that represents which candidates the ICE Agent is allowed to use. * @since_tizen 6.5 + * @remarks #WEBRTC_ERROR_INVALID_STATE will no longer occur. (Since 9.0) * @param[in] webrtc WebRTC handle * @param[in] policy The ICE transport policy * @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_STATE Invalid state - * @pre @a webrtc state must be set to #WEBRTC_STATE_IDLE. * @see webrtc_get_ice_transport_policy() */ int webrtc_set_ice_transport_policy(webrtc_h webrtc, webrtc_ice_transport_policy_e policy); diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index 3c7b3b9c..50f31ac2 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: 1.0.2 +Version: 1.0.3 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/webrtc.c b/src/webrtc.c index 11ba7199..5f444bfe 100644 --- a/src/webrtc.c +++ b/src/webrtc.c @@ -1067,8 +1067,6 @@ int webrtc_set_stun_server(webrtc_h webrtc, const char *stun_server) locker = g_mutex_locker_new(&_webrtc->mutex); - RET_VAL_IF(_webrtc->state != WEBRTC_STATE_IDLE, WEBRTC_ERROR_INVALID_STATE, "the state should be IDLE"); - if (!_stun_url_has_valid_prefix(stun_server)) return WEBRTC_ERROR_INVALID_PARAMETER; @@ -1119,8 +1117,6 @@ int webrtc_add_turn_server(webrtc_h webrtc, const char *turn_server) locker = g_mutex_locker_new(&_webrtc->mutex); - RET_VAL_IF(_webrtc->state != WEBRTC_STATE_IDLE, WEBRTC_ERROR_INVALID_STATE, "the state should be IDLE"); - if (!(turn_url = _check_and_encode_turn_url(turn_server))) return WEBRTC_ERROR_INVALID_PARAMETER; @@ -1175,8 +1171,6 @@ int webrtc_set_bundle_policy(webrtc_h webrtc, webrtc_bundle_policy_e policy) locker = g_mutex_locker_new(&_webrtc->mutex); - RET_VAL_IF(_webrtc->state != WEBRTC_STATE_IDLE, WEBRTC_ERROR_INVALID_STATE, "the state should be IDLE"); - g_object_set(G_OBJECT(_webrtc->gst.webrtcbin), "bundle-policy", __bundle_policies[policy].gst_policy, NULL); _webrtc->bundle_policy = policy; @@ -1214,8 +1208,6 @@ int webrtc_set_ice_transport_policy(webrtc_h webrtc, webrtc_ice_transport_policy locker = g_mutex_locker_new(&_webrtc->mutex); - RET_VAL_IF(_webrtc->state != WEBRTC_STATE_IDLE, WEBRTC_ERROR_INVALID_STATE, "the state should be IDLE"); - g_object_set(G_OBJECT(_webrtc->gst.webrtcbin), "ice-transport-policy", (GstWebRTCICETransportPolicy)policy, NULL); LOG_INFO("webrtc[%p] policy[%s]", webrtc, (policy == WEBRTC_ICE_TRANSPORT_POLICY_ALL) ? "all" : "relay");