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

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

Issue 2377003002: Format all Java in WebRTC. (Closed)
Patch Set: Manual changes. Created 4 years, 3 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/CameraVideoCapturerTestFixtures.java
diff --git a/webrtc/api/androidtests/src/org/webrtc/CameraVideoCapturerTestFixtures.java b/webrtc/api/androidtests/src/org/webrtc/CameraVideoCapturerTestFixtures.java
index 9e41d21b2286c0b1a8919c0560a451e6dc4baf77..9b57bbb2415afe94a72dcdc9ef17f2c2454a1580 100644
--- a/webrtc/api/androidtests/src/org/webrtc/CameraVideoCapturerTestFixtures.java
+++ b/webrtc/api/androidtests/src/org/webrtc/CameraVideoCapturerTestFixtures.java
@@ -114,8 +114,8 @@ class CameraVideoCapturerTestFixtures {
}
@Override
- public void onByteBufferFrameCaptured(byte[] frame, int width, int height, int rotation,
- long timeStamp) {
+ public void onByteBufferFrameCaptured(
+ byte[] frame, int width, int height, int rotation, long timeStamp) {
synchronized (frameLock) {
++framesCaptured;
frameSize = frame.length;
@@ -126,9 +126,8 @@ class CameraVideoCapturerTestFixtures {
}
}
@Override
- public void onTextureFrameCaptured(
- int width, int height, int oesTextureId, float[] transformMatrix, int rotation,
- long timeStamp) {
+ public void onTextureFrameCaptured(int width, int height, int oesTextureId,
+ float[] transformMatrix, int rotation, long timeStamp) {
synchronized (frameLock) {
++framesCaptured;
frameWidth = width;
@@ -185,8 +184,7 @@ class CameraVideoCapturerTestFixtures {
}
}
- static class CameraEvents implements
- CameraVideoCapturer.CameraEventsHandler {
+ static class CameraEvents implements CameraVideoCapturer.CameraEventsHandler {
public boolean onCameraOpeningCalled;
public boolean onFirstFrameAvailableCalled;
public final Object onCameraFreezedLock = new Object();
@@ -278,8 +276,7 @@ class CameraVideoCapturerTestFixtures {
}
public CameraVideoCapturer createCapturer(
- String name,
- CameraVideoCapturer.CameraEventsHandler eventsHandler) {
+ String name, CameraVideoCapturer.CameraEventsHandler eventsHandler) {
return cameraEnumerator.createCapturer(name, eventsHandler);
}
@@ -377,8 +374,8 @@ class CameraVideoCapturerTestFixtures {
instance.surfaceTextureHelper.dispose();
}
- private VideoTrackWithRenderer createVideoTrackWithRenderer(CameraVideoCapturer capturer,
- VideoRenderer.Callbacks rendererCallbacks) {
+ private VideoTrackWithRenderer createVideoTrackWithRenderer(
+ CameraVideoCapturer capturer, VideoRenderer.Callbacks rendererCallbacks) {
VideoTrackWithRenderer videoTrackWithRenderer = new VideoTrackWithRenderer();
videoTrackWithRenderer.source = peerConnectionFactory.createVideoSource(capturer);
capturer.startCapture(DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_FPS);
@@ -413,9 +410,10 @@ class CameraVideoCapturerTestFixtures {
private void waitUntilIdle(CapturerInstance capturerInstance) throws InterruptedException {
final CountDownLatch barrier = new CountDownLatch(1);
capturerInstance.surfaceTextureHelper.getHandler().post(new Runnable() {
- @Override public void run() {
- barrier.countDown();
- }
+ @Override
+ public void run() {
+ barrier.countDown();
+ }
});
barrier.await();
}
@@ -449,7 +447,7 @@ class CameraVideoCapturerTestFixtures {
fail("Expected illegal argument exception when creating non-existing camera.");
}
- public void createCapturerAndRender() throws InterruptedException {
+ public void createCapturerAndRender() throws InterruptedException {
String name = testObjectFactory.cameraEnumerator.getDeviceNames()[0];
createCapturerAndRender(name);
}
@@ -464,8 +462,8 @@ class CameraVideoCapturerTestFixtures {
public void switchCamera() throws InterruptedException {
if (!testObjectFactory.haveTwoCameras()) {
- Logging.w(TAG,
- "Skipping test switch video capturer because the device doesn't have two cameras.");
+ Logging.w(
+ TAG, "Skipping test switch video capturer because the device doesn't have two cameras.");
return;
}
@@ -551,23 +549,23 @@ class CameraVideoCapturerTestFixtures {
public void startStopWithDifferentResolutions() throws InterruptedException {
final CapturerInstance capturerInstance = createCapturer(true /* initialize */);
- for(int i = 0; i < 3 ; ++i) {
+ for (int i = 0; i < 3; ++i) {
startCapture(capturerInstance, i);
assertTrue(capturerInstance.observer.waitForCapturerToStart());
capturerInstance.observer.waitForNextCapturedFrame();
// Check the frame size. The actual width and height depend on how the capturer is mounted.
- final boolean identicalResolution = (
- capturerInstance.observer.frameWidth() == capturerInstance.format.width
- && capturerInstance.observer.frameHeight() == capturerInstance.format.height);
- final boolean flippedResolution = (
- capturerInstance.observer.frameWidth() == capturerInstance.format.height
- && capturerInstance.observer.frameHeight() == capturerInstance.format.width);
+ final boolean identicalResolution =
+ (capturerInstance.observer.frameWidth() == capturerInstance.format.width
+ && capturerInstance.observer.frameHeight() == capturerInstance.format.height);
+ final boolean flippedResolution =
+ (capturerInstance.observer.frameWidth() == capturerInstance.format.height
+ && capturerInstance.observer.frameHeight() == capturerInstance.format.width);
if (!identicalResolution && !flippedResolution) {
- fail("Wrong resolution, got: "
- + capturerInstance.observer.frameWidth() + "x" + capturerInstance.observer.frameHeight()
- + " expected: "+ capturerInstance.format.width + "x" + capturerInstance.format.height
- + " or " + capturerInstance.format.height + "x" + capturerInstance.format.width);
+ fail("Wrong resolution, got: " + capturerInstance.observer.frameWidth() + "x"
+ + capturerInstance.observer.frameHeight() + " expected: "
+ + capturerInstance.format.width + "x" + capturerInstance.format.height + " or "
+ + capturerInstance.format.height + "x" + capturerInstance.format.width);
}
if (testObjectFactory.isCapturingToTexture()) {
@@ -604,8 +602,7 @@ class CameraVideoCapturerTestFixtures {
disposeCapturer(capturerInstance);
}
- public void returnBufferLateEndToEnd()
- throws InterruptedException {
+ public void returnBufferLateEndToEnd() throws InterruptedException {
final CapturerInstance capturerInstance = createCapturer(false /* initialize */);
final VideoTrackWithRenderer videoTrackWithRenderer =
createVideoTrackWithFakeAsyncRenderer(capturerInstance.capturer);
@@ -670,7 +667,7 @@ class CameraVideoCapturerTestFixtures {
++numberOfInspectedFrames;
gotExpectedResolution = (videoTrackWithRenderer.rendererCallbacks.frameWidth() == scaledWidth
- && videoTrackWithRenderer.rendererCallbacks.frameHeight() == scaledHeight);
+ && videoTrackWithRenderer.rendererCallbacks.frameHeight() == scaledHeight);
} while (!gotExpectedResolution && numberOfInspectedFrames < 30);
disposeCapturer(capturerInstance);

Powered by Google App Engine
This is Rietveld 408576698