Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Unified Diff: remoting/protocol/webrtc_audio_source_adapter.h

Issue 2392963003: Add Audio support in Chromoting host when using WebRTC. (Closed)
Patch Set: . Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/fake_audio_source.cc ('k') | remoting/protocol/webrtc_audio_source_adapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/webrtc_audio_source_adapter.h
diff --git a/remoting/protocol/webrtc_audio_source_adapter.h b/remoting/protocol/webrtc_audio_source_adapter.h
new file mode 100644
index 0000000000000000000000000000000000000000..9c488c2ae594660740ce6b31cb631b2f2b605973
--- /dev/null
+++ b/remoting/protocol/webrtc_audio_source_adapter.h
@@ -0,0 +1,61 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_PROTOCOL_WEBRTC_AUDIO_SOURCE_ADAPTER_H_
+#define REMOTING_PROTOCOL_WEBRTC_AUDIO_SOURCE_ADAPTER_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "base/observer_list.h"
+#include "third_party/webrtc/api/mediastreaminterface.h"
+
+namespace webrtc {
+class AudioTrackSinkInterface;
+} // namespace webrtc
+
+namespace remoting {
+
+class AudioPacket;
+
+namespace protocol {
+
+class AudioSource;
+
+class WebrtcAudioSourceAdapter : public webrtc::AudioSourceInterface {
+ public:
+ explicit WebrtcAudioSourceAdapter(
+ scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner);
+ ~WebrtcAudioSourceAdapter() override;
+
+ void Start(std::unique_ptr<AudioSource> audio_source);
+ void Pause(bool pause);
+
+ // webrtc::AudioSourceInterface implementation.
+ SourceState state() const override;
+ bool remote() const override;
+ void RegisterAudioObserver(AudioObserver* observer) override;
+ void UnregisterAudioObserver(AudioObserver* observer) override;
+ void AddSink(webrtc::AudioTrackSinkInterface* sink) override;
+ void RemoveSink(webrtc::AudioTrackSinkInterface* sink) override;
+
+ // webrtc::NotifierInterface implementation.
+ void RegisterObserver(webrtc::ObserverInterface* observer) override;
+ void UnregisterObserver(webrtc::ObserverInterface* observer) override;
+
+ private:
+ class Core;
+
+ scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_;
+
+ // Core running on |audio_task_runner_|.
+ std::unique_ptr<Core> core_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebrtcAudioSourceAdapter);
+};
+
+} // namespace protocol
+} // namespace remoting
+
+#endif // REMOTING_PROTOCOL_WEBRTC_AUDIO_SOURCE_ADAPTER_H_
« no previous file with comments | « remoting/protocol/fake_audio_source.cc ('k') | remoting/protocol/webrtc_audio_source_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698