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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef REMOTING_PROTOCOL_WEBRTC_AUDIO_SOURCE_ADAPTER_H_
6 #define REMOTING_PROTOCOL_WEBRTC_AUDIO_SOURCE_ADAPTER_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "base/observer_list.h"
12 #include "third_party/webrtc/api/mediastreaminterface.h"
13
14 namespace webrtc {
15 class AudioTrackSinkInterface;
16 } // namespace webrtc
17
18 namespace remoting {
19
20 class AudioPacket;
21
22 namespace protocol {
23
24 class AudioSource;
25
26 class WebrtcAudioSourceAdapter : public webrtc::AudioSourceInterface {
27 public:
28 explicit WebrtcAudioSourceAdapter(
29 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner);
30 ~WebrtcAudioSourceAdapter() override;
31
32 void Start(std::unique_ptr<AudioSource> audio_source);
33 void Pause(bool pause);
34
35 // webrtc::AudioSourceInterface implementation.
36 SourceState state() const override;
37 bool remote() const override;
38 void RegisterAudioObserver(AudioObserver* observer) override;
39 void UnregisterAudioObserver(AudioObserver* observer) override;
40 void AddSink(webrtc::AudioTrackSinkInterface* sink) override;
41 void RemoveSink(webrtc::AudioTrackSinkInterface* sink) override;
42
43 // webrtc::NotifierInterface implementation.
44 void RegisterObserver(webrtc::ObserverInterface* observer) override;
45 void UnregisterObserver(webrtc::ObserverInterface* observer) override;
46
47 private:
48 class Core;
49
50 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_;
51
52 // Core running on |audio_task_runner_|.
53 std::unique_ptr<Core> core_;
54
55 DISALLOW_COPY_AND_ASSIGN(WebrtcAudioSourceAdapter);
56 };
57
58 } // namespace protocol
59 } // namespace remoting
60
61 #endif // REMOTING_PROTOCOL_WEBRTC_AUDIO_SOURCE_ADAPTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698