Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: talk/app/webrtc/java/android/org/webrtc/SurfaceViewRenderer.java

Issue 1403713002: MediaCodecVideoEncoder add support to encode from textures (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed tests Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698