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

Side by Side Diff: webrtc/sdk/android/instrumentationtests/src/org/webrtc/EglRendererTest.java

Issue 2897043002: Allow FPS reduction to be applied to frame listeners. (Closed)
Patch Set: Changes according to magjed's comments. Created 3 years, 6 months 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
« no previous file with comments | « webrtc/sdk/android/api/org/webrtc/EglRenderer.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2016 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 eglRenderer.addFrameListener(testFrameListener, 0f); 303 eglRenderer.addFrameListener(testFrameListener, 0f);
304 eglRenderer.removeFrameListener(testFrameListener); 304 eglRenderer.removeFrameListener(testFrameListener);
305 feedFrame(1); 305 feedFrame(1);
306 } 306 }
307 // Check the frame listener hasn't triggered. 307 // Check the frame listener hasn't triggered.
308 assertFalse(testFrameListener.waitForBitmap(RENDER_WAIT_MS)); 308 assertFalse(testFrameListener.waitForBitmap(RENDER_WAIT_MS));
309 } 309 }
310 310
311 @Test 311 @Test
312 @SmallTest 312 @SmallTest
313 public void testFrameListenersWhilePaused() throws Exception { 313 public void testFrameListenersFpsReduction() throws Exception {
314 // Test that frame listeners receive frames while renderer is paused. 314 // Test that normal frame listeners receive frames while the renderer is pau sed.
315 eglRenderer.pauseVideo(); 315 eglRenderer.pauseVideo();
316 eglRenderer.addFrameListener(testFrameListener, 1f /* scaleFactor */); 316 eglRenderer.addFrameListener(testFrameListener, 1f /* scaleFactor */);
317 feedFrame(0); 317 feedFrame(0);
318 assertTrue(testFrameListener.waitForBitmap(RENDER_WAIT_MS)); 318 assertTrue(testFrameListener.waitForBitmap(RENDER_WAIT_MS));
319 checkBitmapContent(testFrameListener.resetAndGetBitmap(), 0); 319 checkBitmapContent(testFrameListener.resetAndGetBitmap(), 0);
320
321 // Test that frame listeners with FPS reduction applied receive frames while the renderer is not
322 // paused.
323 eglRenderer.disableFpsReduction();
324 eglRenderer.addFrameListener(
325 testFrameListener, 1f /* scaleFactor */, null, true /* applyFpsReduction */);
326 feedFrame(1);
327 assertTrue(testFrameListener.waitForBitmap(RENDER_WAIT_MS));
328 checkBitmapContent(testFrameListener.resetAndGetBitmap(), 1);
329
330 // Test that frame listeners with FPS reduction applied will not receive fra mes while the
331 // renderer is paused.
332 eglRenderer.pauseVideo();
333 eglRenderer.addFrameListener(
334 testFrameListener, 1f /* scaleFactor */, null, true /* applyFpsReduction */);
335 feedFrame(1);
336 assertFalse(testFrameListener.waitForBitmap(RENDER_WAIT_MS));
320 } 337 }
321 } 338 }
OLDNEW
« no previous file with comments | « webrtc/sdk/android/api/org/webrtc/EglRenderer.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698