blob: c6168237a9a1153a6868570b9adcc226d484f46e [file] [log] [blame]
solenberg566ef242015-11-06 15:34:49 -08001/*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10#ifndef WEBRTC_AUDIO_STATE_H_
11#define WEBRTC_AUDIO_STATE_H_
12
13#include "webrtc/base/refcount.h"
14#include "webrtc/base/scoped_ref_ptr.h"
15
16namespace webrtc {
17
18class AudioDeviceModule;
19class VoiceEngine;
20
21// AudioState holds the state which must be shared between multiple instances of
22// webrtc::Call for audio processing purposes.
23class AudioState : public rtc::RefCountInterface {
24 public:
25 struct Config {
26 // VoiceEngine used for audio streams and audio/video synchronization.
27 // AudioState will tickle the VoE refcount to keep it alive for as long as
28 // the AudioState itself.
29 VoiceEngine* voice_engine = nullptr;
30
31 // The AudioDeviceModule associated with the Calls.
32 AudioDeviceModule* audio_device_module = nullptr;
33 };
34
35 // TODO(solenberg): Replace scoped_refptr with shared_ptr once we can use it.
36 static rtc::scoped_refptr<AudioState> Create(
37 const AudioState::Config& config);
38
39 virtual ~AudioState() {}
40};
41} // namespace webrtc
42
43#endif // WEBRTC_AUDIO_STATE_H_