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

Unified Diff: webrtc/sdk/android/api/org/webrtc/VideoRenderer.java

Issue 2990583002: Move matrix from VideoFrame to TextureBuffer. (Closed)
Patch Set: Fixes. 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/api/org/webrtc/VideoRenderer.java
diff --git a/webrtc/sdk/android/api/org/webrtc/VideoRenderer.java b/webrtc/sdk/android/api/org/webrtc/VideoRenderer.java
index 0825b7408b7b75e0a4a7697b18c309def4c848da..b2812ea8d437fc8bd53de669e8371b004d20d2a5 100644
--- a/webrtc/sdk/android/api/org/webrtc/VideoRenderer.java
+++ b/webrtc/sdk/android/api/org/webrtc/VideoRenderer.java
@@ -84,12 +84,11 @@ public class VideoRenderer {
}
/**
- * Construct a frame of the given dimensions from VideoFrame.Buffer.
+ * Construct a frame from VideoFrame.Buffer.
*/
- public I420Frame(int width, int height, int rotationDegree, float[] samplingMatrix,
- VideoFrame.Buffer buffer, long nativeFramePointer) {
- this.width = width;
- this.height = height;
+ public I420Frame(int rotationDegree, VideoFrame.Buffer buffer, long nativeFramePointer) {
+ this.width = buffer.getWidth();
+ this.height = buffer.getHeight();
this.rotationDegree = rotationDegree;
if (rotationDegree % 90 != 0) {
throw new IllegalArgumentException("Rotation degree not multiple of 90: " + rotationDegree);
@@ -98,7 +97,8 @@ public class VideoRenderer {
VideoFrame.TextureBuffer textureBuffer = (VideoFrame.TextureBuffer) buffer;
this.yuvFrame = false;
this.textureId = textureBuffer.getTextureId();
- this.samplingMatrix = samplingMatrix;
+ this.samplingMatrix = RendererCommon.convertMatrixFromAndroidGraphicsMatrix(
+ textureBuffer.getTransformMatrix());
this.yuvStrides = null;
this.yuvPlanes = null;
@@ -113,8 +113,7 @@ public class VideoRenderer {
// top-left corner of the image, but in glTexImage2D() the first element corresponds to the
// bottom-left corner. This discrepancy is corrected by multiplying the sampling matrix with
// a vertical flip matrix.
- this.samplingMatrix =
- RendererCommon.multiplyMatrices(samplingMatrix, RendererCommon.verticalFlipMatrix());
+ this.samplingMatrix = RendererCommon.verticalFlipMatrix();
this.textureId = 0;
}

Powered by Google App Engine
This is Rietveld 408576698