OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2014 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 public synchronized void renderFrame(VideoRenderer.I420Frame frame) { | 93 public synchronized void renderFrame(VideoRenderer.I420Frame frame) { |
94 if (!renderFrameCalled) { | 94 if (!renderFrameCalled) { |
95 if (rendererName != null) { | 95 if (rendererName != null) { |
96 Log.d(TAG, rendererName + " render frame: " + frame.width + " x " + fr
ame.height); | 96 Log.d(TAG, rendererName + " render frame: " + frame.width + " x " + fr
ame.height); |
97 } else { | 97 } else { |
98 Log.d(TAG, "Render frame: " + frame.width + " x " + frame.height); | 98 Log.d(TAG, "Render frame: " + frame.width + " x " + frame.height); |
99 } | 99 } |
100 } | 100 } |
101 renderFrameCalled = true; | 101 renderFrameCalled = true; |
102 doneRendering.countDown(); | 102 doneRendering.countDown(); |
| 103 VideoRenderer.renderFrameDone(frame); |
103 } | 104 } |
104 | 105 |
105 | 106 |
106 // This method shouldn't hold any locks or touch member variables since it | 107 // This method shouldn't hold any locks or touch member variables since it |
107 // blocks. | 108 // blocks. |
108 public boolean waitForFramesRendered(int timeoutMs) | 109 public boolean waitForFramesRendered(int timeoutMs) |
109 throws InterruptedException { | 110 throws InterruptedException { |
110 doneRendering.await(timeoutMs, TimeUnit.MILLISECONDS); | 111 doneRendering.await(timeoutMs, TimeUnit.MILLISECONDS); |
111 return (doneRendering.getCount() <= 0); | 112 return (doneRendering.getCount() <= 0); |
112 } | 113 } |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 localRenderer.waitForFramesRendered(WAIT_TIMEOUT)); | 430 localRenderer.waitForFramesRendered(WAIT_TIMEOUT)); |
430 assertTrue("Remote video frames were not rendered after video restart.", | 431 assertTrue("Remote video frames were not rendered after video restart.", |
431 remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT)); | 432 remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT)); |
432 } | 433 } |
433 pcClient.close(); | 434 pcClient.close(); |
434 assertTrue(waitForPeerConnectionClosed(WAIT_TIMEOUT)); | 435 assertTrue(waitForPeerConnectionClosed(WAIT_TIMEOUT)); |
435 Log.d(TAG, "testVideoSourceRestart done."); | 436 Log.d(TAG, "testVideoSourceRestart done."); |
436 } | 437 } |
437 | 438 |
438 } | 439 } |
OLD | NEW |