OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2015 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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 }); | 552 }); |
553 } | 553 } |
554 | 554 |
555 @Override | 555 @Override |
556 public void onRemoteIceCandidate(final IceCandidate candidate) { | 556 public void onRemoteIceCandidate(final IceCandidate candidate) { |
557 runOnUiThread(new Runnable() { | 557 runOnUiThread(new Runnable() { |
558 @Override | 558 @Override |
559 public void run() { | 559 public void run() { |
560 if (peerConnectionClient == null) { | 560 if (peerConnectionClient == null) { |
561 Log.e(TAG, | 561 Log.e(TAG, |
562 "Received ICE candidate for non-initilized peer connection."); | 562 "Received ICE candidate for non-initialized peer connection."); |
563 return; | 563 return; |
564 } | 564 } |
565 peerConnectionClient.addRemoteIceCandidate(candidate); | 565 peerConnectionClient.addRemoteIceCandidate(candidate); |
566 } | 566 } |
567 }); | 567 }); |
568 } | 568 } |
569 | 569 |
570 @Override | 570 @Override |
| 571 public void onRemoteIceCandidatesRemoved(final IceCandidate[] candidates) { |
| 572 runOnUiThread(new Runnable() { |
| 573 @Override |
| 574 public void run() { |
| 575 if (peerConnectionClient == null) { |
| 576 Log.e(TAG, "Received ICE candidate removals for non-initialized peer c
onnection."); |
| 577 return; |
| 578 } |
| 579 peerConnectionClient.removeRemoteIceCandidates(candidates); |
| 580 } |
| 581 }); |
| 582 } |
| 583 |
| 584 @Override |
571 public void onChannelClose() { | 585 public void onChannelClose() { |
572 runOnUiThread(new Runnable() { | 586 runOnUiThread(new Runnable() { |
573 @Override | 587 @Override |
574 public void run() { | 588 public void run() { |
575 logAndToast("Remote end hung up; dropping PeerConnection"); | 589 logAndToast("Remote end hung up; dropping PeerConnection"); |
576 disconnect(); | 590 disconnect(); |
577 } | 591 } |
578 }); | 592 }); |
579 } | 593 } |
580 | 594 |
(...skipping 30 matching lines...) Expand all Loading... |
611 @Override | 625 @Override |
612 public void run() { | 626 public void run() { |
613 if (appRtcClient != null) { | 627 if (appRtcClient != null) { |
614 appRtcClient.sendLocalIceCandidate(candidate); | 628 appRtcClient.sendLocalIceCandidate(candidate); |
615 } | 629 } |
616 } | 630 } |
617 }); | 631 }); |
618 } | 632 } |
619 | 633 |
620 @Override | 634 @Override |
| 635 public void onIceCandidatesRemoved(final IceCandidate[] candidates) { |
| 636 runOnUiThread(new Runnable() { |
| 637 @Override |
| 638 public void run() { |
| 639 if (appRtcClient != null) { |
| 640 appRtcClient.sendLocalIceCandidateRemovals(candidates); |
| 641 } |
| 642 } |
| 643 }); |
| 644 } |
| 645 |
| 646 @Override |
621 public void onIceConnected() { | 647 public void onIceConnected() { |
622 final long delta = System.currentTimeMillis() - callStartedTimeMs; | 648 final long delta = System.currentTimeMillis() - callStartedTimeMs; |
623 runOnUiThread(new Runnable() { | 649 runOnUiThread(new Runnable() { |
624 @Override | 650 @Override |
625 public void run() { | 651 public void run() { |
626 logAndToast("ICE connected, delay=" + delta + "ms"); | 652 logAndToast("ICE connected, delay=" + delta + "ms"); |
627 iceConnected = true; | 653 iceConnected = true; |
628 callConnected(); | 654 callConnected(); |
629 } | 655 } |
630 }); | 656 }); |
(...skipping 25 matching lines...) Expand all Loading... |
656 } | 682 } |
657 } | 683 } |
658 }); | 684 }); |
659 } | 685 } |
660 | 686 |
661 @Override | 687 @Override |
662 public void onPeerConnectionError(final String description) { | 688 public void onPeerConnectionError(final String description) { |
663 reportError(description); | 689 reportError(description); |
664 } | 690 } |
665 } | 691 } |
OLD | NEW |