From: Sangchul Lee Date: Thu, 4 Feb 2021 10:13:32 +0000 (+0900) Subject: Apply network related features to webrtc_create() API X-Git-Tag: submit/tizen/20210729.023123~134 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d2f560692589ea6d989c037bc5327d02b86553b7;p=platform%2Fcore%2Fapi%2Fwebrtc.git Apply network related features to webrtc_create() API One of features below must be supported to use this webrtc API set. - http://tizen.org/feature/network.wifi - http://tizen.org/feature/network.telephony - http://tizen.org/feature/network.ethernet [Version] 0.1.107 [Issue Type] Feature Change-Id: I9719036e4346f0f56919e4ebb6299c1676a3424c Signed-off-by: Sangchul Lee --- diff --git a/include/webrtc_private.h b/include/webrtc_private.h index 8f08bffe..a6ddce67 100644 --- a/include/webrtc_private.h +++ b/include/webrtc_private.h @@ -141,6 +141,23 @@ do { \ return ret; \ } while (0) +#define _WEBRTC_FEATURE_NETWORK_WIFI "http://tizen.org/feature/network.wifi" +#define _WEBRTC_FEATURE_NETWORK_TELE "http://tizen.org/feature/network.telephony" +#define _WEBRTC_FEATURE_NETWORK_ETH "http://tizen.org/feature/network.ethernet" +#define RET_ERR_IF_NETWORK_FEATURES_ARE_NOT_SUPPORTED() \ +do { \ + int ret = _check_feature(_WEBRTC_FEATURE_NETWORK_WIFI); \ + if (ret == WEBRTC_ERROR_NONE) \ + break; \ + ret = _check_feature(_WEBRTC_FEATURE_NETWORK_TELE); \ + if (ret == WEBRTC_ERROR_NONE) \ + break; \ + ret = _check_feature(_WEBRTC_FEATURE_NETWORK_ETH); \ + if (ret == WEBRTC_ERROR_NONE) \ + break; \ + return WEBRTC_ERROR_NOT_SUPPORTED; \ +} while (0) + #define SAFE_FREE(src) { if (src) { free(src); src = NULL; } } #define SAFE_STR(str) (str) ? str : "null" diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index a38b3a9d..89ee6aa4 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: 0.1.106 +Version: 0.1.107 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/webrtc.c b/src/webrtc.c index d57c5da3..4bbf5355 100644 --- a/src/webrtc.c +++ b/src/webrtc.c @@ -116,8 +116,9 @@ int webrtc_create(webrtc_h *webrtc) int ret = WEBRTC_ERROR_NONE; webrtc_s *_webrtc = NULL; - RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL"); + RET_ERR_IF_NETWORK_FEATURES_ARE_NOT_SUPPORTED(); RET_ERR_IF_PRIVILEGE_IS_NOT_ALLOWED(_WEBRTC_PRIVILEGE_INTERNET); + RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL"); _webrtc = g_new0(webrtc_s, 1);