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

Unified Diff: webrtc/sdk/android/instrumentationtests/src/org/webrtc/HardwareVideoDecoderTest.java

Issue 2990583002: Move matrix from VideoFrame to TextureBuffer. (Closed)
Patch Set: Rebase & fix tests. Created 3 years, 5 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/sdk/android/instrumentationtests/src/org/webrtc/HardwareVideoDecoderTest.java
diff --git a/webrtc/sdk/android/instrumentationtests/src/org/webrtc/HardwareVideoDecoderTest.java b/webrtc/sdk/android/instrumentationtests/src/org/webrtc/HardwareVideoDecoderTest.java
index 6c9d0b7b5c11e9cfa28d1c41a76154abdb3f548f..59dbc87113060a1cfecee047e73b31d1b94d5e7d 100644
--- a/webrtc/sdk/android/instrumentationtests/src/org/webrtc/HardwareVideoDecoderTest.java
+++ b/webrtc/sdk/android/instrumentationtests/src/org/webrtc/HardwareVideoDecoderTest.java
@@ -18,8 +18,8 @@ import android.annotation.TargetApi;
import android.graphics.Matrix;
import android.support.test.filters.MediumTest;
import android.util.Log;
-import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicReference;
import org.chromium.base.test.BaseJUnit4ClassRunner;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -123,8 +123,7 @@ public final class HardwareVideoDecoderTest {
// First, encode a frame.
VideoFrame.I420Buffer buffer = I420BufferImpl.allocate(SETTINGS.width, SETTINGS.height);
- VideoFrame frame =
- new VideoFrame(buffer, rotation, presentationTimestampUs * 1000, new Matrix());
+ VideoFrame frame = new VideoFrame(buffer, rotation, presentationTimestampUs * 1000);
VideoEncoder.EncodeInfo info = new VideoEncoder.EncodeInfo(
new EncodedImage.FrameType[] {EncodedImage.FrameType.VideoFrameKey});
@@ -141,9 +140,8 @@ public final class HardwareVideoDecoderTest {
frame = decoded.get();
assertEquals(frame.getRotation(), rotation);
assertEquals(frame.getTimestampNs(), presentationTimestampUs * 1000);
- assertEquals(frame.getTransformMatrix(), new Matrix());
- assertEquals(frame.getWidth(), SETTINGS.width);
- assertEquals(frame.getHeight(), SETTINGS.height);
+ assertEquals(frame.getBuffer().getWidth(), SETTINGS.width);
+ assertEquals(frame.getBuffer().getHeight(), SETTINGS.height);
frame.release();
assertEquals(decoder.release(), VideoCodecStatus.OK);
@@ -200,8 +198,7 @@ public final class HardwareVideoDecoderTest {
// First, encode a frame.
VideoFrame.I420Buffer buffer = I420BufferImpl.allocate(SETTINGS.width, SETTINGS.height);
- VideoFrame frame =
- new VideoFrame(buffer, rotation, presentationTimestampUs * 1000, new Matrix());
+ VideoFrame frame = new VideoFrame(buffer, rotation, presentationTimestampUs * 1000);
VideoEncoder.EncodeInfo info = new VideoEncoder.EncodeInfo(
new EncodedImage.FrameType[] {EncodedImage.FrameType.VideoFrameKey});
@@ -218,13 +215,13 @@ public final class HardwareVideoDecoderTest {
frame = decoded.get();
assertEquals(frame.getRotation(), rotation);
assertEquals(frame.getTimestampNs(), presentationTimestampUs * 1000);
- // TODO(mellem): Compare the matrix to whatever we expect to get back?
- assertNotNull(frame.getTransformMatrix());
- assertEquals(frame.getWidth(), SETTINGS.width);
- assertEquals(frame.getHeight(), SETTINGS.height);
assertTrue(frame.getBuffer() instanceof VideoFrame.TextureBuffer);
VideoFrame.TextureBuffer textureBuffer = (VideoFrame.TextureBuffer) frame.getBuffer();
+ // TODO(mellem): Compare the matrix to whatever we expect to get back?
+ assertNotNull(textureBuffer.getTransformMatrix());
+ assertEquals(textureBuffer.getWidth(), SETTINGS.width);
+ assertEquals(textureBuffer.getHeight(), SETTINGS.height);
assertEquals(textureBuffer.getType(), VideoFrame.TextureBuffer.Type.OES);
assertEquals(decoder.release(), VideoCodecStatus.OK);

Powered by Google App Engine
This is Rietveld 408576698