henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 1 | /* |
kjellander | b24317b | 2016-02-10 15:54:43 | [diff] [blame] | 2 | * Copyright 2012 The WebRTC project authors. All Rights Reserved. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 3 | * |
kjellander | b24317b | 2016-02-10 15:54:43 | [diff] [blame] | 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. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 9 | */ |
| 10 | |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 11 | #ifndef PC_LOCAL_AUDIO_SOURCE_H_ |
| 12 | #define PC_LOCAL_AUDIO_SOURCE_H_ |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 13 | |
Yves Gerey | 3e70781 | 2018-11-28 15:47:49 | [diff] [blame] | 14 | #include "api/audio_options.h" |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 15 | #include "api/media_stream_interface.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 16 | #include "api/notifier.h" |
Mirko Bonadei | d970807 | 2019-01-25 19:26:48 | [diff] [blame] | 17 | #include "api/scoped_refptr.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 18 | |
| 19 | // LocalAudioSource implements AudioSourceInterface. |
| 20 | // This contains settings for switching audio processing on and off. |
| 21 | |
| 22 | namespace webrtc { |
| 23 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 24 | class LocalAudioSource : public Notifier<AudioSourceInterface> { |
| 25 | public: |
| 26 | // Creates an instance of LocalAudioSource. |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 27 | static rtc::scoped_refptr<LocalAudioSource> Create( |
hta | a2a49d9 | 2016-03-04 10:51:39 | [diff] [blame] | 28 | const cricket::AudioOptions* audio_options); |
| 29 | |
| 30 | SourceState state() const override { return kLive; } |
tommi | 6eca7e3 | 2015-12-15 12:27:11 | [diff] [blame] | 31 | bool remote() const override { return false; } |
| 32 | |
Piotr (Peter) Slatala | 95ca6e1 | 2018-11-13 15:57:07 | [diff] [blame] | 33 | const cricket::AudioOptions options() const override { return options_; } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 34 | |
tommi | 6eca7e3 | 2015-12-15 12:27:11 | [diff] [blame] | 35 | void AddSink(AudioTrackSinkInterface* sink) override {} |
| 36 | void RemoveSink(AudioTrackSinkInterface* sink) override {} |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 37 | |
tommi | 6eca7e3 | 2015-12-15 12:27:11 | [diff] [blame] | 38 | protected: |
hta | a2a49d9 | 2016-03-04 10:51:39 | [diff] [blame] | 39 | LocalAudioSource() {} |
tommi | 6eca7e3 | 2015-12-15 12:27:11 | [diff] [blame] | 40 | ~LocalAudioSource() override {} |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 41 | |
| 42 | private: |
deadbeef | 757146b | 2017-02-11 05:26:48 | [diff] [blame] | 43 | void Initialize(const cricket::AudioOptions* audio_options); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 44 | |
| 45 | cricket::AudioOptions options_; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 46 | }; |
| 47 | |
| 48 | } // namespace webrtc |
| 49 | |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 50 | #endif // PC_LOCAL_AUDIO_SOURCE_H_ |