| 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 "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 void Reset(const ResetCallback& callback) final; | 41 void Reset(const ResetCallback& callback) final; |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 // Called by |decoder_| upon finishing initialization. | 44 // Called by |decoder_| upon finishing initialization. |
| 45 void OnInitialized(const InitializeCallback& callback, | 45 void OnInitialized(const InitializeCallback& callback, |
| 46 scoped_refptr<MediaKeys> cdm, | 46 scoped_refptr<MediaKeys> cdm, |
| 47 bool success); | 47 bool success); |
| 48 | 48 |
| 49 // Called by |decoder_| when DecoderBuffer is accepted or rejected. | 49 // Called by |decoder_| when DecoderBuffer is accepted or rejected. |
| 50 void OnDecodeStatus(const DecodeCallback& callback, | 50 void OnDecodeStatus(const DecodeCallback& callback, |
| 51 media::AudioDecoder::Status status); | 51 media::DecodeStatus status); |
| 52 | 52 |
| 53 // Called by |decoder_| when reset sequence is finished. | 53 // Called by |decoder_| when reset sequence is finished. |
| 54 void OnResetDone(const ResetCallback& callback); | 54 void OnResetDone(const ResetCallback& callback); |
| 55 | 55 |
| 56 // Called by |decoder_| for each decoded buffer. | 56 // Called by |decoder_| for each decoded buffer. |
| 57 void OnAudioBufferReady(const scoped_refptr<AudioBuffer>& audio_buffer); | 57 void OnAudioBufferReady(const scoped_refptr<AudioBuffer>& audio_buffer); |
| 58 | 58 |
| 59 // A helper method to read and deserialize DecoderBuffer from data pipe. | 59 // A helper method to read and deserialize DecoderBuffer from data pipe. |
| 60 scoped_refptr<DecoderBuffer> ReadDecoderBuffer( | 60 scoped_refptr<DecoderBuffer> ReadDecoderBuffer( |
| 61 interfaces::DecoderBufferPtr buffer); | 61 interfaces::DecoderBufferPtr buffer); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 82 | 82 |
| 83 base::WeakPtr<MojoAudioDecoderService> weak_this_; | 83 base::WeakPtr<MojoAudioDecoderService> weak_this_; |
| 84 base::WeakPtrFactory<MojoAudioDecoderService> weak_factory_; | 84 base::WeakPtrFactory<MojoAudioDecoderService> weak_factory_; |
| 85 | 85 |
| 86 DISALLOW_COPY_AND_ASSIGN(MojoAudioDecoderService); | 86 DISALLOW_COPY_AND_ASSIGN(MojoAudioDecoderService); |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 } // namespace media | 89 } // namespace media |
| 90 | 90 |
| 91 #endif // MEDIA_MOJO_SERVICES_MOJO_AUDIO_DECODER_SERVICE_H_ | 91 #endif // MEDIA_MOJO_SERVICES_MOJO_AUDIO_DECODER_SERVICE_H_ |
| OLD | NEW |