| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 ret = false; | 913 ret = false; |
| 914 } | 914 } |
| 915 | 915 |
| 916 if (ret) { | 916 if (ret) { |
| 917 LOG(LS_INFO) << "Set microphone to (id=" << in_id | 917 LOG(LS_INFO) << "Set microphone to (id=" << in_id |
| 918 << ") and speaker to (id=" << out_id << ")"; | 918 << ") and speaker to (id=" << out_id << ")"; |
| 919 } | 919 } |
| 920 #endif // !WEBRTC_IOS | 920 #endif // !WEBRTC_IOS |
| 921 } | 921 } |
| 922 | 922 |
| 923 bool WebRtcVoiceEngine::GetOutputVolume(int* level) { | |
| 924 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | |
| 925 unsigned int ulevel; | |
| 926 if (voe_wrapper_->volume()->GetSpeakerVolume(ulevel) == -1) { | |
| 927 LOG_RTCERR1(GetSpeakerVolume, level); | |
| 928 return false; | |
| 929 } | |
| 930 *level = ulevel; | |
| 931 return true; | |
| 932 } | |
| 933 | |
| 934 bool WebRtcVoiceEngine::SetOutputVolume(int level) { | |
| 935 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | |
| 936 RTC_DCHECK(level >= 0 && level <= 255); | |
| 937 if (voe_wrapper_->volume()->SetSpeakerVolume(level) == -1) { | |
| 938 LOG_RTCERR1(SetSpeakerVolume, level); | |
| 939 return false; | |
| 940 } | |
| 941 return true; | |
| 942 } | |
| 943 | |
| 944 int WebRtcVoiceEngine::GetInputLevel() { | 923 int WebRtcVoiceEngine::GetInputLevel() { |
| 945 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 924 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| 946 unsigned int ulevel; | 925 unsigned int ulevel; |
| 947 return (voe_wrapper_->volume()->GetSpeechInputLevel(ulevel) != -1) ? | 926 return (voe_wrapper_->volume()->GetSpeechInputLevel(ulevel) != -1) ? |
| 948 static_cast<int>(ulevel) : -1; | 927 static_cast<int>(ulevel) : -1; |
| 949 } | 928 } |
| 950 | 929 |
| 951 const std::vector<AudioCodec>& WebRtcVoiceEngine::codecs() { | 930 const std::vector<AudioCodec>& WebRtcVoiceEngine::codecs() { |
| 952 RTC_DCHECK(signal_thread_checker_.CalledOnValidThread()); | 931 RTC_DCHECK(signal_thread_checker_.CalledOnValidThread()); |
| 953 return codecs_; | 932 return codecs_; |
| (...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2637 } | 2616 } |
| 2638 } else { | 2617 } else { |
| 2639 LOG(LS_INFO) << "Stopping playout for channel #" << channel; | 2618 LOG(LS_INFO) << "Stopping playout for channel #" << channel; |
| 2640 engine()->voe()->base()->StopPlayout(channel); | 2619 engine()->voe()->base()->StopPlayout(channel); |
| 2641 } | 2620 } |
| 2642 return true; | 2621 return true; |
| 2643 } | 2622 } |
| 2644 } // namespace cricket | 2623 } // namespace cricket |
| 2645 | 2624 |
| 2646 #endif // HAVE_WEBRTC_VOICE | 2625 #endif // HAVE_WEBRTC_VOICE |
| OLD | NEW |