OLD | NEW |
(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 CONTENT_BROWSER_MEDIA_AUDIO_OUTPUT_STREAM_IMPL_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_AUDIO_OUTPUT_STREAM_IMPL_H_ |
| 7 |
| 8 #include "base/callback.h" |
| 9 #include "content/browser/media/audio_output_impl.h" |
| 10 #include "content/browser/renderer_host/media/audio_renderer_host.h" |
| 11 #include "content/common/content_export.h" |
| 12 #include "media/mojo/interfaces/audio_output.mojom.h" |
| 13 #include "mojo/public/cpp/bindings/interface_request.h" |
| 14 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 15 |
| 16 namespace content { |
| 17 |
| 18 // This class implements AudioOutputStream Mojo interface. It will be used |
| 19 // by the AudioOutputClient to perform operations on audio output streams. |
| 20 // AudioOutputClient will perform operations remotely on the |
| 21 // AudioOutputStreamPtr and Mojo will transfer them to AudioOutputStreamImpl. |
| 22 // Owned by AudioOutputImpl. |
| 23 class CONTENT_EXPORT AudioOutputStreamImpl |
| 24 : public NON_EXPORTED_BASE(media::mojom::AudioOutputStream) { |
| 25 public: |
| 26 AudioOutputStreamImpl(int stream_id, |
| 27 AudioOutputImpl* audio_output_impl, |
| 28 media::mojom::AudioOutputStreamRequest request); |
| 29 |
| 30 ~AudioOutputStreamImpl() override; |
| 31 |
| 32 int stream_id() const { return stream_id_; } |
| 33 |
| 34 private: |
| 35 FRIEND_TEST_ALL_PREFIXES(AudioOutputStreamImplTest, Close); |
| 36 |
| 37 // AudioOutputStream interface implementation. |
| 38 void Close() override; |
| 39 |
| 40 const int stream_id_; |
| 41 |
| 42 AudioOutputImpl* audio_output_impl_; |
| 43 // Callback for media::mojom::AudioOutput::CreateStream. |
| 44 media::mojom::AudioOutput::CreateStreamCallback create_stream_callback_; |
| 45 std::unique_ptr<mojo::Binding<AudioOutputStream>> binding_; |
| 46 media::mojom::AudioOutputStreamPtr stream_ptr_; |
| 47 }; |
| 48 |
| 49 } // namespace content |
| 50 |
| 51 #endif // CONTENT_BROWSER_MEDIA_AUDIO_OUTPUT_STREAM_IMPL_H_ |
OLD | NEW |