OLD | NEW |
---|---|
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
167 /** | 167 /** |
168 * Create and make an EGLSurface current if both init() and surfaceCreated() h ave been called. | 168 * Create and make an EGLSurface current if both init() and surfaceCreated() h ave been called. |
169 */ | 169 */ |
170 public void tryCreateEglSurface() { | 170 public void tryCreateEglSurface() { |
171 // |renderThreadHandler| is only created after |eglBase| is created in init( ), so the | 171 // |renderThreadHandler| is only created after |eglBase| is created in init( ), so the |
172 // following code will only execute if eglBase != null. | 172 // following code will only execute if eglBase != null. |
173 runOnRenderThread(new Runnable() { | 173 runOnRenderThread(new Runnable() { |
174 @Override public void run() { | 174 @Override public void run() { |
175 synchronized (layoutLock) { | 175 synchronized (layoutLock) { |
176 if (isSurfaceCreated) { | 176 if (isSurfaceCreated) { |
177 eglBase.createSurface(getHolder()); | 177 eglBase.createSurface(getHolder().getSurface()); |
magjed_webrtc
2015/11/18 13:12:52
Rebase against master.
perkj_webrtc
2015/11/18 14:51:20
dito- this will go away once the decoder patch has
| |
178 eglBase.makeCurrent(); | 178 eglBase.makeCurrent(); |
179 // Necessary for YUV frames with odd width. | 179 // Necessary for YUV frames with odd width. |
180 GLES20.glPixelStorei(GLES20.GL_UNPACK_ALIGNMENT, 1); | 180 GLES20.glPixelStorei(GLES20.GL_UNPACK_ALIGNMENT, 1); |
181 } | 181 } |
182 } | 182 } |
183 } | 183 } |
184 }); | 184 }); |
185 } | 185 } |
186 | 186 |
187 /** | 187 /** |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
536 if (framesReceived > 0 && framesRendered > 0) { | 536 if (framesReceived > 0 && framesRendered > 0) { |
537 final long timeSinceFirstFrameNs = System.nanoTime() - firstFrameTimeNs; | 537 final long timeSinceFirstFrameNs = System.nanoTime() - firstFrameTimeNs; |
538 Logging.d(TAG, getResourceName() + "Duration: " + (int) (timeSinceFirstF rameNs / 1e6) + | 538 Logging.d(TAG, getResourceName() + "Duration: " + (int) (timeSinceFirstF rameNs / 1e6) + |
539 " ms. FPS: " + (float) framesRendered * 1e9 / timeSinceFirstFrameNs) ; | 539 " ms. FPS: " + (float) framesRendered * 1e9 / timeSinceFirstFrameNs) ; |
540 Logging.d(TAG, getResourceName() + "Average render time: " | 540 Logging.d(TAG, getResourceName() + "Average render time: " |
541 + (int) (renderTimeNs / (1000 * framesRendered)) + " us."); | 541 + (int) (renderTimeNs / (1000 * framesRendered)) + " us."); |
542 } | 542 } |
543 } | 543 } |
544 } | 544 } |
545 } | 545 } |
OLD | NEW |