From: Sangchul Lee Date: Thu, 8 Aug 2024 08:06:15 +0000 (+0900) Subject: Add WEBRTC_BUNDLE_POLICY_MAX_COMPAT enum X-Git-Tag: accepted/tizen/unified/20240821.081515~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a5f99cf2de7a0823042af6cde7b6a4cd68b623d8;p=platform%2Fcore%2Fapi%2Fwebrtc.git Add WEBRTC_BUNDLE_POLICY_MAX_COMPAT enum It has been moved from internal API. : webrtc_set_bundle_policy_max_compat() has been removed from internal header. [Version] 1.1.21 [Issue Type] API Change-Id: I0ffbf07a0ac62c20ab39cf1e493ae03b45d97250 Signed-off-by: Sangchul Lee --- diff --git a/include/webrtc.h b/include/webrtc.h index c1b0f864..f76006c4 100644 --- a/include/webrtc.h +++ b/include/webrtc.h @@ -134,6 +134,7 @@ typedef enum { typedef enum { WEBRTC_BUNDLE_POLICY_NONE, /**< None */ WEBRTC_BUNDLE_POLICY_MAX_BUNDLE, /**< Max-bundle */ + WEBRTC_BUNDLE_POLICY_MAX_COMPAT, /**< Max-compat (Since 9.0) */ } webrtc_bundle_policy_e; /** diff --git a/include/webrtc_internal.h b/include/webrtc_internal.h index 364f2612..3481ca56 100644 --- a/include/webrtc_internal.h +++ b/include/webrtc_internal.h @@ -76,14 +76,6 @@ typedef enum { */ #define WEBRTC_SNAPSHOT_OPTION_NONE -1 -/** - * @internal - * @brief Definition for WebRTC bundle policy - 'max-compat'. - * @since_tizen 7.0 - * @remarks It corresponds with the RTCBundlePolicy enum described in https://www.w3.org/TR/webrtc/#rtcbundlepolicy-enum. - */ -#define WEBRTC_BUNDLE_POLICY_MAX_COMPAT 2 - /** * @internal * @brief Enumeration for WebRTC signaling message type. @@ -555,19 +547,6 @@ int webrtc_set_rtp_packet_drop_probability(webrtc_h webrtc, bool sender, float p */ int webrtc_get_rtp_packet_drop_probability(webrtc_h webrtc, bool sender, float *probability); -/** - * @brief Sets the 'max-compat' bundle policy. - * @since_tizen 7.0 - * @param[in] webrtc WebRTC handle - * @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_bundle_policy_max_compat(webrtc_h webrtc); - /** * @internal * @brief Starts the WebRTC synchronously. diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index b2b1f077..3761ee12 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.1.20 +Version: 1.1.21 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/webrtc.c b/src/webrtc.c index 18759216..e9db0c90 100644 --- a/src/webrtc.c +++ b/src/webrtc.c @@ -1184,7 +1184,7 @@ int webrtc_set_bundle_policy(webrtc_h webrtc, webrtc_bundle_policy_e policy) webrtc_s *_webrtc = (webrtc_s *)webrtc; RET_VAL_IF(_webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL"); - RET_VAL_IF(policy > WEBRTC_BUNDLE_POLICY_MAX_BUNDLE, WEBRTC_ERROR_INVALID_PARAMETER, "invalid policy(%d)", policy); + RET_VAL_IF(policy > WEBRTC_BUNDLE_POLICY_MAX_COMPAT, WEBRTC_ERROR_INVALID_PARAMETER, "invalid policy(%d)", policy); locker = g_mutex_locker_new(&_webrtc->mutex); diff --git a/src/webrtc_internal.c b/src/webrtc_internal.c index 0c559567..4a1268ba 100644 --- a/src/webrtc_internal.c +++ b/src/webrtc_internal.c @@ -608,21 +608,6 @@ int webrtc_get_rtp_packet_drop_probability(webrtc_h webrtc, bool sender, float * return _get_packet_drop_probability(webrtc, sender, probability); } -int webrtc_set_bundle_policy_max_compat(webrtc_h webrtc) -{ - g_autoptr(GMutexLocker) locker = NULL; - webrtc_s *_webrtc = (webrtc_s *)webrtc; - - RET_VAL_IF(_webrtc->state != WEBRTC_STATE_IDLE, WEBRTC_ERROR_INVALID_STATE, "the state should be IDLE"); - - /* Until it is released to public header, use the gst value directly. */ - g_object_set(G_OBJECT(_webrtc->gst.webrtcbin), "bundle-policy", GST_WEBRTC_BUNDLE_POLICY_MAX_COMPAT, NULL); - - LOG_INFO("webrtc[%p] policy[%s]", webrtc, "MAX-COMPAT"); - - return WEBRTC_ERROR_NONE; -} - int webrtc_start_sync(webrtc_h webrtc) { int ret = WEBRTC_ERROR_NONE; diff --git a/test/webrtc_test.c b/test/webrtc_test.c index bad2081a..fdb7c031 100644 --- a/test/webrtc_test.c +++ b/test/webrtc_test.c @@ -1423,15 +1423,10 @@ static void _webrtc_get_turn_servers(int index) static void _webrtc_set_bundle_policy(int index, int policy) { - int ret = 0; - - if (policy == 2) /* use internal API */ - ret = webrtc_set_bundle_policy_max_compat(g_ad.conns[index].webrtc); - else - ret = webrtc_set_bundle_policy(g_ad.conns[index].webrtc, policy); + int ret = webrtc_set_bundle_policy(g_ad.conns[index].webrtc, policy); RET_IF(ret != WEBRTC_ERROR_NONE, "ret[0x%x]", ret); - g_print("%s success\n", policy == 2 ? "webrtc_set_bundle_policy_max_compat()" : "webrtc_set_bundle_policy()"); + g_print("webrtc_set_bundle_policy() success\n"); } static void _webrtc_get_bundle_policy(int index) diff --git a/test/webrtc_test_menu.c b/test/webrtc_test_menu.c index 96649bcf..d4769826 100644 --- a/test/webrtc_test_menu.c +++ b/test/webrtc_test_menu.c @@ -323,7 +323,7 @@ void display_menu_webrtc_common(void) g_print("*** input TURN server address.\n"); break; case CURRENT_STATUS_SET_BUNDLE_POLICY: - g_print("*** input bundle policy.(0:none, 1:max-bundle, *2:max-compat (internal API))\n"); + g_print("*** input bundle policy.(0:none, 1:max-bundle, 2:max-compat\n"); break; case CURRENT_STATUS_SET_ICE_TRANSPORT_POLICY: g_print("*** input ICE transport policy.(0:all, 1:relay)\n");