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