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

Unified Diff: webrtc/api/androidtests/src/org/webrtc/VideoCapturerAndroidTestFixtures.java

Issue 2013433003: WIP: Android Camera2 capture implementation (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix CaptureFormat jni parsing Created 4 years, 7 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: webrtc/api/androidtests/src/org/webrtc/VideoCapturerAndroidTestFixtures.java
diff --git a/webrtc/api/androidtests/src/org/webrtc/VideoCapturerAndroidTestFixtures.java b/webrtc/api/androidtests/src/org/webrtc/VideoCapturerAndroidTestFixtures.java
index 2bd1e62324cc4716c5994615d660878c110ba131..aa2a1a479c3180524751e9cf4ff658d6677eecf3 100644
--- a/webrtc/api/androidtests/src/org/webrtc/VideoCapturerAndroidTestFixtures.java
+++ b/webrtc/api/androidtests/src/org/webrtc/VideoCapturerAndroidTestFixtures.java
@@ -289,7 +289,7 @@ public class VideoCapturerAndroidTestFixtures {
final SurfaceTextureHelper surfaceTextureHelper = SurfaceTextureHelper.create(
"SurfaceTextureHelper test" /* threadName */, null /* sharedContext */);
final FakeCapturerObserver observer = new FakeCapturerObserver();
- capturer.startCapture(format.width, format.height, format.maxFramerate,
+ capturer.startCapture(format.size.width, format.size.height, format.framerate.max,
surfaceTextureHelper, appContext, observer);
// Make sure camera is started and first frame is received and then stop it.
assertTrue(observer.WaitForCapturerToStart());
@@ -313,7 +313,7 @@ public class VideoCapturerAndroidTestFixtures {
final SurfaceTextureHelper surfaceTextureHelper = SurfaceTextureHelper.create(
"SurfaceTextureHelper test" /* threadName */, null /* sharedContext */);
final FakeCapturerObserver observer = new FakeCapturerObserver();
- capturer.startCapture(format.width, format.height, format.maxFramerate,
+ capturer.startCapture(format.size.width, format.size.height, format.framerate.max,
surfaceTextureHelper, appContext, observer);
// Make sure camera is started and then stop it.
assertTrue(observer.WaitForCapturerToStart());
@@ -363,20 +363,20 @@ public class VideoCapturerAndroidTestFixtures {
for(int i = 0; i < 3 ; ++i) {
CameraEnumerationAndroid.CaptureFormat format = formats.get(i);
- capturer.startCapture(format.width, format.height, format.maxFramerate,
+ capturer.startCapture(format.size.width, format.size.height, format.framerate.max,
surfaceTextureHelper, appContext, observer);
assertTrue(observer.WaitForCapturerToStart());
observer.WaitForNextCapturedFrame();
// Check the frame size. The actual width and height depend on how the capturer is mounted.
- final boolean identicalResolution = (observer.frameWidth() == format.width
- && observer.frameHeight() == format.height);
- final boolean flippedResolution = (observer.frameWidth() == format.height
- && observer.frameHeight() == format.width);
+ final boolean identicalResolution = (observer.frameWidth() == format.size.width
+ && observer.frameHeight() == format.size.height);
+ final boolean flippedResolution = (observer.frameWidth() == format.size.height
+ && observer.frameHeight() == format.size.width);
if (!identicalResolution && !flippedResolution) {
fail("Wrong resolution, got: " + observer.frameWidth() + "x" + observer.frameHeight()
- + " expected: " + format.width + "x" + format.height + " or " + format.height + "x"
- + format.width);
+ + " expected: " + format.size.width + "x" + format.size.height
+ + " or " + format.size.height + "x" + format.size.width);
}
if (capturer.isCapturingToTexture()) {
@@ -412,7 +412,7 @@ public class VideoCapturerAndroidTestFixtures {
final SurfaceTextureHelper surfaceTextureHelper = SurfaceTextureHelper.create(
"SurfaceTextureHelper test" /* threadName */, null /* sharedContext */);
final FakeCapturerObserver observer = new FakeCapturerObserver();
- capturer.startCapture(format.width, format.height, format.maxFramerate,
+ capturer.startCapture(format.size.width, format.size.height, format.framerate.max,
surfaceTextureHelper, appContext, observer);
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.LOLLIPOP_MR1) {
@@ -437,7 +437,7 @@ public class VideoCapturerAndroidTestFixtures {
final SurfaceTextureHelper surfaceTextureHelper = SurfaceTextureHelper.create(
"SurfaceTextureHelper test" /* threadName */, null /* sharedContext */);
final FakeCapturerObserver observer = new FakeCapturerObserver();
- capturer.startCapture(format.width, format.height, format.maxFramerate,
+ capturer.startCapture(format.size.width, format.size.height, format.framerate.max,
surfaceTextureHelper, appContext, observer);
waitUntilIdle(capturer);
@@ -463,7 +463,7 @@ public class VideoCapturerAndroidTestFixtures {
final SurfaceTextureHelper surfaceTextureHelper = SurfaceTextureHelper.create(
"SurfaceTextureHelper test" /* threadName */, null /* sharedContext */);
final FakeCapturerObserver observer = new FakeCapturerObserver();
- capturer.startCapture(format.width, format.height, format.maxFramerate,
+ capturer.startCapture(format.size.width, format.size.height, format.framerate.max,
surfaceTextureHelper, appContext, observer);
capturer.stopCapture();
release(capturer);
@@ -479,7 +479,7 @@ public class VideoCapturerAndroidTestFixtures {
List<CaptureFormat> formats = capturer.getSupportedFormats();
CameraEnumerationAndroid.CaptureFormat format = formats.get(0);
- capturer.startCapture(format.width, format.height, format.maxFramerate,
+ capturer.startCapture(format.size.width, format.size.height, format.framerate.max,
surfaceTextureHelper, appContext, observer);
assertTrue(observer.WaitForCapturerToStart());
@@ -489,7 +489,7 @@ public class VideoCapturerAndroidTestFixtures {
assertTrue(listOftimestamps.size() >= 1);
format = formats.get(1);
- capturer.startCapture(format.width, format.height, format.maxFramerate,
+ capturer.startCapture(format.size.width, format.size.height, format.framerate.max,
surfaceTextureHelper, appContext, observer);
observer.WaitForCapturerToStart();
if (capturer.isCapturingToTexture()) {
@@ -553,7 +553,7 @@ public class VideoCapturerAndroidTestFixtures {
final SurfaceTextureHelper surfaceTextureHelper = SurfaceTextureHelper.create(
"SurfaceTextureHelper test" /* threadName */, null /* sharedContext */);
final FakeCapturerObserver observer = new FakeCapturerObserver();
- capturer.startCapture(format.width, format.height, format.maxFramerate,
+ capturer.startCapture(format.size.width, format.size.height, format.framerate.max,
surfaceTextureHelper, appContext, observer);
// Make sure camera is started.
assertTrue(observer.WaitForCapturerToStart());

Powered by Google App Engine
This is Rietveld 408576698