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;