OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 129 |
130 public synchronized void expectFramesDelivered(int count) { | 130 public synchronized void expectFramesDelivered(int count) { |
131 assertFalse(RENDER_TO_GUI); | 131 assertFalse(RENDER_TO_GUI); |
132 expectedFramesDelivered += count; | 132 expectedFramesDelivered += count; |
133 } | 133 } |
134 | 134 |
135 @Override | 135 @Override |
136 public synchronized void renderFrame(VideoRenderer.I420Frame frame) { | 136 public synchronized void renderFrame(VideoRenderer.I420Frame frame) { |
137 setSize(frame.width, frame.height); | 137 setSize(frame.width, frame.height); |
138 --expectedFramesDelivered; | 138 --expectedFramesDelivered; |
139 VideoRenderer.renderFrameDone(frame); | |
140 } | 139 } |
141 | 140 |
142 // TODO(guoweis): Remove this once chrome code base is updated. | 141 // TODO(guoweis): Remove this once chrome code base is updated. |
143 @Override | 142 @Override |
144 public boolean canApplyRotation() { | 143 public boolean canApplyRotation() { |
145 return false; | 144 return false; |
146 } | 145 } |
147 | 146 |
148 public synchronized void expectSignalingChange(SignalingState newState) { | 147 public synchronized void expectSignalingChange(SignalingState newState) { |
149 expectedSignalingChanges.add(newState); | 148 expectedSignalingChanges.add(newState); |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 private void setSize(int width, int height) { | 446 private void setSize(int width, int height) { |
448 assertEquals(this.width, -1); | 447 assertEquals(this.width, -1); |
449 assertEquals(this.height, -1); | 448 assertEquals(this.height, -1); |
450 this.width = width; | 449 this.width = width; |
451 this.height = height; | 450 this.height = height; |
452 } | 451 } |
453 | 452 |
454 @Override | 453 @Override |
455 public void renderFrame(VideoRenderer.I420Frame frame) { | 454 public void renderFrame(VideoRenderer.I420Frame frame) { |
456 ++numFramesDelivered; | 455 ++numFramesDelivered; |
457 VideoRenderer.renderFrameDone(frame); | |
458 } | 456 } |
459 | 457 |
460 // TODO(guoweis): Remove this once chrome code base is updated. | 458 // TODO(guoweis): Remove this once chrome code base is updated. |
461 @Override | 459 @Override |
462 public boolean canApplyRotation() { | 460 public boolean canApplyRotation() { |
463 return false; | 461 return false; |
464 } | 462 } |
465 } | 463 } |
466 | 464 |
467 private static VideoRenderer createVideoRenderer( | 465 private static VideoRenderer createVideoRenderer( |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 TreeSet<String> threads = new TreeSet<String>(); | 773 TreeSet<String> threads = new TreeSet<String>(); |
776 // This pokes at /proc instead of using the Java APIs because we're also | 774 // This pokes at /proc instead of using the Java APIs because we're also |
777 // looking for libjingle/webrtc native threads, most of which won't have | 775 // looking for libjingle/webrtc native threads, most of which won't have |
778 // attached to the JVM. | 776 // attached to the JVM. |
779 for (String threadId : (new File("/proc/self/task")).list()) { | 777 for (String threadId : (new File("/proc/self/task")).list()) { |
780 threads.add(threadId); | 778 threads.add(threadId); |
781 } | 779 } |
782 return threads; | 780 return threads; |
783 } | 781 } |
784 } | 782 } |
OLD | NEW |