blob: d463d1ccd837113e2fc90c7203c8148e7b9e5054 [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
Henrik Kjellander15583c12016-02-10 10:53:12 +010011#ifndef WEBRTC_API_LOCALAUDIOSOURCE_H_
12#define WEBRTC_API_LOCALAUDIOSOURCE_H_
henrike@webrtc.org28e20752013-07-10 00:45:36 +000013
Henrik Kjellander15583c12016-02-10 10:53:12 +010014#include "webrtc/api/mediastreaminterface.h"
15#include "webrtc/api/notifier.h"
16#include "webrtc/api/peerconnectioninterface.h"
buildbot@webrtc.orga09a9992014-08-13 17:26:08 +000017#include "webrtc/base/scoped_ptr.h"
kjellandera96e2d72016-02-04 23:52:28 -080018#include "webrtc/media/base/mediachannel.h"
henrike@webrtc.org28e20752013-07-10 00:45:36 +000019
20// LocalAudioSource implements AudioSourceInterface.
21// This contains settings for switching audio processing on and off.
22
23namespace webrtc {
24
25class MediaConstraintsInterface;
26
27class LocalAudioSource : public Notifier<AudioSourceInterface> {
28 public:
29 // Creates an instance of LocalAudioSource.
buildbot@webrtc.orgd4e598d2014-07-29 17:36:52 +000030 static rtc::scoped_refptr<LocalAudioSource> Create(
wu@webrtc.org97077a32013-10-25 21:18:33 +000031 const PeerConnectionFactoryInterface::Options& options,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000032 const MediaConstraintsInterface* constraints);
33
tommi6eca7e32015-12-15 04:27:11 -080034 SourceState state() const override { return source_state_; }
35 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:
43 LocalAudioSource() : source_state_(kInitializing) {}
44 ~LocalAudioSource() override {}
henrike@webrtc.org28e20752013-07-10 00:45:36 +000045
46 private:
wu@webrtc.org97077a32013-10-25 21:18:33 +000047 void Initialize(const PeerConnectionFactoryInterface::Options& options,
48 const MediaConstraintsInterface* constraints);
henrike@webrtc.org28e20752013-07-10 00:45:36 +000049
50 cricket::AudioOptions options_;
51 SourceState source_state_;
52};
53
54} // namespace webrtc
55
Henrik Kjellander15583c12016-02-10 10:53:12 +010056#endif // WEBRTC_API_LOCALAUDIOSOURCE_H_