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
* 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;
}
JNINativeMethod
nativeFunctions[2] = {
"DrawNative",
"(J)V",
(void*) &AndroidNativeOpenGl2Channel::DrawNativeStatic,
"CreateOpenGLNative",
"(JII)I",
(void*) &AndroidNativeOpenGl2Channel::CreateOpenGLNativeStatic };
JNINativeMethod nativeFunctions[2] = {
{ "DrawNative",
"(J)V",
(void*) &AndroidNativeOpenGl2Channel::DrawNativeStatic, },
{ "CreateOpenGLNative",
"(JII)I",
(void*) &AndroidNativeOpenGl2Channel::CreateOpenGLNativeStatic },
};
if (env->RegisterNatives(javaRenderClass, nativeFunctions, 2) == 0)
{
WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, -1,
@ -492,4 +492,3 @@ jint AndroidNativeOpenGl2Channel::CreateOpenGLNative(int width, int height)
}
} //namespace webrtc

View File

@ -37,6 +37,11 @@
'video_render_frames.h',
'video_render_impl.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/video_render_linux_impl.h',
'linux/video_x11_channel.h',
@ -61,6 +66,11 @@
'video_render_frames.cc',
'video_render_impl.cc',
# 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/video_render_linux_impl.cc',
'linux/video_x11_channel.cc',
@ -87,6 +97,19 @@
'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', {
'sources!': [
'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
* 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
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.");
}
vieAutoTest.ViEStandardTest();
break;
case 1:
testErrors += vieAutoTest.ViEAPITest();
vieAutoTest.ViEAPITest();
break;
case 2:
testErrors += vieAutoTest.ViEExtendedTest();
vieAutoTest.ViEExtendedTest();
break;
case 3:
testErrors += vieAutoTest.ViELoopbackCall();
vieAutoTest.ViELoopbackCall();
break;
default:
break;
@ -60,39 +51,39 @@ int ViEAutoTestAndroid::RunAutotest(int testSelection, int subTestSelection,
case 0: // Specific standard test
switch (subTestSelection) {
case 1: // base
testErrors += vieAutoTest.ViEBaseStandardTest();
vieAutoTest.ViEBaseStandardTest();
break;
case 2: // capture
testErrors += vieAutoTest.ViECaptureStandardTest();
vieAutoTest.ViECaptureStandardTest();
break;
case 3: // codec
testErrors += vieAutoTest.ViECodecStandardTest();
vieAutoTest.ViECodecStandardTest();
break;
case 5: //encryption
testErrors += vieAutoTest.ViEEncryptionStandardTest();
vieAutoTest.ViEEncryptionStandardTest();
break;
case 6: // file
testErrors += vieAutoTest.ViEFileStandardTest();
vieAutoTest.ViEFileStandardTest();
break;
case 7: // image process
testErrors += vieAutoTest.ViEImageProcessStandardTest();
vieAutoTest.ViEImageProcessStandardTest();
break;
case 8: // network
testErrors += vieAutoTest.ViENetworkStandardTest();
vieAutoTest.ViENetworkStandardTest();
break;
case 9: // Render
testErrors += vieAutoTest.ViERenderStandardTest();
vieAutoTest.ViERenderStandardTest();
break;
case 10: // RTP/RTCP
testErrors += vieAutoTest.ViERtpRtcpStandardTest();
vieAutoTest.ViERtpRtcpStandardTest();
break;
default:
@ -103,39 +94,39 @@ int ViEAutoTestAndroid::RunAutotest(int testSelection, int subTestSelection,
case 1:// specific API
switch (subTestSelection) {
case 1: // base
testErrors += vieAutoTest.ViEBaseAPITest();
vieAutoTest.ViEBaseAPITest();
break;
case 2: // capture
testErrors += vieAutoTest.ViECaptureAPITest();
vieAutoTest.ViECaptureAPITest();
break;
case 3: // codec
testErrors += vieAutoTest.ViECodecAPITest();
vieAutoTest.ViECodecAPITest();
break;
case 5: //encryption
testErrors += vieAutoTest.ViEEncryptionAPITest();
vieAutoTest.ViEEncryptionAPITest();
break;
case 6: // file
testErrors += vieAutoTest.ViEFileAPITest();
vieAutoTest.ViEFileAPITest();
break;
case 7: // image process
testErrors += vieAutoTest.ViEImageProcessAPITest();
vieAutoTest.ViEImageProcessAPITest();
break;
case 8: // network
testErrors += vieAutoTest.ViENetworkAPITest();
vieAutoTest.ViENetworkAPITest();
break;
case 9: // Render
testErrors += vieAutoTest.ViERenderAPITest();
vieAutoTest.ViERenderAPITest();
break;
case 10: // RTP/RTCP
testErrors += vieAutoTest.ViERtpRtcpAPITest();
vieAutoTest.ViERtpRtcpAPITest();
break;
case 11:
break;
@ -148,39 +139,39 @@ int ViEAutoTestAndroid::RunAutotest(int testSelection, int subTestSelection,
case 2:// specific extended
switch (subTestSelection) {
case 1: // base
testErrors += vieAutoTest.ViEBaseExtendedTest();
vieAutoTest.ViEBaseExtendedTest();
break;
case 2: // capture
testErrors += vieAutoTest.ViECaptureExtendedTest();
vieAutoTest.ViECaptureExtendedTest();
break;
case 3: // codec
testErrors += vieAutoTest.ViECodecExtendedTest();
vieAutoTest.ViECodecExtendedTest();
break;
case 5: //encryption
testErrors += vieAutoTest.ViEEncryptionExtendedTest();
vieAutoTest.ViEEncryptionExtendedTest();
break;
case 6: // file
testErrors += vieAutoTest.ViEFileExtendedTest();
vieAutoTest.ViEFileExtendedTest();
break;
case 7: // image process
testErrors += vieAutoTest.ViEImageProcessExtendedTest();
vieAutoTest.ViEImageProcessExtendedTest();
break;
case 8: // network
testErrors += vieAutoTest.ViENetworkExtendedTest();
vieAutoTest.ViENetworkExtendedTest();
break;
case 9: // Render
testErrors += vieAutoTest.ViERenderExtendedTest();
vieAutoTest.ViERenderExtendedTest();
break;
case 10: // RTP/RTCP
testErrors += vieAutoTest.ViERtpRtcpExtendedTest();
vieAutoTest.ViERtpRtcpExtendedTest();
break;
case 11:
@ -192,18 +183,17 @@ int ViEAutoTestAndroid::RunAutotest(int testSelection, int subTestSelection,
break;
case 3:
testErrors += vieAutoTest.ViELoopbackCall();
vieAutoTest.ViELoopbackCall();
break;
default:
break;
}
if (testErrors) {
ViETest::Log("Test done with %d errors!\n", testErrors);
}
else {
ViETest::Log("Test passed!\n");
}
return testErrors;
return 0;
}
int main(int argc, char** argv) {
// TODO(leozwang): Add real tests here
return 0;
}

View File

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