OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 | 635 |
636 #ifdef WEBRTC_EXTERNAL_TRANSPORT | 636 #ifdef WEBRTC_EXTERNAL_TRANSPORT |
637 int32_t VoEBaseImpl::AddExternalTransportBuild(char* str) const { | 637 int32_t VoEBaseImpl::AddExternalTransportBuild(char* str) const { |
638 return sprintf(str, "External transport build\n"); | 638 return sprintf(str, "External transport build\n"); |
639 } | 639 } |
640 #endif | 640 #endif |
641 | 641 |
642 int VoEBaseImpl::LastError() { return (shared_->statistics().LastError()); } | 642 int VoEBaseImpl::LastError() { return (shared_->statistics().LastError()); } |
643 | 643 |
644 int32_t VoEBaseImpl::StartPlayout() { | 644 int32_t VoEBaseImpl::StartPlayout() { |
645 if (shared_->audio_device()->Playing()) { | 645 if (!shared_->audio_device()->Playing()) { |
646 return 0; | |
647 } | |
648 if (!shared_->ext_playout()) { | |
649 if (shared_->audio_device()->InitPlayout() != 0) { | 646 if (shared_->audio_device()->InitPlayout() != 0) { |
650 LOG_F(LS_ERROR) << "Failed to initialize playout"; | 647 LOG_F(LS_ERROR) << "Failed to initialize playout"; |
651 return -1; | 648 return -1; |
652 } | 649 } |
653 if (shared_->audio_device()->StartPlayout() != 0) { | 650 if (shared_->audio_device()->StartPlayout() != 0) { |
654 LOG_F(LS_ERROR) << "Failed to start playout"; | 651 LOG_F(LS_ERROR) << "Failed to start playout"; |
655 return -1; | 652 return -1; |
656 } | 653 } |
657 } | 654 } |
658 return 0; | 655 return 0; |
659 } | 656 } |
660 | 657 |
661 int32_t VoEBaseImpl::StopPlayout() { | 658 int32_t VoEBaseImpl::StopPlayout() { |
662 // Stop audio-device playing if no channel is playing out | 659 // Stop audio-device playing if no channel is playing out |
663 if (shared_->NumOfPlayingChannels() == 0) { | 660 if (shared_->NumOfPlayingChannels() == 0) { |
664 if (shared_->audio_device()->StopPlayout() != 0) { | 661 if (shared_->audio_device()->StopPlayout() != 0) { |
665 shared_->SetLastError(VE_CANNOT_STOP_PLAYOUT, kTraceError, | 662 shared_->SetLastError(VE_CANNOT_STOP_PLAYOUT, kTraceError, |
666 "StopPlayout() failed to stop playout"); | 663 "StopPlayout() failed to stop playout"); |
667 return -1; | 664 return -1; |
668 } | 665 } |
669 } | 666 } |
670 return 0; | 667 return 0; |
671 } | 668 } |
672 | 669 |
673 int32_t VoEBaseImpl::StartSend() { | 670 int32_t VoEBaseImpl::StartSend() { |
674 if (shared_->audio_device()->Recording()) { | 671 if (!shared_->audio_device()->Recording()) { |
675 return 0; | |
676 } | |
677 if (!shared_->ext_recording()) { | |
678 if (shared_->audio_device()->InitRecording() != 0) { | 672 if (shared_->audio_device()->InitRecording() != 0) { |
679 LOG_F(LS_ERROR) << "Failed to initialize recording"; | 673 LOG_F(LS_ERROR) << "Failed to initialize recording"; |
680 return -1; | 674 return -1; |
681 } | 675 } |
682 if (shared_->audio_device()->StartRecording() != 0) { | 676 if (shared_->audio_device()->StartRecording() != 0) { |
683 LOG_F(LS_ERROR) << "Failed to start recording"; | 677 LOG_F(LS_ERROR) << "Failed to start recording"; |
684 return -1; | 678 return -1; |
685 } | 679 } |
686 } | 680 } |
687 | |
688 return 0; | 681 return 0; |
689 } | 682 } |
690 | 683 |
691 int32_t VoEBaseImpl::StopSend() { | 684 int32_t VoEBaseImpl::StopSend() { |
692 if (shared_->NumOfSendingChannels() == 0 && | 685 if (shared_->NumOfSendingChannels() == 0 && |
693 !shared_->transmit_mixer()->IsRecordingMic()) { | 686 !shared_->transmit_mixer()->IsRecordingMic()) { |
694 // Stop audio-device recording if no channel is recording | 687 // Stop audio-device recording if no channel is recording |
695 if (shared_->audio_device()->StopRecording() != 0) { | 688 if (shared_->audio_device()->StopRecording() != 0) { |
696 shared_->SetLastError(VE_CANNOT_STOP_RECORDING, kTraceError, | 689 shared_->SetLastError(VE_CANNOT_STOP_RECORDING, kTraceError, |
697 "StopSend() failed to stop recording"); | 690 "StopSend() failed to stop recording"); |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 shared_->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, | 861 shared_->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, |
869 "AssociateSendChannel() failed to locate accociate_send_channel"); | 862 "AssociateSendChannel() failed to locate accociate_send_channel"); |
870 return -1; | 863 return -1; |
871 } | 864 } |
872 | 865 |
873 channel_ptr->set_associate_send_channel(ch); | 866 channel_ptr->set_associate_send_channel(ch); |
874 return 0; | 867 return 0; |
875 } | 868 } |
876 | 869 |
877 } // namespace webrtc | 870 } // namespace webrtc |
OLD | NEW |