OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 // TODO(fischman): add support for DTMF-related methods once that API | 482 // TODO(fischman): add support for DTMF-related methods once that API |
483 // stabilizes. | 483 // stabilizes. |
484 public native SignalingState signalingState(); | 484 public native SignalingState signalingState(); |
485 | 485 |
486 public native IceConnectionState iceConnectionState(); | 486 public native IceConnectionState iceConnectionState(); |
487 | 487 |
488 public native IceGatheringState iceGatheringState(); | 488 public native IceGatheringState iceGatheringState(); |
489 | 489 |
490 public native void close(); | 490 public native void close(); |
491 | 491 |
| 492 /** |
| 493 * Free native resources associated with this PeerConnection instance. |
| 494 * <p> |
| 495 * This method removes a reference count from the C++ PeerConnection object, |
| 496 * which should result in it being destroyed. It also calls equivalent |
| 497 * "dispose" methods on the Java objects attached to this PeerConnection |
| 498 * (streams, senders, receivers), such that their associated C++ objects |
| 499 * will also be destroyed. |
| 500 * <p> |
| 501 * Note that this method cannot be safely called from an observer callback |
| 502 * (PeerConnection.Observer, DataChannel.Observer, etc.). If you want to, for |
| 503 * example, destroy the PeerConnection after an "ICE failed" callback, you |
| 504 * must do this asynchronously (in other words, unwind the stack first). See |
| 505 * <a href="https://bugs.chromium.org/p/webrtc/issues/detail?id=3721">bug |
| 506 * 3721</a> for more details. |
| 507 */ |
492 public void dispose() { | 508 public void dispose() { |
493 close(); | 509 close(); |
494 for (MediaStream stream : localStreams) { | 510 for (MediaStream stream : localStreams) { |
495 nativeRemoveLocalStream(stream.nativeStream); | 511 nativeRemoveLocalStream(stream.nativeStream); |
496 stream.dispose(); | 512 stream.dispose(); |
497 } | 513 } |
498 localStreams.clear(); | 514 localStreams.clear(); |
499 for (RtpSender sender : senders) { | 515 for (RtpSender sender : senders) { |
500 sender.dispose(); | 516 sender.dispose(); |
501 } | 517 } |
(...skipping 26 matching lines...) Expand all Loading... |
528 private native RtpSender nativeCreateSender(String kind, String stream_id); | 544 private native RtpSender nativeCreateSender(String kind, String stream_id); |
529 | 545 |
530 private native List<RtpSender> nativeGetSenders(); | 546 private native List<RtpSender> nativeGetSenders(); |
531 | 547 |
532 private native List<RtpReceiver> nativeGetReceivers(); | 548 private native List<RtpReceiver> nativeGetReceivers(); |
533 | 549 |
534 private native boolean nativeStartRtcEventLog(int file_descriptor, int max_siz
e_bytes); | 550 private native boolean nativeStartRtcEventLog(int file_descriptor, int max_siz
e_bytes); |
535 | 551 |
536 private native void nativeStopRtcEventLog(); | 552 private native void nativeStopRtcEventLog(); |
537 } | 553 } |
OLD | NEW |