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_ |