blob: cd17330e1fdcc63fb70cefb4aad00400341cac3a [file] [log] [blame]
henrike@webrtc.org28e20752013-07-10 00:45:361/*
kjellanderb24317b2016-02-10 15:54:432 * Copyright 2012 The WebRTC project authors. All Rights Reserved.
henrike@webrtc.org28e20752013-07-10 00:45:363 *
kjellanderb24317b2016-02-10 15:54:434 * 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:369 */
10
Mirko Bonadei92ea95e2017-09-15 04:47:3111#ifndef PC_LOCALAUDIOSOURCE_H_
12#define PC_LOCALAUDIOSOURCE_H_
henrike@webrtc.org28e20752013-07-10 00:45:3613
Mirko Bonadei92ea95e2017-09-15 04:47:3114#include "api/mediastreaminterface.h"
15#include "api/notifier.h"
16#include "media/base/mediachannel.h"
henrike@webrtc.org28e20752013-07-10 00:45:3617
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:5228 static rtc::scoped_refptr<LocalAudioSource> Create(
henrike@webrtc.org28e20752013-07-10 00:45:3629 const MediaConstraintsInterface* constraints);
30
htaa2a49d92016-03-04 10:51:3931 static rtc::scoped_refptr<LocalAudioSource> Create(
htaa2a49d92016-03-04 10:51:3932 const cricket::AudioOptions* audio_options);
33
34 SourceState state() const override { return kLive; }
tommi6eca7e32015-12-15 12:27:1135 bool remote() const override { return false; }
36
henrike@webrtc.org28e20752013-07-10 00:45:3637 virtual const cricket::AudioOptions& options() const { return options_; }
38
tommi6eca7e32015-12-15 12:27:1139 void AddSink(AudioTrackSinkInterface* sink) override {}
40 void RemoveSink(AudioTrackSinkInterface* sink) override {}
henrike@webrtc.org28e20752013-07-10 00:45:3641
tommi6eca7e32015-12-15 12:27:1142 protected:
htaa2a49d92016-03-04 10:51:3943 LocalAudioSource() {}
tommi6eca7e32015-12-15 12:27:1144 ~LocalAudioSource() override {}
henrike@webrtc.org28e20752013-07-10 00:45:3645
46 private:
deadbeef757146b2017-02-11 05:26:4847 void Initialize(const MediaConstraintsInterface* constraints);
48 void Initialize(const cricket::AudioOptions* audio_options);
henrike@webrtc.org28e20752013-07-10 00:45:3649
50 cricket::AudioOptions options_;
henrike@webrtc.org28e20752013-07-10 00:45:3651};
52
53} // namespace webrtc
54
Mirko Bonadei92ea95e2017-09-15 04:47:3155#endif // PC_LOCALAUDIOSOURCE_H_