local_audio_source.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright 2012 The WebRTC project authors. All Rights Reserved.
  3. *
  4. * 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.
  9. */
  10. #ifndef PC_LOCAL_AUDIO_SOURCE_H_
  11. #define PC_LOCAL_AUDIO_SOURCE_H_
  12. #include "api/audio_options.h"
  13. #include "api/media_stream_interface.h"
  14. #include "api/notifier.h"
  15. #include "api/scoped_refptr.h"
  16. // LocalAudioSource implements AudioSourceInterface.
  17. // This contains settings for switching audio processing on and off.
  18. namespace webrtc {
  19. class LocalAudioSource : public Notifier<AudioSourceInterface> {
  20. public:
  21. // Creates an instance of LocalAudioSource.
  22. static rtc::scoped_refptr<LocalAudioSource> Create(
  23. const cricket::AudioOptions* audio_options);
  24. SourceState state() const override { return kLive; }
  25. bool remote() const override { return false; }
  26. const cricket::AudioOptions options() const override { return options_; }
  27. void AddSink(AudioTrackSinkInterface* sink) override {}
  28. void RemoveSink(AudioTrackSinkInterface* sink) override {}
  29. protected:
  30. LocalAudioSource() {}
  31. ~LocalAudioSource() override {}
  32. private:
  33. void Initialize(const cricket::AudioOptions* audio_options);
  34. cricket::AudioOptions options_;
  35. };
  36. } // namespace webrtc
  37. #endif // PC_LOCAL_AUDIO_SOURCE_H_