[ITC][webrtc][non-ACR] Revise ITc_media_webrtc_media_source_set_get_mute_p() to incre... 92/269892/3
authorSangchul Lee <sc11.lee@samsung.com>
Fri, 21 Jan 2022 08:11:40 +0000 (17:11 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 24 Jan 2022 02:06:30 +0000 (11:06 +0900)
Change-Id: I9ca577e21185dd089692f6d078c5f6e4a2ca1a80
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
src/itc/webrtc/ITs-webrtc.c

index 7fc75c1e6e40947321ee720a53faeebf57e15fcb..5beda659fda7e0e34411d993dcca269de9a23198 100755 (executable)
@@ -616,19 +616,27 @@ int ITc_media_webrtc_media_source_set_get_mute_p(void)
        START_TEST;
        unsigned int nId;
        bool bGetMute, bSetMute = true;
-
-       int nRet = webrtc_add_media_source(g_hWebRtcHandle, WEBRTC_MEDIA_SOURCE_TYPE_VIDEOTEST, &nId);
-       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);
-       PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_media_source_set_mute", WebRtcGetError(nRet));
-
-       nRet = webrtc_media_source_get_mute(g_hWebRtcHandle, nId, WEBRTC_MEDIA_TYPE_VIDEO, &bGetMute);
-       PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_media_source_get_mute", WebRtcGetError(nRet));
-       if(bSetMute != bGetMute)
-       {
-               FPRINTF("[Line : %d][%s] mute set get mismatch\\n", __LINE__, API_NAMESPACE);
-               return 1;
+       int nRet;
+       int i;
+       webrtc_media_source_type_e valid_types[] = {
+               WEBRTC_MEDIA_SOURCE_TYPE_VIDEOTEST,
+               WEBRTC_MEDIA_SOURCE_TYPE_CAMERA,
+               WEBRTC_MEDIA_SOURCE_TYPE_SCREEN,
+       };
+
+       for (i = 0; i < sizeof(valid_types) / sizeof(valid_types[0]); i++) {
+               nRet = webrtc_add_media_source(g_hWebRtcHandle, valid_types[i], &nId);
+               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);
+               PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_media_source_set_mute", WebRtcGetError(nRet));
+
+               nRet = webrtc_media_source_get_mute(g_hWebRtcHandle, nId, WEBRTC_MEDIA_TYPE_VIDEO, &bGetMute);
+               PRINT_RESULT(WEBRTC_ERROR_NONE, nRet, "webrtc_media_source_get_mute", WebRtcGetError(nRet));
+               if (bSetMute != bGetMute) {
+                       FPRINTF("[Line : %d][%s] mute set get mismatch\\n", __LINE__, API_NAMESPACE);
+                       return 1;
+               }
        }
 
        return 0;