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

Unified Diff: remoting/protocol/webrtc_audio_sink_adapter.h

Issue 2371323007: Add audio support in WebrtcConnectionToHost, audio unittest (Closed)
Patch Set: more reliable test 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/session_config.cc ('k') | remoting/protocol/webrtc_audio_sink_adapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/webrtc_audio_sink_adapter.h
diff --git a/remoting/protocol/webrtc_audio_sink_adapter.h b/remoting/protocol/webrtc_audio_sink_adapter.h
new file mode 100644
index 0000000000000000000000000000000000000000..4f4969a1809f61c77142efcd51fdeb962216fb3c
--- /dev/null
+++ b/remoting/protocol/webrtc_audio_sink_adapter.h
@@ -0,0 +1,39 @@
+// 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_SINK_ADAPTER_H_
+#define REMOTING_PROTOCOL_WEBRTC_AUDIO_SINK_ADAPTER_H_
+
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "third_party/webrtc/api/mediastreaminterface.h"
+
+namespace remoting {
+namespace protocol {
+
+class AudioStub;
+
+class WebrtcAudioSinkAdapter : public webrtc::AudioTrackSinkInterface {
+ public:
+ WebrtcAudioSinkAdapter(scoped_refptr<webrtc::MediaStreamInterface> stream,
+ base::WeakPtr<AudioStub> audio_stub);
+ ~WebrtcAudioSinkAdapter() override;
+
+ void OnData(const void* audio_data,
+ int bits_per_sample,
+ int sample_rate,
+ size_t number_of_channels,
+ size_t number_of_frames) override;
+
+ private:
+ scoped_refptr<webrtc::MediaStreamInterface> media_stream_;
+ scoped_refptr<webrtc::AudioTrackInterface> audio_track_;
+
+ base::WeakPtr<AudioStub> audio_stub_;
+};
+
+} // namespace protocol
+} // namespace remoting
+
+#endif // REMOTING_PROTOCOL_WEBRTC_AUDIO_SINK_ADAPTER_H_
« no previous file with comments | « remoting/protocol/session_config.cc ('k') | remoting/protocol/webrtc_audio_sink_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698