1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/renderer/media/webrtc_audio_device_not_impl.h"
9 const int64 kMillisecondsBetweenProcessCalls
= 5000;
15 WebRtcAudioDeviceNotImpl::WebRtcAudioDeviceNotImpl()
16 : last_process_time_(base::TimeTicks::Now()) {
19 int32_t WebRtcAudioDeviceNotImpl::ChangeUniqueId(const int32_t id
) {
23 int32_t WebRtcAudioDeviceNotImpl::TimeUntilNextProcess() {
24 base::TimeDelta delta_time
= (base::TimeTicks::Now() - last_process_time_
);
25 int64 time_until_next
=
26 kMillisecondsBetweenProcessCalls
- delta_time
.InMilliseconds();
27 return static_cast<int32_t>(time_until_next
);
30 int32_t WebRtcAudioDeviceNotImpl::Process() {
31 last_process_time_
= base::TimeTicks::Now();
35 int32_t WebRtcAudioDeviceNotImpl::RegisterEventObserver(
36 webrtc::AudioDeviceObserver
* event_callback
) {
40 int32_t WebRtcAudioDeviceNotImpl::ActiveAudioLayer(
41 AudioLayer
* audio_layer
) const {
45 webrtc::AudioDeviceModule::ErrorCode
46 WebRtcAudioDeviceNotImpl::LastError() const {
47 return AudioDeviceModule::kAdmErrNone
;
50 int16_t WebRtcAudioDeviceNotImpl::PlayoutDevices() {
54 int16_t WebRtcAudioDeviceNotImpl::RecordingDevices() {
58 int32_t WebRtcAudioDeviceNotImpl::PlayoutDeviceName(
59 uint16_t index
, char name
[webrtc::kAdmMaxDeviceNameSize
],
60 char guid
[webrtc::kAdmMaxGuidSize
]) {
64 int32_t WebRtcAudioDeviceNotImpl::RecordingDeviceName(
65 uint16_t index
, char name
[webrtc::kAdmMaxDeviceNameSize
],
66 char guid
[webrtc::kAdmMaxGuidSize
]) {
70 int32_t WebRtcAudioDeviceNotImpl::SetPlayoutDevice(uint16_t index
) {
74 int32_t WebRtcAudioDeviceNotImpl::SetPlayoutDevice(WindowsDeviceType device
) {
78 int32_t WebRtcAudioDeviceNotImpl::SetRecordingDevice(uint16_t index
) {
82 int32_t WebRtcAudioDeviceNotImpl::SetRecordingDevice(WindowsDeviceType device
) {
86 int32_t WebRtcAudioDeviceNotImpl::InitPlayout() {
90 int32_t WebRtcAudioDeviceNotImpl::InitRecording() {
94 int32_t WebRtcAudioDeviceNotImpl::SetWaveOutVolume(uint16_t volume_left
,
95 uint16_t volume_right
) {
99 int32_t WebRtcAudioDeviceNotImpl::WaveOutVolume(
100 uint16_t* volume_left
, uint16_t* volume_right
) const {
104 int32_t WebRtcAudioDeviceNotImpl::SpeakerIsAvailable(bool* available
) {
108 int32_t WebRtcAudioDeviceNotImpl::InitSpeaker() {
112 bool WebRtcAudioDeviceNotImpl::SpeakerIsInitialized() const {
116 int32_t WebRtcAudioDeviceNotImpl::MicrophoneIsAvailable(bool* available
) {
120 int32_t WebRtcAudioDeviceNotImpl::InitMicrophone() {
124 bool WebRtcAudioDeviceNotImpl::MicrophoneIsInitialized() const {
128 int32_t WebRtcAudioDeviceNotImpl::SpeakerVolumeIsAvailable(bool* available
) {
132 int32_t WebRtcAudioDeviceNotImpl::SetSpeakerVolume(uint32_t volume
) {
136 int32_t WebRtcAudioDeviceNotImpl::SpeakerVolume(uint32_t* volume
) const {
140 int32_t WebRtcAudioDeviceNotImpl::MaxSpeakerVolume(uint32_t* max_volume
) const {
144 int32_t WebRtcAudioDeviceNotImpl::MinSpeakerVolume(uint32_t* min_volume
) const {
148 int32_t WebRtcAudioDeviceNotImpl::SpeakerVolumeStepSize(
149 uint16_t* step_size
) const {
153 int32_t WebRtcAudioDeviceNotImpl::MicrophoneVolumeIsAvailable(bool* available
) {
157 int32_t WebRtcAudioDeviceNotImpl::MicrophoneVolumeStepSize(
158 uint16_t* step_size
) const {
162 int32_t WebRtcAudioDeviceNotImpl::SpeakerMuteIsAvailable(bool* available
) {
166 int32_t WebRtcAudioDeviceNotImpl::SetSpeakerMute(bool enable
) {
170 int32_t WebRtcAudioDeviceNotImpl::SpeakerMute(bool* enabled
) const {
174 int32_t WebRtcAudioDeviceNotImpl::MicrophoneMuteIsAvailable(bool* available
) {
178 int32_t WebRtcAudioDeviceNotImpl::SetMicrophoneMute(bool enable
) {
182 int32_t WebRtcAudioDeviceNotImpl::MicrophoneMute(bool* enabled
) const {
186 int32_t WebRtcAudioDeviceNotImpl::MicrophoneBoostIsAvailable(bool* available
) {
190 int32_t WebRtcAudioDeviceNotImpl::SetMicrophoneBoost(bool enable
) {
194 int32_t WebRtcAudioDeviceNotImpl::MicrophoneBoost(bool* enabled
) const {
198 int32_t WebRtcAudioDeviceNotImpl::SetStereoPlayout(bool enable
) {
202 int32_t WebRtcAudioDeviceNotImpl::StereoPlayout(bool* enabled
) const {
206 int32_t WebRtcAudioDeviceNotImpl::SetStereoRecording(bool enable
) {
210 int32_t WebRtcAudioDeviceNotImpl::StereoRecording(bool* enabled
) const {
214 int32_t WebRtcAudioDeviceNotImpl::SetRecordingChannel(
215 const ChannelType channel
) {
219 int32_t WebRtcAudioDeviceNotImpl::RecordingChannel(ChannelType
* channel
) const {
223 int32_t WebRtcAudioDeviceNotImpl::SetPlayoutBuffer(const BufferType type
,
228 int32_t WebRtcAudioDeviceNotImpl::PlayoutBuffer(BufferType
* type
,
229 uint16_t* size_ms
) const {
233 int32_t WebRtcAudioDeviceNotImpl::CPULoad(uint16_t* load
) const {
237 int32_t WebRtcAudioDeviceNotImpl::StartRawOutputFileRecording(
238 const char pcm_file_name_utf8
[webrtc::kAdmMaxFileNameSize
]) {
242 int32_t WebRtcAudioDeviceNotImpl::StopRawOutputFileRecording() {
246 int32_t WebRtcAudioDeviceNotImpl::StartRawInputFileRecording(
247 const char pcm_file_name_utf8
[webrtc::kAdmMaxFileNameSize
]) {
251 int32_t WebRtcAudioDeviceNotImpl::StopRawInputFileRecording() {
255 int32_t WebRtcAudioDeviceNotImpl::SetRecordingSampleRate(
256 const uint32_t samples_per_sec
) {
260 int32_t WebRtcAudioDeviceNotImpl::SetPlayoutSampleRate(
261 const uint32_t samples_per_sec
) {
265 int32_t WebRtcAudioDeviceNotImpl::ResetAudioDevice() {
269 int32_t WebRtcAudioDeviceNotImpl::SetLoudspeakerStatus(bool enable
) {
273 int32_t WebRtcAudioDeviceNotImpl::GetLoudspeakerStatus(bool* enabled
) const {
277 } // namespace content