Enable video test on android

Review URL: https://webrtc-codereview.appspot.com/429006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1839 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
leozwang@webrtc.org
2012-03-05 19:34:06 +00:00
parent 8ea37f4f26
commit 66487e1629
4 changed files with 79 additions and 59 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
* *
* Use of this source code is governed by a BSD-style license * Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source * that can be found in the LICENSE file in the root of the source
@ -387,14 +387,14 @@ WebRtc_Word32 AndroidNativeOpenGl2Channel::Init(WebRtc_Word32 zOrder,
return -1; return -1;
} }
JNINativeMethod JNINativeMethod nativeFunctions[2] = {
nativeFunctions[2] = { { "DrawNative",
"DrawNative", "(J)V",
"(J)V", (void*) &AndroidNativeOpenGl2Channel::DrawNativeStatic, },
(void*) &AndroidNativeOpenGl2Channel::DrawNativeStatic, { "CreateOpenGLNative",
"CreateOpenGLNative", "(JII)I",
"(JII)I", (void*) &AndroidNativeOpenGl2Channel::CreateOpenGLNativeStatic },
(void*) &AndroidNativeOpenGl2Channel::CreateOpenGLNativeStatic }; };
if (env->RegisterNatives(javaRenderClass, nativeFunctions, 2) == 0) if (env->RegisterNatives(javaRenderClass, nativeFunctions, 2) == 0)
{ {
WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, -1, WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, -1,
@ -492,4 +492,3 @@ jint AndroidNativeOpenGl2Channel::CreateOpenGLNative(int width, int height)
} }
} //namespace webrtc } //namespace webrtc

View File

