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_SERVICE_H_ | 5 #ifndef MEDIA_MOJO_SERVICES_MOJO_AUDIO_DECODER_SERVICE_H_ |
6 #define MEDIA_MOJO_SERVICES_MOJO_AUDIO_DECODER_SERVICE_H_ | 6 #define MEDIA_MOJO_SERVICES_MOJO_AUDIO_DECODER_SERVICE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "media/base/audio_decoder.h" | 10 #include "media/base/audio_decoder.h" |
(...skipping 15 matching lines...) Expand all Loading... | |
26 interfaces::AudioDecoderConfigPtr config, | 26 interfaces::AudioDecoderConfigPtr config, |
27 int32_t cdm_id, | 27 int32_t cdm_id, |
28 const InitializeCallback& callback) final; | 28 const InitializeCallback& callback) final; |
29 | 29 |
30 void Decode(interfaces::DecoderBufferPtr buffer, | 30 void Decode(interfaces::DecoderBufferPtr buffer, |
31 const DecodeCallback& callback) final; | 31 const DecodeCallback& callback) final; |
32 | 32 |
33 void Reset(const ResetCallback& callback) final; | 33 void Reset(const ResetCallback& callback) final; |
34 | 34 |
35 private: | 35 private: |
36 // Called by |decoder_| upon finishing initialization. | |
37 void OnInitialized(bool success); | |
38 | |
39 // Called by |decoder_| when DecoderBuffer is accepted or rejected. | |
40 void OnDecodeStatus(media::AudioDecoder::Status status); | |
41 | |
42 // Called by |decoder_| when reset sequence is finished. | |
43 void OnResetDone(); | |
44 | |
45 // Called by |decoder_| for each decoded buffer. | |
46 void OnAudioBufferReady(const scoped_refptr<AudioBuffer>& audio_buffer); | |
47 | |
48 // A helper method to read and deserialize DecoderBuffer from data pipe. | |
49 scoped_refptr<DecoderBuffer> ReadDecoderBuffer( | |
50 interfaces::DecoderBufferPtr buffer); | |
51 | |
36 // A binding represents the association between the service and the | 52 // A binding represents the association between the service and the |
37 // communication channel, i.e. the pipe. | 53 // communication channel, i.e. the pipe. |
38 mojo::StrongBinding<interfaces::AudioDecoder> binding_; | 54 mojo::StrongBinding<interfaces::AudioDecoder> binding_; |
39 | 55 |
40 // The AudioDecoder that does actual decoding work. | 56 // The AudioDecoder that does actual decoding work. |
41 scoped_ptr<media::AudioDecoder> decoder_; | 57 scoped_ptr<media::AudioDecoder> decoder_; |
42 | 58 |
43 // The destination for the decoded buffers. | 59 // The destination for the decoded buffers. |
44 interfaces::AudioDecoderClientPtr client_; | 60 interfaces::AudioDecoderClientPtr client_; |
45 | 61 |
62 // These callbacks sends info to the Mojo client. | |
xhwang
2016/03/18 23:01:13
The |client_| has a special meaning. These callbac
Tima Vaisburd
2016/03/19 03:09:05
These variables got removed, the corresponding cal
| |
63 InitializeCallback initialize_callback_; | |
64 DecodeCallback decode_callback_; | |
65 ResetCallback reset_callback_; | |
66 | |
46 DISALLOW_COPY_AND_ASSIGN(MojoAudioDecoderService); | 67 DISALLOW_COPY_AND_ASSIGN(MojoAudioDecoderService); |
47 }; | 68 }; |
48 | 69 |
49 } // namespace media | 70 } // namespace media |
50 | 71 |
51 #endif // MEDIA_MOJO_SERVICES_MOJO_AUDIO_DECODER_SERVICE_H_ | 72 #endif // MEDIA_MOJO_SERVICES_MOJO_AUDIO_DECODER_SERVICE_H_ |
OLD | NEW |