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