OLD | NEW |
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 30 matching lines...) Expand all Loading... |
41 static class RendererCallbacks implements VideoRenderer.Callbacks { | 41 static class RendererCallbacks implements VideoRenderer.Callbacks { |
42 private int framesRendered = 0; | 42 private int framesRendered = 0; |
43 private Object frameLock = 0; | 43 private Object frameLock = 0; |
44 | 44 |
45 @Override | 45 @Override |
46 public void renderFrame(I420Frame frame) { | 46 public void renderFrame(I420Frame frame) { |
47 synchronized (frameLock) { | 47 synchronized (frameLock) { |
48 ++framesRendered; | 48 ++framesRendered; |
49 frameLock.notify(); | 49 frameLock.notify(); |
50 } | 50 } |
| 51 VideoRenderer.renderFrameDone(frame); |
51 } | 52 } |
52 | 53 |
53 // TODO(guoweis): Remove this once chrome code base is updated. | 54 // TODO(guoweis): Remove this once chrome code base is updated. |
54 @Override | 55 @Override |
55 public boolean canApplyRotation() { | 56 public boolean canApplyRotation() { |
56 return false; | 57 return false; |
57 } | 58 } |
58 | 59 |
59 public int WaitForNextFrameToRender() throws InterruptedException { | 60 public int WaitForNextFrameToRender() throws InterruptedException { |
60 synchronized (frameLock) { | 61 synchronized (frameLock) { |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 observer.WaitForNextCapturedFrame(); | 307 observer.WaitForNextCapturedFrame(); |
307 capturer.stopCapture(); | 308 capturer.stopCapture(); |
308 | 309 |
309 listOftimestamps = observer.getCopyAndResetListOftimeStamps(); | 310 listOftimestamps = observer.getCopyAndResetListOftimeStamps(); |
310 assertTrue(listOftimestamps.size() >= 2); | 311 assertTrue(listOftimestamps.size() >= 2); |
311 for (Long timeStamp : listOftimestamps) { | 312 for (Long timeStamp : listOftimestamps) { |
312 capturer.returnBuffer(timeStamp); | 313 capturer.returnBuffer(timeStamp); |
313 } | 314 } |
314 } | 315 } |
315 } | 316 } |
OLD | NEW |