OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 public synchronized void renderFrame(VideoRenderer.I420Frame frame) { | 110 public synchronized void renderFrame(VideoRenderer.I420Frame frame) { |
111 if (!renderFrameCalled) { | 111 if (!renderFrameCalled) { |
112 if (rendererName != null) { | 112 if (rendererName != null) { |
113 Log.d(TAG, rendererName + " render frame: " + frame.width + " x " + fr
ame.height); | 113 Log.d(TAG, rendererName + " render frame: " + frame.width + " x " + fr
ame.height); |
114 } else { | 114 } else { |
115 Log.d(TAG, "Render frame: " + frame.width + " x " + frame.height); | 115 Log.d(TAG, "Render frame: " + frame.width + " x " + frame.height); |
116 } | 116 } |
117 } | 117 } |
118 renderFrameCalled = true; | 118 renderFrameCalled = true; |
119 doneRendering.countDown(); | 119 doneRendering.countDown(); |
| 120 VideoRenderer.renderFrameDone(frame); |
120 } | 121 } |
121 | 122 |
122 | 123 |
123 // This method shouldn't hold any locks or touch member variables since it | 124 // This method shouldn't hold any locks or touch member variables since it |
124 // blocks. | 125 // blocks. |
125 public boolean waitForFramesRendered(int timeoutMs) | 126 public boolean waitForFramesRendered(int timeoutMs) |
126 throws InterruptedException { | 127 throws InterruptedException { |
127 doneRendering.await(timeoutMs, TimeUnit.MILLISECONDS); | 128 doneRendering.await(timeoutMs, TimeUnit.MILLISECONDS); |
128 return (doneRendering.getCount() <= 0); | 129 return (doneRendering.getCount() <= 0); |
129 } | 130 } |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 localRenderer.waitForFramesRendered(WAIT_TIMEOUT)); | 447 localRenderer.waitForFramesRendered(WAIT_TIMEOUT)); |
447 assertTrue("Remote video frames were not rendered after video restart.", | 448 assertTrue("Remote video frames were not rendered after video restart.", |
448 remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT)); | 449 remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT)); |
449 } | 450 } |
450 pcClient.close(); | 451 pcClient.close(); |
451 assertTrue(waitForPeerConnectionClosed(WAIT_TIMEOUT)); | 452 assertTrue(waitForPeerConnectionClosed(WAIT_TIMEOUT)); |
452 Log.d(TAG, "testVideoSourceRestart done."); | 453 Log.d(TAG, "testVideoSourceRestart done."); |
453 } | 454 } |
454 | 455 |
455 } | 456 } |
OLD | NEW |