From 657f483c268ebd6901f9332643e5835e6d623403 Mon Sep 17 00:00:00 2001 From: "leozwang@google.com" Date: Tue, 20 Sep 2011 16:41:20 +0000 Subject: [PATCH] Fix compilation error Review URL: http://webrtc-codereview.appspot.com/162003 git-svn-id: http://webrtc.googlecode.com/svn/trunk@630 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../main/test/AutoTest/android/jni/Android.mk | 7 +- .../main/test/AutoTest/source/Android.mk | 3 +- .../AutoTest/source/vie_autotest_android.cc | 352 +++++++++--------- 3 files changed, 180 insertions(+), 182 deletions(-) diff --git a/src/video_engine/main/test/AutoTest/android/jni/Android.mk b/src/video_engine/main/test/AutoTest/android/jni/Android.mk index a834e2c3e..002442787 100644 --- a/src/video_engine/main/test/AutoTest/android/jni/Android.mk +++ b/src/video_engine/main/test/AutoTest/android/jni/Android.mk @@ -39,18 +39,21 @@ LOCAL_SRC_FILES := \ LOCAL_CFLAGS := \ '-DWEBRTC_TARGET_PC' \ - '-DWEBRTC_ANDROID' + '-DWEBRTC_ANDROID' \ + '-DWEBRTC_ANDROID_OPENSLES' LOCAL_C_INCLUDES := \ external/gtest/include \ $(LOCAL_PATH)/../interface \ $(LOCAL_PATH)/../../interface \ - $(LOCAL_PATH)/../../../../../.. \ $(LOCAL_PATH)/../../../../interface \ $(LOCAL_PATH)/../../../../source \ + $(LOCAL_PATH)/../../../../../.. \ $(LOCAL_PATH)/../../../../../../common_video/interface \ + $(LOCAL_PATH)/../../../../../../common_video/vplib/main/interface \ $(LOCAL_PATH)/../../../../../../modules/interface \ $(LOCAL_PATH)/../../../../../../modules/video_capture/main/interface \ + $(LOCAL_PATH)/../../../../../../modules/video_capture/main/source \ $(LOCAL_PATH)/../../../../../../modules/video_coding/codecs/interface \ $(LOCAL_PATH)/../../../../../../modules/video_render/main/interface \ $(LOCAL_PATH)/../../../../../../voice_engine/main/interface \ diff --git a/src/video_engine/main/test/AutoTest/source/Android.mk b/src/video_engine/main/test/AutoTest/source/Android.mk index 8474c248f..d8f45f9f1 100644 --- a/src/video_engine/main/test/AutoTest/source/Android.mk +++ b/src/video_engine/main/test/AutoTest/source/Android.mk @@ -33,7 +33,8 @@ LOCAL_SRC_FILES:= \ # Flags passed to both C and C++ files. LOCAL_CFLAGS := \ '-DWEBRTC_TARGET_PC' \ - '-DWEBRTC_ANDROID' + '-DWEBRTC_ANDROID' \ + '-DWEBRTC_ANDROID_OPENSLES' LOCAL_C_INCLUDES := \ $(LOCAL_PATH)/../interface \ diff --git a/src/video_engine/main/test/AutoTest/source/vie_autotest_android.cc b/src/video_engine/main/test/AutoTest/source/vie_autotest_android.cc index cd206f417..81af69bbd 100644 --- a/src/video_engine/main/test/AutoTest/source/vie_autotest_android.cc +++ b/src/video_engine/main/test/AutoTest/source/vie_autotest_android.cc @@ -17,199 +17,193 @@ #include "vie_autotest_defines.h" int ViEAutoTestAndroid::RunAutotest(int testSelection, int subTestSelection, - void* window1, void* window2, void* javaVM, - void* env, void* context) -{ - ViEAutoTest vieAutoTest(window1, window2); - ViETest::Log("RunAutoTest(%d, %d)", testSelection, subTestSelection); - VideoEngine::SetAndroidObjects(javaVM, context); - VoiceEngine::SetAndroidObjects(javaVM, env, context); - int testErrors = 0; + void* window1, void* window2, + void* javaVM, void* env, void* context) { + ViEAutoTest vieAutoTest(window1, window2); + ViETest::Log("RunAutoTest(%d, %d)", testSelection, subTestSelection); + webrtc::VideoEngine::SetAndroidObjects(javaVM, context); +#ifndef WEBRTC_ANDROID_OPENSLES + // voice engine calls into ADM directly + webrtc::VoiceEngine::SetAndroidAudioDeviceObjects(javaVM, env, context); +#endif + int testErrors = 0; - if (subTestSelection == 0) - { - // Run all selected test - switch (testSelection) - { - case 0: - testErrors += vieAutoTest.ViEStandardTest(); - if (testErrors == 0) - { - // No errors found in delivery test, create delivery - ViETest::Log("Standard/delivery passed. "); - } - else - { - // Didn't pass - ViETest::Log("\nStandard/delivery test failed."); - } - break; - case 1: - testErrors += vieAutoTest.ViEAPITest(); - break; - case 2: - testErrors += vieAutoTest.ViEExtendedTest(); - break; - case 3: - testErrors += vieAutoTest.ViELoopbackCall(); - break; - default: - break; + if (subTestSelection == 0) { + // Run all selected test + switch (testSelection) { + case 0: + testErrors += vieAutoTest.ViEStandardTest(); + if (testErrors == 0) { + // No errors found in delivery test, create delivery + ViETest::Log("Standard/delivery passed. "); } + else { + // Didn't pass + ViETest::Log("\nStandard/delivery test failed."); + } + break; + case 1: + testErrors += vieAutoTest.ViEAPITest(); + break; + case 2: + testErrors += vieAutoTest.ViEExtendedTest(); + break; + case 3: + testErrors += vieAutoTest.ViELoopbackCall(); + break; + default: + break; } + } - switch (testSelection) - { - case 0: // Specific standard test - switch (subTestSelection) - { - case 1: // base - testErrors += vieAutoTest.ViEBaseStandardTest(); - break; + switch (testSelection) { + case 0: // Specific standard test + switch (subTestSelection) { + case 1: // base + testErrors += vieAutoTest.ViEBaseStandardTest(); + break; - case 2: // capture - testErrors += vieAutoTest.ViECaptureStandardTest(); - break; + case 2: // capture + testErrors += vieAutoTest.ViECaptureStandardTest(); + break; - case 3: // codec - testErrors += vieAutoTest.ViECodecStandardTest(); - break; + case 3: // codec + testErrors += vieAutoTest.ViECodecStandardTest(); + break; - case 5: //encryption - testErrors += vieAutoTest.ViEEncryptionStandardTest(); - break; + case 5: //encryption + testErrors += vieAutoTest.ViEEncryptionStandardTest(); + break; - case 6: // file - testErrors += vieAutoTest.ViEFileStandardTest(); - break; + case 6: // file + testErrors += vieAutoTest.ViEFileStandardTest(); + break; - case 7: // image process - testErrors += vieAutoTest.ViEImageProcessStandardTest(); - break; + case 7: // image process + testErrors += vieAutoTest.ViEImageProcessStandardTest(); + break; - case 8: // network - testErrors += vieAutoTest.ViENetworkStandardTest(); - break; + case 8: // network + testErrors += vieAutoTest.ViENetworkStandardTest(); + break; - case 9: // Render - testErrors += vieAutoTest.ViERenderStandardTest(); - break; + case 9: // Render + testErrors += vieAutoTest.ViERenderStandardTest(); + break; - case 10: // RTP/RTCP - testErrors += vieAutoTest.ViERtpRtcpStandardTest(); - break; + case 10: // RTP/RTCP + testErrors += vieAutoTest.ViERtpRtcpStandardTest(); + break; - default: - break; - } - break; - - case 1:// specific API - switch (subTestSelection) - { - case 1: // base - testErrors += vieAutoTest.ViEBaseAPITest(); - break; - - case 2: // capture - testErrors += vieAutoTest.ViECaptureAPITest(); - break; - - case 3: // codec - testErrors += vieAutoTest.ViECodecAPITest(); - break; - - case 5: //encryption - testErrors += vieAutoTest.ViEEncryptionAPITest(); - break; - - case 6: // file - testErrors += vieAutoTest.ViEFileAPITest(); - break; - - case 7: // image process - testErrors += vieAutoTest.ViEImageProcessAPITest(); - break; - - case 8: // network - testErrors += vieAutoTest.ViENetworkAPITest(); - break; - - case 9: // Render - testErrors += vieAutoTest.ViERenderAPITest(); - break; - - case 10: // RTP/RTCP - testErrors += vieAutoTest.ViERtpRtcpAPITest(); - break; - case 11: - break; - - default: - break; - } - break; - - case 2:// specific extended - - switch (subTestSelection) - { - case 1: // base - testErrors += vieAutoTest.ViEBaseExtendedTest(); - break; - - case 2: // capture - testErrors += vieAutoTest.ViECaptureExtendedTest(); - break; - - case 3: // codec - testErrors += vieAutoTest.ViECodecExtendedTest(); - break; - - case 5: //encryption - testErrors += vieAutoTest.ViEEncryptionExtendedTest(); - break; - - case 6: // file - testErrors += vieAutoTest.ViEFileExtendedTest(); - break; - - case 7: // image process - testErrors += vieAutoTest.ViEImageProcessExtendedTest(); - break; - - case 8: // network - testErrors += vieAutoTest.ViENetworkExtendedTest(); - break; - - case 9: // Render - testErrors += vieAutoTest.ViERenderExtendedTest(); - break; - - case 10: // RTP/RTCP - testErrors += vieAutoTest.ViERtpRtcpExtendedTest(); - break; - case 11: - break; - - default: - break; - } - break; - case 3: - testErrors += vieAutoTest.ViELoopbackCall(); - break; default: - break; + break; + } + break; + + case 1:// specific API + switch (subTestSelection) { + case 1: // base + testErrors += vieAutoTest.ViEBaseAPITest(); + break; + + case 2: // capture + testErrors += vieAutoTest.ViECaptureAPITest(); + break; + + case 3: // codec + testErrors += vieAutoTest.ViECodecAPITest(); + break; + + case 5: //encryption + testErrors += vieAutoTest.ViEEncryptionAPITest(); + break; + + case 6: // file + testErrors += vieAutoTest.ViEFileAPITest(); + break; + + case 7: // image process + testErrors += vieAutoTest.ViEImageProcessAPITest(); + break; + + case 8: // network + testErrors += vieAutoTest.ViENetworkAPITest(); + break; + + case 9: // Render + testErrors += vieAutoTest.ViERenderAPITest(); + break; + + case 10: // RTP/RTCP + testErrors += vieAutoTest.ViERtpRtcpAPITest(); + break; + case 11: + break; + + default: + break; + } + break; + + case 2:// specific extended + switch (subTestSelection) { + case 1: // base + testErrors += vieAutoTest.ViEBaseExtendedTest(); + break; + + case 2: // capture + testErrors += vieAutoTest.ViECaptureExtendedTest(); + break; + + case 3: // codec + testErrors += vieAutoTest.ViECodecExtendedTest(); + break; + + case 5: //encryption + testErrors += vieAutoTest.ViEEncryptionExtendedTest(); + break; + + case 6: // file + testErrors += vieAutoTest.ViEFileExtendedTest(); + break; + + case 7: // image process + testErrors += vieAutoTest.ViEImageProcessExtendedTest(); + break; + + case 8: // network + testErrors += vieAutoTest.ViENetworkExtendedTest(); + break; + + case 9: // Render + testErrors += vieAutoTest.ViERenderExtendedTest(); + break; + + case 10: // RTP/RTCP + testErrors += vieAutoTest.ViERtpRtcpExtendedTest(); + break; + + case 11: + break; + + default: + break; + } + break; + + case 3: + testErrors += vieAutoTest.ViELoopbackCall(); + break; + + default: + break; } - if (testErrors) - { - ViETest::Log("Test done with %d errors!\n", testErrors); - } - else - { - ViETest::Log("Test passed!\n"); - } - return testErrors; + if (testErrors) { + ViETest::Log("Test done with %d errors!\n", testErrors); + } + else { + ViETest::Log("Test passed!\n"); + } + return testErrors; }