blob: cd17330e1fdcc63fb70cefb4aad00400341cac3a [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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef PC_LOCALAUDIOSOURCE_H_
12#define PC_LOCALAUDIOSOURCE_H_
henrike@webrtc.org28e20752013-07-10 00:45:36 +000013
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020014#include "api/mediastreaminterface.h"
15#include "api/notifier.h"
16#include "media/base/mediachannel.h"
henrike@webrtc.org28e20752013-07-10 00:45:36 +000017
18// LocalAudioSource implements AudioSourceInterface.
19// This contains settings for switching audio processing on and off.
20
21namespace webrtc {
22
23class MediaConstraintsInterface;
24
25class LocalAudioSource : public Notifier<AudioSourceInterface> {
26 public:
27 // Creates an instance of LocalAudioSource.
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +000028 static rtc::scoped_refptr<LocalAudioSource> Create(
henrike@webrtc.org28e20752013-07-10 00:45:36 +000029 const MediaConstraintsInterface* constraints);
30
htaa2a49d92016-03-04 02:51:39 -080031 static rtc::scoped_refptr<LocalAudioSource> Create(
htaa2a49d92016-03-04 02:51:39 -080032 const cricket::AudioOptions* audio_options);
33
34 SourceState state() const override { return kLive; }
tommi6eca7e32015-12-15 04:27:11 -080035 bool remote() const override { return false; }
36
henrike@webrtc.org28e20752013-07-10 00:45:36 +000037 virtual const cricket::AudioOptions& options() const { return options_; }
38
tommi6eca7e32015-12-15 04:27:11 -080039 void AddSink(AudioTrackSinkInterface* sink) override {}
40 void RemoveSink(AudioTrackSinkInterface* sink) override {}
henrike@webrtc.org28e20752013-07-10 00:45:36 +000041
tommi6eca7e32015-12-15 04:27:11 -080042 protected:
htaa2a49d92016-03-04 02:51:39 -080043 LocalAudioSource() {}
tommi6eca7e32015-12-15 04:27:11 -080044 ~LocalAudioSource() override {}
henrike@webrtc.org28e20752013-07-10 00:45:36 +000045
46 private:
deadbeef757146b2017-02-10 21:26:48 -080047 void Initialize(const MediaConstraintsInterface* constraints);
48 void Initialize(const cricket::AudioOptions* audio_options);
henrike@webrtc.org28e20752013-07-10 00:45:36 +000049
50 cricket::AudioOptions options_;
henrike@webrtc.org28e20752013-07-10 00:45:36 +000051};
52
53} // namespace webrtc
54
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020055#endif // PC_LOCALAUDIOSOURCE_H_