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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 return new SurfaceTextureHelper(sharedContext, handler); | 69 return new SurfaceTextureHelper(sharedContext, handler); |
70 } catch (RuntimeException e) { | 70 } catch (RuntimeException e) { |
71 Logging.e(TAG, threadName + " create failure", e); | 71 Logging.e(TAG, threadName + " create failure", e); |
72 return null; | 72 return null; |
73 } | 73 } |
74 } | 74 } |
75 }); | 75 }); |
76 } | 76 } |
77 | 77 |
78 // State for YUV conversion, instantiated on demand. | 78 // State for YUV conversion, instantiated on demand. |
79 static private class YuvConverter { | 79 static class YuvConverter { |
80 private final EglBase eglBase; | 80 private final EglBase eglBase; |
81 private final GlShader shader; | 81 private final GlShader shader; |
82 private boolean released = false; | 82 private boolean released = false; |
83 | 83 |
84 // Vertex coordinates in Normalized Device Coordinates, i.e. | 84 // Vertex coordinates in Normalized Device Coordinates, i.e. |
85 // (-1, -1) is bottom-left and (1, 1) is top-right. | 85 // (-1, -1) is bottom-left and (1, 1) is top-right. |
86 private static final FloatBuffer DEVICE_RECTANGLE = | 86 private static final FloatBuffer DEVICE_RECTANGLE = |
87 GlUtil.createFloatBuffer(new float[] { | 87 GlUtil.createFloatBuffer(new float[] { |
88 -1.0f, -1.0f, // Bottom left. | 88 -1.0f, -1.0f, // Bottom left. |
89 1.0f, -1.0f, // Bottom right. | 89 1.0f, -1.0f, // Bottom right. |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 synchronized (this) { | 489 synchronized (this) { |
490 if (yuvConverter != null) | 490 if (yuvConverter != null) |
491 yuvConverter.release(); | 491 yuvConverter.release(); |
492 } | 492 } |
493 GLES20.glDeleteTextures(1, new int[] {oesTextureId}, 0); | 493 GLES20.glDeleteTextures(1, new int[] {oesTextureId}, 0); |
494 surfaceTexture.release(); | 494 surfaceTexture.release(); |
495 eglBase.release(); | 495 eglBase.release(); |
496 handler.getLooper().quit(); | 496 handler.getLooper().quit(); |
497 } | 497 } |
498 } | 498 } |
OLD | NEW |