| 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 22 matching lines...) Expand all Loading... |
| 33 public void onFrameResolutionChanged(int videoWidth, int videoHeight, int ro
tation); | 33 public void onFrameResolutionChanged(int videoWidth, int videoHeight, int ro
tation); |
| 34 } | 34 } |
| 35 | 35 |
| 36 /** Interface for rendering frames on an EGLSurface. */ | 36 /** Interface for rendering frames on an EGLSurface. */ |
| 37 public static interface GlDrawer { | 37 public static interface GlDrawer { |
| 38 /** | 38 /** |
| 39 * Functions for drawing frames with different sources. The rendering surfac
e target is | 39 * Functions for drawing frames with different sources. The rendering surfac
e target is |
| 40 * implied by the current EGL context of the calling thread and requires no
explicit argument. | 40 * implied by the current EGL context of the calling thread and requires no
explicit argument. |
| 41 * The coordinates specify the viewport location on the surface target. | 41 * The coordinates specify the viewport location on the surface target. |
| 42 */ | 42 */ |
| 43 void drawOes(int oesTextureId, float[] texMatrix, int frameWidth, int frameH
eight, | 43 void drawOes(int oesTextureId, float[] texMatrix, int x, int y, int width, i
nt height); |
| 44 int viewportX, int viewportY, int viewportWidth, int viewportHeight); | 44 void drawRgb(int textureId, float[] texMatrix, int x, int y, int width, int
height); |
| 45 void drawRgb(int textureId, float[] texMatrix, int frameWidth, int frameHeig
ht, | 45 void drawYuv(int[] yuvTextures, float[] texMatrix, int x, int y, int width,
int height); |
| 46 int viewportX, int viewportY, int viewportWidth, int viewportHeight); | |
| 47 void drawYuv(int[] yuvTextures, float[] texMatrix, int frameWidth, int frame
Height, | |
| 48 int viewportX, int viewportY, int viewportWidth, int viewportHeight); | |
| 49 | 46 |
| 50 /** | 47 /** |
| 51 * Release all GL resources. This needs to be done manually, otherwise resou
rces may leak. | 48 * Release all GL resources. This needs to be done manually, otherwise resou
rces may leak. |
| 52 */ | 49 */ |
| 53 void release(); | 50 void release(); |
| 54 } | 51 } |
| 55 | 52 |
| 56 /** | 53 /** |
| 57 * Helper class for uploading YUV bytebuffer frames to textures that handles s
tride > width. This | 54 * Helper class for uploading YUV bytebuffer frames to textures that handles s
tride > width. This |
| 58 * class keeps an internal ByteBuffer to avoid unnecessary allocations for int
ermediate copies. | 55 * class keeps an internal ByteBuffer to avoid unnecessary allocations for int
ermediate copies. |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 return new Point(maxDisplayWidth, maxDisplayHeight); | 234 return new Point(maxDisplayWidth, maxDisplayHeight); |
| 238 } | 235 } |
| 239 // Each dimension is constrained on max display size and how much we are all
owed to crop. | 236 // Each dimension is constrained on max display size and how much we are all
owed to crop. |
| 240 final int width = Math.min(maxDisplayWidth, | 237 final int width = Math.min(maxDisplayWidth, |
| 241 Math.round(maxDisplayHeight / minVisibleFraction * videoAspectRatio)); | 238 Math.round(maxDisplayHeight / minVisibleFraction * videoAspectRatio)); |
| 242 final int height = Math.min(maxDisplayHeight, | 239 final int height = Math.min(maxDisplayHeight, |
| 243 Math.round(maxDisplayWidth / minVisibleFraction / videoAspectRatio)); | 240 Math.round(maxDisplayWidth / minVisibleFraction / videoAspectRatio)); |
| 244 return new Point(width, height); | 241 return new Point(width, height); |
| 245 } | 242 } |
| 246 } | 243 } |
| OLD | NEW |