OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_MOJO_SERVICES_MOJO_AUDIO_DECODER_H_ | 5 #ifndef MEDIA_MOJO_SERVICES_MOJO_AUDIO_DECODER_H_ |
6 #define MEDIA_MOJO_SERVICES_MOJO_AUDIO_DECODER_H_ | 6 #define MEDIA_MOJO_SERVICES_MOJO_AUDIO_DECODER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "media/base/audio_decoder.h" | 10 #include "media/base/audio_decoder.h" |
11 #include "media/mojo/interfaces/audio_decoder.mojom.h" | 11 #include "media/mojo/interfaces/audio_decoder.mojom.h" |
| 12 #include "media/mojo/interfaces/media_types.mojom.h" |
12 #include "mojo/public/cpp/bindings/binding.h" | 13 #include "mojo/public/cpp/bindings/binding.h" |
13 #include "mojo/public/cpp/system/data_pipe.h" | 14 #include "mojo/public/cpp/system/data_pipe.h" |
14 | 15 |
15 namespace base { | 16 namespace base { |
16 class SingleThreadTaskRunner; | 17 class SingleThreadTaskRunner; |
17 } | 18 } |
18 | 19 |
19 namespace media { | 20 namespace media { |
20 | 21 |
21 // An AudioDecoder that proxies to a mojom::AudioDecoder. | 22 // An AudioDecoder that proxies to a mojom::AudioDecoder. |
(...skipping 18 matching lines...) Expand all Loading... |
40 void OnBufferDecoded(mojom::AudioBufferPtr buffer) final; | 41 void OnBufferDecoded(mojom::AudioBufferPtr buffer) final; |
41 | 42 |
42 private: | 43 private: |
43 // Callback for connection error on |remote_decoder_|. | 44 // Callback for connection error on |remote_decoder_|. |
44 void OnConnectionError(); | 45 void OnConnectionError(); |
45 | 46 |
46 // Called when |remote_decoder_| finished initialization. | 47 // Called when |remote_decoder_| finished initialization. |
47 void OnInitialized(bool success, bool needs_bitstream_conversion); | 48 void OnInitialized(bool success, bool needs_bitstream_conversion); |
48 | 49 |
49 // Called when |remote_decoder_| accepted or rejected DecoderBuffer. | 50 // Called when |remote_decoder_| accepted or rejected DecoderBuffer. |
50 void OnDecodeStatus(mojom::AudioDecoder::DecodeStatus decode_status); | 51 void OnDecodeStatus(mojom::DecodeStatus decode_status); |
51 | 52 |
52 // called when |remote_decoder_| finished Reset() sequence. | 53 // called when |remote_decoder_| finished Reset() sequence. |
53 void OnResetDone(); | 54 void OnResetDone(); |
54 | 55 |
55 // A helper method that creates data pipe and sets the data connection to | 56 // A helper method that creates data pipe and sets the data connection to |
56 // the service. | 57 // the service. |
57 void CreateDataPipe(); | 58 void CreateDataPipe(); |
58 | 59 |
59 // A helper method to serialize the data section of DecoderBuffer into pipe. | 60 // A helper method to serialize the data section of DecoderBuffer into pipe. |
60 mojom::DecoderBufferPtr TransferDecoderBuffer( | 61 mojom::DecoderBufferPtr TransferDecoderBuffer( |
(...skipping 29 matching lines...) Expand all Loading... |
90 // Flag telling whether this decoder requires bitstream conversion. | 91 // Flag telling whether this decoder requires bitstream conversion. |
91 // Passed from |remote_decoder_| as a result of its initialization. | 92 // Passed from |remote_decoder_| as a result of its initialization. |
92 bool needs_bitstream_conversion_; | 93 bool needs_bitstream_conversion_; |
93 | 94 |
94 DISALLOW_COPY_AND_ASSIGN(MojoAudioDecoder); | 95 DISALLOW_COPY_AND_ASSIGN(MojoAudioDecoder); |
95 }; | 96 }; |
96 | 97 |
97 } // namespace media | 98 } // namespace media |
98 | 99 |
99 #endif // MEDIA_MOJO_SERVICES_MOJO_AUDIO_DECODER_H_ | 100 #endif // MEDIA_MOJO_SERVICES_MOJO_AUDIO_DECODER_H_ |
OLD | NEW |