blob: 587ce10809073f5f12cccba81aa8d8bfe28a0c7c [file] [log] [blame]
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001/*
kjellanderb24317b2016-02-10 07:54:43 -08002 * Copyright 2012 The WebRTC project authors. All Rights Reserved.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00003 *
kjellanderb24317b2016-02-10 07:54:43 -08004 * 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.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00009 */
10
Steve Anton10542f22019-01-11 09:11:00 -080011#ifndef PC_LOCAL_AUDIO_SOURCE_H_
12#define PC_LOCAL_AUDIO_SOURCE_H_
henrike@webrtc.org28e20752013-07-10 00:45:36 +000013
Yves Gerey3e707812018-11-28 16:47:49 +010014#include "api/audio_options.h"
Steve Anton10542f22019-01-11 09:11:00 -080015#include "api/media_stream_interface.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020016#include "api/notifier.h"
Mirko Bonadeid9708072019-01-25 20:26:48 +010017#include "api/scoped_refptr.h"
henrike@webrtc.org28e20752013-07-10 00:45:36 +000018
19// LocalAudioSource implements AudioSourceInterface.
20// This contains settings for switching audio processing on and off.
21
22namespace webrtc {
23
henrike@webrtc.org28e20752013-07-10 00:45:36 +000024class LocalAudioSource : public Notifier<AudioSourceInterface> {
25 public:
26 // Creates an instance of LocalAudioSource.
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +000027 static rtc::scoped_refptr<LocalAudioSource> Create(
htaa2a49d92016-03-04 02:51:39 -080028 const cricket::AudioOptions* audio_options);
29
30 SourceState state() const override { return kLive; }
tommi6eca7e32015-12-15 04:27:11 -080031 bool remote() const override { return false; }
32
Piotr (Peter) Slatala95ca6e12018-11-13 07:57:07 -080033 const cricket::AudioOptions options() const override { return options_; }
henrike@webrtc.org28e20752013-07-10 00:45:36 +000034
tommi6eca7e32015-12-15 04:27:11 -080035 void AddSink(AudioTrackSinkInterface* sink) override {}
36 void RemoveSink(AudioTrackSinkInterface* sink) override {}
henrike@webrtc.org28e20752013-07-10 00:45:36 +000037
tommi6eca7e32015-12-15 04:27:11 -080038 protected:
htaa2a49d92016-03-04 02:51:39 -080039 LocalAudioSource() {}
tommi6eca7e32015-12-15 04:27:11 -080040 ~LocalAudioSource() override {}
henrike@webrtc.org28e20752013-07-10 00:45:36 +000041
42 private:
deadbeef757146b2017-02-10 21:26:48 -080043 void Initialize(const cricket::AudioOptions* audio_options);
henrike@webrtc.org28e20752013-07-10 00:45:36 +000044
45 cricket::AudioOptions options_;
henrike@webrtc.org28e20752013-07-10 00:45:36 +000046};
47
48} // namespace webrtc
49
Steve Anton10542f22019-01-11 09:11:00 -080050#endif // PC_LOCAL_AUDIO_SOURCE_H_