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