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 | |
Henrik Kjellander | 15583c1 | 2016-02-10 09:53:12 | [diff] [blame] | 11 | #ifndef WEBRTC_API_LOCALAUDIOSOURCE_H_ |
| 12 | #define WEBRTC_API_LOCALAUDIOSOURCE_H_ |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 13 | |
Henrik Kjellander | 15583c1 | 2016-02-10 09:53:12 | [diff] [blame] | 14 | #include "webrtc/api/mediastreaminterface.h" |
| 15 | #include "webrtc/api/notifier.h" |
| 16 | #include "webrtc/api/peerconnectioninterface.h" |
kjellander | a96e2d7 | 2016-02-05 07:52:28 | [diff] [blame] | 17 | #include "webrtc/media/base/mediachannel.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 | |
| 24 | class MediaConstraintsInterface; |
| 25 | |
| 26 | class LocalAudioSource : public Notifier<AudioSourceInterface> { |
| 27 | public: |
| 28 | // Creates an instance of LocalAudioSource. |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 29 | static rtc::scoped_refptr<LocalAudioSource> Create( |
wu@webrtc.org | 97077a3 | 2013-10-25 21:18:33 | [diff] [blame] | 30 | const PeerConnectionFactoryInterface::Options& options, |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 31 | const MediaConstraintsInterface* constraints); |
| 32 | |
hta | a2a49d9 | 2016-03-04 10:51:39 | [diff] [blame] | 33 | static rtc::scoped_refptr<LocalAudioSource> Create( |
| 34 | const PeerConnectionFactoryInterface::Options& options, |
| 35 | const cricket::AudioOptions* audio_options); |
| 36 | |
| 37 | SourceState state() const override { return kLive; } |
tommi | 6eca7e3 | 2015-12-15 12:27:11 | [diff] [blame] | 38 | bool remote() const override { return false; } |
| 39 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 40 | virtual const cricket::AudioOptions& options() const { return options_; } |
| 41 | |
tommi | 6eca7e3 | 2015-12-15 12:27:11 | [diff] [blame] | 42 | void AddSink(AudioTrackSinkInterface* sink) override {} |
| 43 | void RemoveSink(AudioTrackSinkInterface* sink) override {} |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 44 | |
tommi | 6eca7e3 | 2015-12-15 12:27:11 | [diff] [blame] | 45 | protected: |
hta | a2a49d9 | 2016-03-04 10:51:39 | [diff] [blame] | 46 | LocalAudioSource() {} |
tommi | 6eca7e3 | 2015-12-15 12:27:11 | [diff] [blame] | 47 | ~LocalAudioSource() override {} |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 48 | |
| 49 | private: |
wu@webrtc.org | 97077a3 | 2013-10-25 21:18:33 | [diff] [blame] | 50 | void Initialize(const PeerConnectionFactoryInterface::Options& options, |
| 51 | const MediaConstraintsInterface* constraints); |
hta | a2a49d9 | 2016-03-04 10:51:39 | [diff] [blame] | 52 | void Initialize(const PeerConnectionFactoryInterface::Options& options, |
| 53 | const cricket::AudioOptions* audio_options); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 54 | |
| 55 | cricket::AudioOptions options_; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 56 | }; |
| 57 | |
| 58 | } // namespace webrtc |
| 59 | |
Henrik Kjellander | 15583c1 | 2016-02-10 09:53:12 | [diff] [blame] | 60 | #endif // WEBRTC_API_LOCALAUDIOSOURCE_H_ |