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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 } | 217 } |
218 localStreams.add(stream); | 218 localStreams.add(stream); |
219 return true; | 219 return true; |
220 } | 220 } |
221 | 221 |
222 public void removeStream(MediaStream stream) { | 222 public void removeStream(MediaStream stream) { |
223 nativeRemoveLocalStream(stream.nativeStream); | 223 nativeRemoveLocalStream(stream.nativeStream); |
224 localStreams.remove(stream); | 224 localStreams.remove(stream); |
225 } | 225 } |
226 | 226 |
227 public RtpSender createSender(String kind) { | 227 public RtpSender createSender(String kind, MediaStream stream) { |
228 RtpSender new_sender = nativeCreateSender(kind); | 228 RtpSender new_sender = nativeCreateSender(kind, stream.nativeStream); |
229 if (new_sender != null) { | 229 if (new_sender != null) { |
230 senders.add(new_sender); | 230 senders.add(new_sender); |
231 } | 231 } |
232 return new_sender; | 232 return new_sender; |
233 } | 233 } |
234 | 234 |
235 // Note that calling getSenders will dispose of the senders previously | 235 // Note that calling getSenders will dispose of the senders previously |
236 // returned (and same goes for getReceivers). | 236 // returned (and same goes for getReceivers). |
237 public List<RtpSender> getSenders() { | 237 public List<RtpSender> getSenders() { |
238 for (RtpSender sender : senders) { | 238 for (RtpSender sender : senders) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 private native boolean nativeAddIceCandidate( | 290 private native boolean nativeAddIceCandidate( |
291 String sdpMid, int sdpMLineIndex, String iceCandidateSdp); | 291 String sdpMid, int sdpMLineIndex, String iceCandidateSdp); |
292 | 292 |
293 private native boolean nativeAddLocalStream(long nativeStream); | 293 private native boolean nativeAddLocalStream(long nativeStream); |
294 | 294 |
295 private native void nativeRemoveLocalStream(long nativeStream); | 295 private native void nativeRemoveLocalStream(long nativeStream); |
296 | 296 |
297 private native boolean nativeGetStats( | 297 private native boolean nativeGetStats( |
298 StatsObserver observer, long nativeTrack); | 298 StatsObserver observer, long nativeTrack); |
299 | 299 |
300 private native RtpSender nativeCreateSender(String kind); | 300 private native RtpSender nativeCreateSender(String kind, long nativeStream); |
301 | 301 |
302 private native List<RtpSender> nativeGetSenders(); | 302 private native List<RtpSender> nativeGetSenders(); |
303 | 303 |
304 private native List<RtpReceiver> nativeGetReceivers(); | 304 private native List<RtpReceiver> nativeGetReceivers(); |
305 } | 305 } |
OLD | NEW |