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 | |
Henrik Kjellander | 15583c1 | 2016-02-10 10:53:12 +0100 | [diff] [blame] | 11 | #ifndef WEBRTC_API_LOCALAUDIOSOURCE_H_ |
| 12 | #define WEBRTC_API_LOCALAUDIOSOURCE_H_ |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 13 | |
Henrik Kjellander | 15583c1 | 2016-02-10 10:53:12 +0100 | [diff] [blame] | 14 | #include "webrtc/api/mediastreaminterface.h" |
| 15 | #include "webrtc/api/notifier.h" |
| 16 | #include "webrtc/api/peerconnectioninterface.h" |
buildbot@webrtc.org | a09a999 | 2014-08-13 17:26:08 +0000 | [diff] [blame] | 17 | #include "webrtc/base/scoped_ptr.h" |
kjellander | a96e2d7 | 2016-02-04 23:52:28 -0800 | [diff] [blame] | 18 | #include "webrtc/media/base/mediachannel.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 19 | |
| 20 | // LocalAudioSource implements AudioSourceInterface. |
| 21 | // This contains settings for switching audio processing on and off. |
| 22 | |
| 23 | namespace webrtc { |
| 24 | |
| 25 | class MediaConstraintsInterface; |
| 26 | |
| 27 | class LocalAudioSource : public Notifier<AudioSourceInterface> { |
| 28 | public: |
| 29 | // Creates an instance of LocalAudioSource. |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 30 | static rtc::scoped_refptr<LocalAudioSource> Create( |
wu@webrtc.org | 97077a3 | 2013-10-25 21:18:33 +0000 | [diff] [blame] | 31 | const PeerConnectionFactoryInterface::Options& options, |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 32 | const MediaConstraintsInterface* constraints); |
| 33 | |
tommi | 6eca7e3 | 2015-12-15 04:27:11 -0800 | [diff] [blame] | 34 | SourceState state() const override { return source_state_; } |
| 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: |
| 43 | LocalAudioSource() : source_state_(kInitializing) {} |
| 44 | ~LocalAudioSource() override {} |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 45 | |
| 46 | private: |
wu@webrtc.org | 97077a3 | 2013-10-25 21:18:33 +0000 | [diff] [blame] | 47 | void Initialize(const PeerConnectionFactoryInterface::Options& options, |
| 48 | const MediaConstraintsInterface* constraints); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 49 | |
| 50 | cricket::AudioOptions options_; |
| 51 | SourceState source_state_; |
| 52 | }; |
| 53 | |
| 54 | } // namespace webrtc |
| 55 | |
Henrik Kjellander | 15583c1 | 2016-02-10 10:53:12 +0100 | [diff] [blame] | 56 | #endif // WEBRTC_API_LOCALAUDIOSOURCE_H_ |