Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: webrtc/api/android/java/src/org/webrtc/VideoTrack.java

Issue 2106333005: Revert of Combine webrtc/api/java/android and webrtc/api/java/src. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/api/android/java/src/org/webrtc/VideoSource.java ('k') | webrtc/api/android/jni/OWNERS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 package org.webrtc;
12
13 import java.util.LinkedList;
14
15 /** Java version of VideoTrackInterface. */
16 public class VideoTrack extends MediaStreamTrack {
17 private final LinkedList<VideoRenderer> renderers =
18 new LinkedList<VideoRenderer>();
19
20 public VideoTrack(long nativeTrack) {
21 super(nativeTrack);
22 }
23
24 public void addRenderer(VideoRenderer renderer) {
25 renderers.add(renderer);
26 nativeAddRenderer(nativeTrack, renderer.nativeVideoRenderer);
27 }
28
29 public void removeRenderer(VideoRenderer renderer) {
30 if (!renderers.remove(renderer)) {
31 return;
32 }
33 nativeRemoveRenderer(nativeTrack, renderer.nativeVideoRenderer);
34 renderer.dispose();
35 }
36
37 public void dispose() {
38 while (!renderers.isEmpty()) {
39 removeRenderer(renderers.getFirst());
40 }
41 super.dispose();
42 }
43
44 private static native void free(long nativeTrack);
45
46 private static native void nativeAddRenderer(
47 long nativeTrack, long nativeRenderer);
48
49 private static native void nativeRemoveRenderer(
50 long nativeTrack, long nativeRenderer);
51 }
OLDNEW
« no previous file with comments | « webrtc/api/android/java/src/org/webrtc/VideoSource.java ('k') | webrtc/api/android/jni/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698