blob: e1c023e5424c5ec796229fea0f903b8194bfc6af [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
Henrik Kjellander15583c12016-02-10 09:53:1211#ifndef WEBRTC_API_LOCALAUDIOSOURCE_H_
12#define WEBRTC_API_LOCALAUDIOSOURCE_H_
henrike@webrtc.org28e20752013-07-10 00:45:3613
Henrik Kjellander15583c12016-02-10 09:53:1214#include "webrtc/api/mediastreaminterface.h"
15#include "webrtc/api/notifier.h"
16#include "webrtc/api/peerconnectioninterface.h"
kjellandera96e2d72016-02-05 07:52:2817#include "webrtc/media/base/mediachannel.h"
henrike@webrtc.org28e20752013-07-10 00:45:3618
19// LocalAudioSource implements AudioSourceInterface.
20// This contains settings for switching audio processing on and off.
21
22namespace webrtc {
23
24class MediaConstraintsInterface;
25
26class LocalAudioSource : public Notifier<AudioSourceInterface> {
27 public:
28 // Creates an instance of LocalAudioSource.
buildbot@webrtc.orgd4e598d2014-07-29 17:36:5229 static rtc::scoped_refptr<LocalAudioSource> Create(
wu@webrtc.org97077a32013-10-25 21:18:3330 const PeerConnectionFactoryInterface::Options& options,
henrike@webrtc.org28e20752013-07-10 00:45:3631 const MediaConstraintsInterface* constraints);
32
htaa2a49d92016-03-04 10:51:3933 static rtc::scoped_refptr<LocalAudioSource> Create(
34 const PeerConnectionFactoryInterface::Options& options,
35 const cricket::AudioOptions* audio_options);
36
37 SourceState state() const override { return kLive; }
tommi6eca7e32015-12-15 12:27:1138 bool remote() const override { return false; }
39
henrike@webrtc.org28e20752013-07-10 00:45:3640 virtual const cricket::AudioOptions& options() const { return options_; }
41
tommi6eca7e32015-12-15 12:27:1142 void AddSink(AudioTrackSinkInterface* sink) override {}
43 void RemoveSink(AudioTrackSinkInterface* sink) override {}
henrike@webrtc.org28e20752013-07-10 00:45:3644
tommi6eca7e32015-12-15 12:27:1145 protected:
htaa2a49d92016-03-04 10:51:3946 LocalAudioSource() {}
tommi6eca7e32015-12-15 12:27:1147 ~LocalAudioSource() override {}
henrike@webrtc.org28e20752013-07-10 00:45:3648
49 private:
wu@webrtc.org97077a32013-10-25 21:18:3350 void Initialize(const PeerConnectionFactoryInterface::Options& options,
51 const MediaConstraintsInterface* constraints);
htaa2a49d92016-03-04 10:51:3952 void Initialize(const PeerConnectionFactoryInterface::Options& options,
53 const cricket::AudioOptions* audio_options);
henrike@webrtc.org28e20752013-07-10 00:45:3654
55 cricket::AudioOptions options_;
henrike@webrtc.org28e20752013-07-10 00:45:3656};
57
58} // namespace webrtc
59
Henrik Kjellander15583c12016-02-10 09:53:1260#endif // WEBRTC_API_LOCALAUDIOSOURCE_H_