OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 * implied by the current EGL context of the calling thread and requires no
explicit argument. | 41 * implied by the current EGL context of the calling thread and requires no
explicit argument. |
42 * The coordinates specify the viewport location on the surface target. | 42 * The coordinates specify the viewport location on the surface target. |
43 */ | 43 */ |
44 void drawOes(int oesTextureId, float[] texMatrix, int frameWidth, int frameH
eight, | 44 void drawOes(int oesTextureId, float[] texMatrix, int frameWidth, int frameH
eight, |
45 int viewportX, int viewportY, int viewportWidth, int viewportHeight); | 45 int viewportX, int viewportY, int viewportWidth, int viewportHeight); |
46 void drawRgb(int textureId, float[] texMatrix, int frameWidth, int frameHeig
ht, int viewportX, | 46 void drawRgb(int textureId, float[] texMatrix, int frameWidth, int frameHeig
ht, int viewportX, |
47 int viewportY, int viewportWidth, int viewportHeight); | 47 int viewportY, int viewportWidth, int viewportHeight); |
48 void drawYuv(int[] yuvTextures, float[] texMatrix, int frameWidth, int frame
Height, | 48 void drawYuv(int[] yuvTextures, float[] texMatrix, int frameWidth, int frame
Height, |
49 int viewportX, int viewportY, int viewportWidth, int viewportHeight); | 49 int viewportX, int viewportY, int viewportWidth, int viewportHeight); |
50 | 50 |
| 51 /** |
| 52 * Draws a VideoFrame.TextureBuffer. Default implementation calls either dra
wOes or drawRgb |
| 53 * depending on the type of the buffer. You can supply an additional render
matrix. This is |
| 54 * used multiplied together with the transformation matrix of the frame. (M
= renderMatrix * |
| 55 * transformationMatrix) |
| 56 */ |
51 default void | 57 default void |
52 drawTexture(VideoFrame.TextureBuffer buffer, android.graphics.Matrix rende
rMatrix, | 58 drawTexture(VideoFrame.TextureBuffer buffer, android.graphics.Matrix rende
rMatrix, |
53 int frameWidth, int frameHeight, int viewportX, int viewportY, int vie
wportWidth, | 59 int frameWidth, int frameHeight, int viewportX, int viewportY, int vie
wportWidth, |
54 int viewportHeight) { | 60 int viewportHeight) { |
55 android.graphics.Matrix finalMatrix = | 61 android.graphics.Matrix finalMatrix = |
56 new android.graphics.Matrix(buffer.getTransformMatrix()); | 62 new android.graphics.Matrix(buffer.getTransformMatrix()); |
57 finalMatrix.preConcat(renderMatrix); | 63 finalMatrix.preConcat(renderMatrix); |
58 float[] finalGlMatrix = convertMatrixFromAndroidGraphicsMatrix(finalMatr
ix); | 64 float[] finalGlMatrix = convertMatrixFromAndroidGraphicsMatrix(finalMatr
ix); |
59 switch (buffer.getType()) { | 65 switch (buffer.getType()) { |
60 case OES: | 66 case OES: |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 return new Point(maxDisplayWidth, maxDisplayHeight); | 389 return new Point(maxDisplayWidth, maxDisplayHeight); |
384 } | 390 } |
385 // Each dimension is constrained on max display size and how much we are all
owed to crop. | 391 // Each dimension is constrained on max display size and how much we are all
owed to crop. |
386 final int width = Math.min( | 392 final int width = Math.min( |
387 maxDisplayWidth, Math.round(maxDisplayHeight / minVisibleFraction * vide
oAspectRatio)); | 393 maxDisplayWidth, Math.round(maxDisplayHeight / minVisibleFraction * vide
oAspectRatio)); |
388 final int height = Math.min( | 394 final int height = Math.min( |
389 maxDisplayHeight, Math.round(maxDisplayWidth / minVisibleFraction / vide
oAspectRatio)); | 395 maxDisplayHeight, Math.round(maxDisplayWidth / minVisibleFraction / vide
oAspectRatio)); |
390 return new Point(width, height); | 396 return new Point(width, height); |
391 } | 397 } |
392 } | 398 } |
OLD | NEW |