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. | |
Henrik Grunell
2016/05/20 13:35:40
Same here as my comment in AudioOutputImpl.
| |
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 media::mojom::AudioOutputStream { | |
25 public: | |
26 AudioOutputStreamImpl(media::mojom::AudioOutputStreamRequest request, | |
tommi (sloooow) - chröme
2016/05/20 13:26:13
by value on purpose?
| |
27 int stream_id, | |
28 int renderer_frame_id, | |
29 AudioRendererHost* audio_renderer_host); | |
30 | |
31 ~AudioOutputStreamImpl() override; | |
32 | |
33 int get_stream_id() const { return stream_id_; } | |
34 | |
35 private: | |
36 FRIEND_TEST_ALL_PREFIXES(AudioOutputStreamImplTest, Close); | |
37 // AudioOutputStream interface implementation. | |
Henrik Grunell
2016/05/20 13:35:40
Nit: empty line before.
rchtara
2016/05/27 15:24:37
Done.
| |
38 void Close() override; | |
39 | |
40 mojo::Binding<media::mojom::AudioOutputStream> binding_; | |
41 int stream_id_; | |
tommi (sloooow) - chröme
2016/05/20 13:26:12
can this be made const?
rchtara
2016/05/27 15:24:37
Done.
| |
42 int renderer_frame_id_; | |
tommi (sloooow) - chröme
2016/05/20 13:26:13
and this?
rchtara
2016/05/27 15:24:37
that one is not needed
| |
43 // AudioRendererHost is ref counted and AudioOutputImpl holds a reference to | |
44 // it. And because all AudioOutputStreamImpl instances will be owned by | |
45 // AudioOutputImpl too, it's safe to access AudioRendererHost from | |
46 // AudioOutputStreamImpl. | |
47 // The only issue that could happen is during AudioOutputStreamImpl | |
Henrik Grunell
2016/05/20 13:35:40
How can that be an issue?
rchtara
2016/05/27 15:24:37
outdated comment
| |
48 // destructor. AudioRendererHost cannot access from there. | |
49 AudioRendererHost* audio_renderer_host_; | |
tommi (sloooow) - chröme
2016/05/20 13:26:12
and this?
(i.e. AudioRendererHost* const audio_re
rchtara
2016/05/27 15:24:37
Done.
| |
50 }; | |
51 | |
52 class CONTENT_EXPORT AudioOutputStreamFactory { | |
tommi (sloooow) - chröme
2016/05/20 13:26:12
mark the default ctor as delete?
Why does this ne
rchtara
2016/05/27 15:24:37
this was needed for the old version tests, but it'
| |
53 public: | |
54 static AudioOutputStreamImpl* Factory( | |
Henrik Grunell
2016/05/20 13:35:40
Put this function in AudioOutputStreamImpl and nam
rchtara
2016/05/27 15:24:37
not needed anymore
| |
55 media::mojom::AudioOutputStreamRequest request, | |
56 int stream_id, | |
57 int renderer_frame_id, | |
58 AudioRendererHost* audio_renderer_host); | |
59 }; | |
60 | |
61 } // namespace content | |
62 | |
63 #endif // CONTENT_BROWSER_MEDIA_AUDIO_OUTPUT_STREAM_IMPL_H_ | |
OLD | NEW |