@ -37,6 +37,11 @@
'video_render_frames.h', 'video_render_frames.h',
'video_render_impl.h', 'video_render_impl.h',
'i_video_render.h', 'i_video_render.h',
# Android
'Android/video_render_android_impl.h',
'Android/video_render_android_native_opengl2.h',
'Android/video_render_android_surface_view.h',
'Android/video_render_opengles20.h',
# Linux # Linux
'linux/video_render_linux_impl.h', 'linux/video_render_linux_impl.h',
'linux/video_x11_channel.h', 'linux/video_x11_channel.h',
@ -61,6 +66,11 @@
'video_render_frames.cc', 'video_render_frames.cc',
'video_render_impl.cc', 'video_render_impl.cc',
# PLATFORM SPECIFIC SOURCE FILES - Will be filtered below # PLATFORM SPECIFIC SOURCE FILES - Will be filtered below
# Android
'Android/video_render_android_impl.cc',
'Android/video_render_android_native_opengl2.cc',
'Android/video_render_android_surface_view.cc',
'Android/video_render_opengles20.cc',
# Linux # Linux
'linux/video_render_linux_impl.cc', 'linux/video_render_linux_impl.cc',
'linux/video_x11_channel.cc', 'linux/video_x11_channel.cc',
@ -87,6 +97,19 @@
'WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER', 'WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER',
], ],
}], }],
['OS!="android" or include_internal_video_render==0', {
'sources!': [
# Android
'Android/video_render_android_impl.h',
'Android/video_render_android_native_opengl2.h',
'Android/video_render_android_surface_view.h',
'Android/video_render_opengles20.h',
'Android/video_render_android_impl.cc',
'Android/video_render_android_native_opengl2.cc',
'Android/video_render_android_surface_view.cc',
'Android/video_render_opengles20.cc',
],
}],
['OS!="linux" or include_internal_video_render==0', { ['OS!="linux" or include_internal_video_render==0', {
'sources!': [ 'sources!': [
'linux/video_render_linux_impl.h', 'linux/video_render_linux_impl.h',

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
* *
* Use of this source code is governed by a BSD-style license * Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source * that can be found in the LICENSE file in the root of the source
@ -26,30 +26,21 @@ int ViEAutoTestAndroid::RunAutotest(int testSelection, int subTestSelection,
// voice engine calls into ADM directly // voice engine calls into ADM directly
webrtc::VoiceEngine::SetAndroidAudioDeviceObjects(javaVM, env, context); webrtc::VoiceEngine::SetAndroidAudioDeviceObjects(javaVM, env, context);
#endif #endif
int testErrors = 0;
if (subTestSelection == 0) { if (subTestSelection == 0) {
// Run all selected test // Run all selected test
switch (testSelection) { switch (testSelection) {
case 0: case 0:
testErrors += vieAutoTest.ViEStandardTest(); 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; break;
case 1: case 1:
testErrors += vieAutoTest.ViEAPITest(); vieAutoTest.ViEAPITest();
break; break;
case 2: case 2:
testErrors += vieAutoTest.ViEExtendedTest(); vieAutoTest.ViEExtendedTest();
break; break;
case 3: case 3:
testErrors += vieAutoTest.ViELoopbackCall(); vieAutoTest.ViELoopbackCall();
break; break;
default: default:
break; break;
@ -60,39 +51,39 @@ int ViEAutoTestAndroid::RunAutotest(int testSelection, int subTestSelection,
case 0: // Specific standard test case 0: // Specific standard test
switch (subTestSelection) { switch (subTestSelection) {
case 1: // base case 1: // base
testErrors += vieAutoTest.ViEBaseStandardTest(); vieAutoTest.ViEBaseStandardTest();
break; break;
case 2: // capture case 2: // capture
testErrors += vieAutoTest.ViECaptureStandardTest(); vieAutoTest.ViECaptureStandardTest();
break; break;
case 3: // codec case 3: // codec
testErrors += vieAutoTest.ViECodecStandardTest(); vieAutoTest.ViECodecStandardTest();
break; break;
case 5: //encryption case 5: //encryption
testErrors += vieAutoTest.ViEEncryptionStandardTest(); vieAutoTest.ViEEncryptionStandardTest();
break; break;
case 6: // file case 6: // file
testErrors += vieAutoTest.ViEFileStandardTest(); vieAutoTest.ViEFileStandardTest();
break; break;
case 7: // image process case 7: // image process
testErrors += vieAutoTest.ViEImageProcessStandardTest(); vieAutoTest.ViEImageProcessStandardTest();
break; break;
case 8: // network case 8: // network
testErrors += vieAutoTest.ViENetworkStandardTest(); vieAutoTest.ViENetworkStandardTest();
break; break;
case 9: // Render case 9: // Render
testErrors += vieAutoTest.ViERenderStandardTest(); vieAutoTest.ViERenderStandardTest();
break; break;
case 10: // RTP/RTCP case 10: // RTP/RTCP
testErrors += vieAutoTest.ViERtpRtcpStandardTest(); vieAutoTest.ViERtpRtcpStandardTest();
break; break;
default: default:
@ -103,39 +94,39 @@ int ViEAutoTestAndroid::RunAutotest(int testSelection, int subTestSelection,
case 1:// specific API case 1:// specific API
switch (subTestSelection) { switch (subTestSelection) {
case 1: // base case 1: // base
testErrors += vieAutoTest.ViEBaseAPITest(); vieAutoTest.ViEBaseAPITest();
break; break;
case 2: // capture case 2: // capture
testErrors += vieAutoTest.ViECaptureAPITest(); vieAutoTest.ViECaptureAPITest();
break; break;
case 3: // codec case 3: // codec
testErrors += vieAutoTest.ViECodecAPITest(); vieAutoTest.ViECodecAPITest();
break; break;
case 5: //encryption case 5: //encryption
testErrors += vieAutoTest.ViEEncryptionAPITest(); vieAutoTest.ViEEncryptionAPITest();
break; break;
case 6: // file case 6: // file
testErrors += vieAutoTest.ViEFileAPITest(); vieAutoTest.ViEFileAPITest();
break; break;
case 7: // image process case 7: // image process
testErrors += vieAutoTest.ViEImageProcessAPITest(); vieAutoTest.ViEImageProcessAPITest();
break; break;
case 8: // network case 8: // network
testErrors += vieAutoTest.ViENetworkAPITest(); vieAutoTest.ViENetworkAPITest();
break; break;
case 9: // Render case 9: // Render
testErrors += vieAutoTest.ViERenderAPITest(); vieAutoTest.ViERenderAPITest();
break; break;
case 10: // RTP/RTCP case 10: // RTP/RTCP
testErrors += vieAutoTest.ViERtpRtcpAPITest(); vieAutoTest.ViERtpRtcpAPITest();
break; break;
case 11: case 11:
break; break;
@ -148,39 +139,39 @@ int ViEAutoTestAndroid::RunAutotest(int testSelection, int subTestSelection,
case 2:// specific extended case 2:// specific extended
switch (subTestSelection) { switch (subTestSelection) {
case 1: // base case 1: // base
testErrors += vieAutoTest.ViEBaseExtendedTest(); vieAutoTest.ViEBaseExtendedTest();
break; break;
case 2: // capture case 2: // capture
testErrors += vieAutoTest.ViECaptureExtendedTest(); vieAutoTest.ViECaptureExtendedTest();
break; break;
case 3: // codec case 3: // codec
testErrors += vieAutoTest.ViECodecExtendedTest(); vieAutoTest.ViECodecExtendedTest();
break; break;
case 5: //encryption case 5: //encryption
testErrors += vieAutoTest.ViEEncryptionExtendedTest(); vieAutoTest.ViEEncryptionExtendedTest();
break; break;
case 6: // file case 6: // file
testErrors += vieAutoTest.ViEFileExtendedTest(); vieAutoTest.ViEFileExtendedTest();
break; break;
case 7: // image process case 7: // image process
testErrors += vieAutoTest.ViEImageProcessExtendedTest(); vieAutoTest.ViEImageProcessExtendedTest();
break; break;
case 8: // network case 8: // network
testErrors += vieAutoTest.ViENetworkExtendedTest(); vieAutoTest.ViENetworkExtendedTest();
break; break;
case 9: // Render case 9: // Render
testErrors += vieAutoTest.ViERenderExtendedTest(); vieAutoTest.ViERenderExtendedTest();
break; break;
case 10: // RTP/RTCP case 10: // RTP/RTCP
testErrors += vieAutoTest.ViERtpRtcpExtendedTest(); vieAutoTest.ViERtpRtcpExtendedTest();
break; break;
case 11: case 11:
@ -192,18 +183,17 @@ int ViEAutoTestAndroid::RunAutotest(int testSelection, int subTestSelection,
break; break;
case 3: case 3:
testErrors += vieAutoTest.ViELoopbackCall(); vieAutoTest.ViELoopbackCall();
break; break;
default: default:
break; break;
} }
if (testErrors) { return 0;
ViETest::Log("Test done with %d errors!\n", testErrors); }
}
else { int main(int argc, char** argv) {
ViETest::Log("Test passed!\n"); // TODO(leozwang): Add real tests here
} return 0;
return testErrors;
} }

View File

@ -105,6 +105,8 @@
'source/vie_file_based_comparison_tests.cc', 'source/vie_file_based_comparison_tests.cc',
# Platform dependent # Platform dependent
# Android
'source/vie_autotest_android.cc',
# Linux # Linux
'source/vie_autotest_linux.cc', 'source/vie_autotest_linux.cc',
'source/vie_window_manager_factory_linux.cc', 'source/vie_window_manager_factory_linux.cc',
@ -119,6 +121,12 @@
'conditions': [ 'conditions': [
# TODO(andrew): this likely isn't an actual dependency. It should be # TODO(andrew): this likely isn't an actual dependency. It should be
# included in webrtc.gyp or video_engine.gyp instead. # included in webrtc.gyp or video_engine.gyp instead.
['OS=="android"', {
'libraries': [
'-lGLESv2',
'-llog',
],
}],
['OS=="win"', { ['OS=="win"', {
'dependencies': [ 'dependencies': [
'vie_win_test', 'vie_win_test',