blob: b8dca3fb4ec67f9144e69ccb8deb08ad7765b427 [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 */
kjellandera69d9732016-08-31 07:33:05 -070010#ifndef WEBRTC_API_CALL_AUDIO_STATE_H_
11#define WEBRTC_API_CALL_AUDIO_STATE_H_
solenberg566ef242015-11-06 15:34:49 -080012
aleloi81da4882016-11-08 04:26:30 -080013#include "webrtc/api/audio/audio_mixer.h"
solenberg566ef242015-11-06 15:34:49 -080014#include "webrtc/base/refcount.h"
15#include "webrtc/base/scoped_ref_ptr.h"
16
17namespace webrtc {
18
solenberg566ef242015-11-06 15:34:49 -080019class VoiceEngine;
20
Fredrik Solenberga4527c82015-12-03 13:06:20 +010021// WORK IN PROGRESS
22// This class is under development and is not yet intended for for use outside
23// of WebRtc/Libjingle. Please use the VoiceEngine API instead.
24// See: https://bugs.chromium.org/p/webrtc/issues/detail?id=4690
25
solenberg566ef242015-11-06 15:34:49 -080026// AudioState holds the state which must be shared between multiple instances of
27// webrtc::Call for audio processing purposes.
28class AudioState : public rtc::RefCountInterface {
29 public:
30 struct Config {
31 // VoiceEngine used for audio streams and audio/video synchronization.
32 // AudioState will tickle the VoE refcount to keep it alive for as long as
33 // the AudioState itself.
34 VoiceEngine* voice_engine = nullptr;
35
aleloi81da4882016-11-08 04:26:30 -080036 // The audio mixer connected to active receive streams. One per
37 // AudioState.
38 rtc::scoped_refptr<AudioMixer> audio_mixer;
solenberg566ef242015-11-06 15:34:49 -080039 };
40
41 // TODO(solenberg): Replace scoped_refptr with shared_ptr once we can use it.
42 static rtc::scoped_refptr<AudioState> Create(
43 const AudioState::Config& config);
44
45 virtual ~AudioState() {}
46};
47} // namespace webrtc
48
kjellandera69d9732016-08-31 07:33:05 -070049#endif // WEBRTC_API_CALL_AUDIO_STATE_H_