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; |
} |