webrtc_m130/modules/audio_device/win/audio_device_module_win.h
Mirko Bonadei d970807e0c Remove rtc_base/scoped_ref_ptr.h.
The type rtc::scoped_refptr<T> is now part of api/. Please include it from
api/scoped_refptr.h.

More info: See: https://groups.google.com/forum/#!topic/discuss-webrtc/Mme2MSz4z4o.

Bug: webrtc:9887, webrtc:8205
No-Try: True
Change-Id: Ic6c7c81e226e59f12f7933e472f573ae097b55bf
Reviewed-on: https://webrtc-review.googlesource.com/c/119041
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26414}
2019-01-25 20:29:58 +00:00

86 lines
2.9 KiB
C++

/*
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_AUDIO_DEVICE_WIN_AUDIO_DEVICE_MODULE_WIN_H_
#define MODULES_AUDIO_DEVICE_WIN_AUDIO_DEVICE_MODULE_WIN_H_
#include <memory>
#include <string>
#include "api/scoped_refptr.h"
#include "modules/audio_device/include/audio_device.h"
namespace webrtc {
class AudioDeviceBuffer;
namespace webrtc_win {
// This interface represents the main input-related parts of the complete
// AudioDeviceModule interface.
class AudioInput {
public:
virtual ~AudioInput() {}
virtual int Init() = 0;
virtual int Terminate() = 0;
virtual int NumDevices() const = 0;
virtual int SetDevice(int index) = 0;
virtual int SetDevice(AudioDeviceModule::WindowsDeviceType device) = 0;
virtual int DeviceName(int index, std::string* name, std::string* guid) = 0;
virtual void AttachAudioBuffer(AudioDeviceBuffer* audio_buffer) = 0;
virtual bool RecordingIsInitialized() const = 0;
virtual int InitRecording() = 0;
virtual int StartRecording() = 0;
virtual int StopRecording() = 0;
virtual bool Recording() = 0;
virtual int VolumeIsAvailable(bool* available) = 0;
virtual int RestartRecording() = 0;
virtual bool Restarting() const = 0;
virtual int SetSampleRate(uint32_t sample_rate) = 0;
};
// This interface represents the main output-related parts of the complete
// AudioDeviceModule interface.
class AudioOutput {
public:
virtual ~AudioOutput() {}
virtual int Init() = 0;
virtual int Terminate() = 0;
virtual int NumDevices() const = 0;
virtual int SetDevice(int index) = 0;
virtual int SetDevice(AudioDeviceModule::WindowsDeviceType device) = 0;
virtual int DeviceName(int index, std::string* name, std::string* guid) = 0;
virtual void AttachAudioBuffer(AudioDeviceBuffer* audio_buffer) = 0;
virtual bool PlayoutIsInitialized() const = 0;
virtual int InitPlayout() = 0;
virtual int StartPlayout() = 0;
virtual int StopPlayout() = 0;
virtual bool Playing() = 0;
virtual int VolumeIsAvailable(bool* available) = 0;
virtual int RestartPlayout() = 0;
virtual bool Restarting() const = 0;
virtual int SetSampleRate(uint32_t sample_rate) = 0;
};
// Combines an AudioInput and an AudioOutput implementation to build an
// AudioDeviceModule. Hides most parts of the full ADM interface.
rtc::scoped_refptr<AudioDeviceModuleForTest>
CreateWindowsCoreAudioAudioDeviceModuleFromInputAndOutput(
std::unique_ptr<AudioInput> audio_input,
std::unique_ptr<AudioOutput> audio_output);
} // namespace webrtc_win
} // namespace webrtc
#endif // MODULES_AUDIO_DEVICE_WIN_AUDIO_DEVICE_MODULE_WIN_H_