blob: c5f65304d0b3ceb5b770406554424d34cc3c7f49 [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
henrike@webrtc.org28e20752013-07-10 00:45:36 +000023class LocalAudioSource : public Notifier<AudioSourceInterface> {
24 public:
25 // Creates an instance of LocalAudioSource.
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +000026 static rtc::scoped_refptr<LocalAudioSource> Create(
htaa2a49d92016-03-04 02:51:39 -080027 const cricket::AudioOptions* audio_options);
28
29 SourceState state() const override { return kLive; }
tommi6eca7e32015-12-15 04:27:11 -080030 bool remote() const override { return false; }
31
henrike@webrtc.org28e20752013-07-10 00:45:36 +000032 virtual const cricket::AudioOptions& options() const { return options_; }
33
tommi6eca7e32015-12-15 04:27:11 -080034 void AddSink(AudioTrackSinkInterface* sink) override {}
35 void RemoveSink(AudioTrackSinkInterface* sink) override {}
henrike@webrtc.org28e20752013-07-10 00:45:36 +000036
tommi6eca7e32015-12-15 04:27:11 -080037 protected:
htaa2a49d92016-03-04 02:51:39 -080038 LocalAudioSource() {}
tommi6eca7e32015-12-15 04:27:11 -080039 ~LocalAudioSource() override {}
henrike@webrtc.org28e20752013-07-10 00:45:36 +000040
41 private:
deadbeef757146b2017-02-10 21:26:48 -080042 void Initialize(const cricket::AudioOptions* audio_options);
henrike@webrtc.org28e20752013-07-10 00:45:36 +000043
44 cricket::AudioOptions options_;
henrike@webrtc.org28e20752013-07-10 00:45:36 +000045};
46
47} // namespace webrtc
48
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020049#endif // PC_LOCALAUDIOSOURCE_H_