[ITC][webrtc][non-ACR] Skip when WEBRTC_ERROR_NOT_SUPPORTED error occurs 32/272332/1
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 15 Mar 2022 02:42:03 +0000 (11:42 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 15 Mar 2022 02:42:03 +0000 (11:42 +0900)
Change-Id: Ifc51dd985178b320a68606c487f11c2ea55d49cf
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
src/itc/webrtc/ITs-webrtc.c

index f1ec5d197a38f4e5a0159e53c94b94582ce01dc2..8522f77f991a2cdf3406f65ddeb7b36c3df4d793 100644 (file)
@@ -199,9 +199,9 @@ static bool webrtcTurnServerCB(const char *turn_server, void *user_data)
 * @parameter                   webrtc_data_channel_h channel, void *user_data
 * @return                              NA
 */
-static void dataChannelBufferedAmountLowCB(webrtc_data_channel_h channel, void *user_data)\r
-{\r
-       FPRINTF("[Line : %d][%s] Callback checking\\n", __LINE__, API_NAMESPACE);\r
+static void dataChannelBufferedAmountLowCB(webrtc_data_channel_h channel, void *user_data)
+{
+       FPRINTF("[Line : %d][%s] Callback checking\\n", __LINE__, API_NAMESPACE);
 }
 
 /**
@@ -636,6 +636,10 @@ int ITc_media_webrtc_media_source_set_get_mute_p(void)
 
        for (i = 0; i < sizeof(valid_types) / sizeof(valid_types[0]); i++) {
                nRet = webrtc_add_media_source(g_hWebRtcHandle, valid_types[i], &nId);
+               if (nRet == WEBRTC_ERROR_NOT_SUPPORTED) {
+                       dlog_print(DLOG_DEBUG, "NativeTCT", "[%s(%d)] camera feature is not supported, skip it", __FUNCTION__, __LINE__);
+                       continue;
+               }
                PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_add_media_source", WebRtcGetError(nRet));
 
                nRet = webrtc_media_source_set_mute(g_hWebRtcHandle, nId, WEBRTC_MEDIA_TYPE_VIDEO, bSetMute);
@@ -1441,10 +1445,6 @@ int ITc_media_webrtc_create_offer_async_p(void)
        callback_data cb_data = { .mainloop = NULL, .is_invoked = false };
 
        int nRet = webrtc_add_media_source(g_hWebRtcHandle, WEBRTC_MEDIA_SOURCE_TYPE_VIDEOTEST, &nId);
-       if (nRet == WEBRTC_ERROR_NOT_SUPPORTED) {
-               dlog_print(DLOG_DEBUG, "NativeTCT", "[%s(%d)] camera feature is not supported, skip it", __FUNCTION__, __LINE__);
-               return 0;
-       }
        PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_add_media_source", WebRtcGetError(nRet));
 
        nRet = webrtc_set_ice_candidate_cb(g_hWebRtcHandle, webrtcIceCandidateCB, NULL);
@@ -1777,10 +1777,6 @@ int ITc_media_webrtc_set_get_display_visible_p(void)
        callback_data cb_data = { .mainloop = NULL, .is_invoked = false };
 
        int nRet = webrtc_add_media_source(g_hWebRtcHandle, WEBRTC_MEDIA_SOURCE_TYPE_VIDEOTEST, &nId);
-       if (nRet == WEBRTC_ERROR_NOT_SUPPORTED) {
-               dlog_print(DLOG_DEBUG, "NativeTCT", "[%s(%d)] camera feature is not supported, skip it", __FUNCTION__, __LINE__);
-               return 0;
-       }
        PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_add_media_source", WebRtcGetError(nRet));
 
        nRet = webrtc_set_ice_candidate_cb(g_hWebRtcHandle, webrtcIceCandidateCB, NULL);
@@ -2197,30 +2193,30 @@ int ITc_media_webrtc_data_channel_set_unset_buffered_amount_low_cb_p(void)
 * @postcondition               NA
 */
 
-int ITc_media_webrtc_data_channel_get_buffered_amount_low_threshold_p(void)\r
-{\r
-       START_TEST;\r
-\r
+int ITc_media_webrtc_data_channel_get_buffered_amount_low_threshold_p(void)
+{
+       START_TEST;
+
        webrtc_data_channel_h hChannel;
-       char *pszChannel = "test data channel label";\r
-       unsigned int nThreshold;\r
-\r
-       int nRet = webrtc_create_data_channel(g_hWebRtcHandle, pszChannel, NULL, &hChannel);\r
+       char *pszChannel = "test data channel label";
+       unsigned int nThreshold;
+
+       int nRet = webrtc_create_data_channel(g_hWebRtcHandle, pszChannel, NULL, &hChannel);
        PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_create_data_channel", WebRtcGetError(nRet));
-       CHECK_HANDLE(hChannel, "webrtc_create_data_channel");\r
-\r
-       nRet = webrtc_data_channel_set_buffered_amount_low_cb(hChannel, TEST_BUFFERED_AMOUNT_THRESHOLD, dataChannelBufferedAmountLowCB, NULL);\r
-       PRINT_RESULT_CLEANUP(WEBRTC_ERROR_NONE, nRet, "webrtc_data_channel_set_buffered_amount_low_cb", WebRtcGetError(nRet), webrtc_destroy_data_channel(hChannel));\r
-\r
-       nRet = webrtc_data_channel_get_buffered_amount_low_threshold(hChannel, &nThreshold);\r
-       PRINT_RESULT_CLEANUP(WEBRTC_ERROR_NONE, nRet, "webrtc_data_channel_get_buffered_amount_low_threshold", WebRtcGetError(nRet), webrtc_destroy_data_channel(hChannel));\r
-\r
-       PRINT_RESULT_CLEANUP(TEST_BUFFERED_AMOUNT_THRESHOLD, nThreshold, "webrtc_data_channel_get_buffered_amount_low_threshold", WebRtcGetError(nRet), webrtc_destroy_data_channel(hChannel));\r
-\r
+       CHECK_HANDLE(hChannel, "webrtc_create_data_channel");
+
+       nRet = webrtc_data_channel_set_buffered_amount_low_cb(hChannel, TEST_BUFFERED_AMOUNT_THRESHOLD, dataChannelBufferedAmountLowCB, NULL);
+       PRINT_RESULT_CLEANUP(WEBRTC_ERROR_NONE, nRet, "webrtc_data_channel_set_buffered_amount_low_cb", WebRtcGetError(nRet), webrtc_destroy_data_channel(hChannel));
+
+       nRet = webrtc_data_channel_get_buffered_amount_low_threshold(hChannel, &nThreshold);
+       PRINT_RESULT_CLEANUP(WEBRTC_ERROR_NONE, nRet, "webrtc_data_channel_get_buffered_amount_low_threshold", WebRtcGetError(nRet), webrtc_destroy_data_channel(hChannel));
+
+       PRINT_RESULT_CLEANUP(TEST_BUFFERED_AMOUNT_THRESHOLD, nThreshold, "webrtc_data_channel_get_buffered_amount_low_threshold", WebRtcGetError(nRet), webrtc_destroy_data_channel(hChannel));
+
        nRet = webrtc_destroy_data_channel(hChannel);
-       PRINT_RESULT_NORETURN(WEBRTC_ERROR_NONE, nRet, "webrtc_destroy_data_channel", WebRtcGetError(nRet));\r
-\r
-       return 0;\r
+       PRINT_RESULT_NORETURN(WEBRTC_ERROR_NONE, nRet, "webrtc_destroy_data_channel", WebRtcGetError(nRet));
+
+       return 0;
 }
 /** @} */
 /** @} */