Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Unified Diff: talk/app/webrtc/androidtests/src/org/webrtc/VideoCapturerAndroidTest.java

Issue 1401023003: Make VideoCapturerAndroid work on SDK level 16 (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: talk/app/webrtc/androidtests/src/org/webrtc/VideoCapturerAndroidTest.java
diff --git a/talk/app/webrtc/androidtests/src/org/webrtc/VideoCapturerAndroidTest.java b/talk/app/webrtc/androidtests/src/org/webrtc/VideoCapturerAndroidTest.java
index c139e2f3038d4923812f7c3d8b39f3be2e7a3b66..1dea3bfdbc5109b2483bda254290a9b233960a63 100644
--- a/talk/app/webrtc/androidtests/src/org/webrtc/VideoCapturerAndroidTest.java
+++ b/talk/app/webrtc/androidtests/src/org/webrtc/VideoCapturerAndroidTest.java
@@ -27,17 +27,22 @@
package org.webrtc;
import android.opengl.EGL14;
+import android.os.Build;
import android.test.ActivityTestCase;
import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.SmallTest;
+import android.util.Log;
import android.util.Size;
import org.webrtc.CameraEnumerationAndroid.CaptureFormat;
+
import java.util.HashSet;
import java.util.Set;
@SuppressWarnings("deprecation")
public class VideoCapturerAndroidTest extends ActivityTestCase {
+ static final String TAG = "VideoCapturerAndroidTest";
+
@Override
protected void setUp() {
assertTrue(PeerConnectionFactory.initializeAndroidGlobals(
@@ -82,6 +87,10 @@ public class VideoCapturerAndroidTest extends ActivityTestCase {
@SmallTest
public void testCreateAndReleaseUsingTextures() {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
+ Log.i(TAG, "Capturing to textures is not supported, requires EGL14.");
+ return;
+ }
VideoCapturerAndroidTestFixtures.release(
VideoCapturerAndroid.create("", null, EGL14.EGL_NO_CONTEXT));
}
@@ -105,6 +114,10 @@ public class VideoCapturerAndroidTest extends ActivityTestCase {
@SmallTest
public void testStartVideoCapturerUsingTextures() throws InterruptedException {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
+ Log.i(TAG, "Capturing to textures is not supported, requires EGL14.");
+ return;
+ }
VideoCapturerAndroid capturer =
VideoCapturerAndroid.create("", null, EGL14.EGL_NO_CONTEXT);
VideoCapturerAndroidTestFixtures.startCapturerAndRender(capturer);
@@ -147,6 +160,10 @@ public class VideoCapturerAndroidTest extends ActivityTestCase {
@SmallTest
public void testSwitchVideoCapturerUsingTextures() throws InterruptedException {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
+ Log.i(TAG, "Capturing to textures is not supported, requires EGL14.");
+ return;
+ }
VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null, EGL14.EGL_NO_CONTEXT);
VideoCapturerAndroidTestFixtures.switchCamera(capturer);
}
@@ -163,6 +180,10 @@ public class VideoCapturerAndroidTest extends ActivityTestCase {
@MediumTest
public void testCameraCallsAfterStopUsingTextures() throws InterruptedException {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
+ Log.i(TAG, "Capturing to textures is not supported, requires EGL14.");
+ return;
+ }
final String deviceName = CameraEnumerationAndroid.getDeviceName(0);
final VideoCapturerAndroid capturer = VideoCapturerAndroid.create(deviceName, null,
EGL14.EGL_NO_CONTEXT);
@@ -181,6 +202,10 @@ public class VideoCapturerAndroidTest extends ActivityTestCase {
@SmallTest
public void testStopRestartVideoSourceUsingTextures() throws InterruptedException {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
+ Log.i(TAG, "Capturing to textures is not supported, requires EGL14.");
+ return;
+ }
VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null, EGL14.EGL_NO_CONTEXT);
VideoCapturerAndroidTestFixtures.stopRestartVideoSource(capturer);
}
@@ -198,6 +223,10 @@ public class VideoCapturerAndroidTest extends ActivityTestCase {
@SmallTest
public void testStartStopWithDifferentResolutionsUsingTextures() throws InterruptedException {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
+ Log.i(TAG, "Capturing to textures is not supported, requires EGL14.");
+ return;
+ }
String deviceName = CameraEnumerationAndroid.getDeviceName(0);
VideoCapturerAndroid capturer =
VideoCapturerAndroid.create(deviceName, null, EGL14.EGL_NO_CONTEXT);
@@ -218,6 +247,10 @@ public class VideoCapturerAndroidTest extends ActivityTestCase {
@SmallTest
public void testReturnBufferLateUsingTextures() throws InterruptedException {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
+ Log.i(TAG, "Capturing to textures is not supported, requires EGL14.");
+ return;
+ }
String deviceName = CameraEnumerationAndroid.getDeviceName(0);
VideoCapturerAndroid capturer =
VideoCapturerAndroid.create(deviceName, null, EGL14.EGL_NO_CONTEXT);
@@ -236,6 +269,10 @@ public class VideoCapturerAndroidTest extends ActivityTestCase {
@MediumTest
public void testReturnBufferLateEndToEndUsingTextures() throws InterruptedException {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
+ Log.i(TAG, "Capturing to textures is not supported, requires EGL14.");
+ return;
+ }
final VideoCapturerAndroid capturer =
VideoCapturerAndroid.create("", null, EGL14.EGL_NO_CONTEXT);
VideoCapturerAndroidTestFixtures.returnBufferLateEndToEnd(capturer);
« no previous file with comments | « talk/app/webrtc/androidtests/AndroidManifest.xml ('k') | talk/app/webrtc/java/android/org/webrtc/ThreadUtils.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698