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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 public synchronized void renderFrame(VideoRenderer.I420Frame frame) { | 87 public synchronized void renderFrame(VideoRenderer.I420Frame frame) { |
88 if (!renderFrameCalled) { | 88 if (!renderFrameCalled) { |
89 if (rendererName != null) { | 89 if (rendererName != null) { |
90 Log.d(TAG, rendererName + " render frame: " | 90 Log.d(TAG, rendererName + " render frame: " |
91 + frame.rotatedWidth() + " x " + frame.rotatedHeight()); | 91 + frame.rotatedWidth() + " x " + frame.rotatedHeight()); |
92 } else { | 92 } else { |
93 Log.d(TAG, "Render frame: " + frame.rotatedWidth() + " x " + frame.rot
atedHeight()); | 93 Log.d(TAG, "Render frame: " + frame.rotatedWidth() + " x " + frame.rot
atedHeight()); |
94 } | 94 } |
95 } | 95 } |
96 renderFrameCalled = true; | 96 renderFrameCalled = true; |
| 97 VideoRenderer.renderFrameDone(frame); |
97 doneRendering.countDown(); | 98 doneRendering.countDown(); |
98 } | 99 } |
99 | 100 |
100 | 101 |
101 // This method shouldn't hold any locks or touch member variables since it | 102 // This method shouldn't hold any locks or touch member variables since it |
102 // blocks. | 103 // blocks. |
103 public boolean waitForFramesRendered(int timeoutMs) | 104 public boolean waitForFramesRendered(int timeoutMs) |
104 throws InterruptedException { | 105 throws InterruptedException { |
105 doneRendering.await(timeoutMs, TimeUnit.MILLISECONDS); | 106 doneRendering.await(timeoutMs, TimeUnit.MILLISECONDS); |
106 return (doneRendering.getCount() <= 0); | 107 return (doneRendering.getCount() <= 0); |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 localRenderer.waitForFramesRendered(WAIT_TIMEOUT)); | 425 localRenderer.waitForFramesRendered(WAIT_TIMEOUT)); |
425 assertTrue("Remote video frames were not rendered after video restart.", | 426 assertTrue("Remote video frames were not rendered after video restart.", |
426 remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT)); | 427 remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT)); |
427 } | 428 } |
428 pcClient.close(); | 429 pcClient.close(); |
429 assertTrue(waitForPeerConnectionClosed(WAIT_TIMEOUT)); | 430 assertTrue(waitForPeerConnectionClosed(WAIT_TIMEOUT)); |
430 Log.d(TAG, "testVideoSourceRestart done."); | 431 Log.d(TAG, "testVideoSourceRestart done."); |
431 } | 432 } |
432 | 433 |
433 } | 434 } |
OLD | NEW |