| 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_CLIENTS_MOJO_AUDIO_DECODER_H_ | 5 #ifndef MEDIA_MOJO_CLIENTS_MOJO_AUDIO_DECODER_H_ |
| 6 #define MEDIA_MOJO_CLIENTS_MOJO_AUDIO_DECODER_H_ | 6 #define MEDIA_MOJO_CLIENTS_MOJO_AUDIO_DECODER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 const OutputCB& output_cb) final; | 38 const OutputCB& output_cb) final; |
| 39 void Decode(const scoped_refptr<DecoderBuffer>& buffer, | 39 void Decode(const scoped_refptr<DecoderBuffer>& buffer, |
| 40 const DecodeCB& decode_cb) final; | 40 const DecodeCB& decode_cb) final; |
| 41 void Reset(const base::Closure& closure) final; | 41 void Reset(const base::Closure& closure) final; |
| 42 bool NeedsBitstreamConversion() const final; | 42 bool NeedsBitstreamConversion() const final; |
| 43 | 43 |
| 44 // AudioDecoderClient implementation. | 44 // AudioDecoderClient implementation. |
| 45 void OnBufferDecoded(mojom::AudioBufferPtr buffer) final; | 45 void OnBufferDecoded(mojom::AudioBufferPtr buffer) final; |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 void BindRemoteDecoder(); |
| 49 |
| 48 // Callback for connection error on |remote_decoder_|. | 50 // Callback for connection error on |remote_decoder_|. |
| 49 void OnConnectionError(); | 51 void OnConnectionError(); |
| 50 | 52 |
| 51 // Called when |remote_decoder_| finished initialization. | 53 // Called when |remote_decoder_| finished initialization. |
| 52 void OnInitialized(bool success, bool needs_bitstream_conversion); | 54 void OnInitialized(bool success, bool needs_bitstream_conversion); |
| 53 | 55 |
| 54 // Called when |remote_decoder_| accepted or rejected DecoderBuffer. | 56 // Called when |remote_decoder_| accepted or rejected DecoderBuffer. |
| 55 void OnDecodeStatus(DecodeStatus decode_status); | 57 void OnDecodeStatus(DecodeStatus decode_status); |
| 56 | 58 |
| 57 // called when |remote_decoder_| finished Reset() sequence. | 59 // called when |remote_decoder_| finished Reset() sequence. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 73 mojo::AssociatedBinding<AudioDecoderClient> client_binding_; | 75 mojo::AssociatedBinding<AudioDecoderClient> client_binding_; |
| 74 | 76 |
| 75 // We call the following callbacks to pass the information to the pipeline. | 77 // We call the following callbacks to pass the information to the pipeline. |
| 76 // |output_cb_| is permanent while other three are called only once, | 78 // |output_cb_| is permanent while other three are called only once, |
| 77 // |decode_cb_| and |reset_cb_| are replaced by every by Decode() and Reset(). | 79 // |decode_cb_| and |reset_cb_| are replaced by every by Decode() and Reset(). |
| 78 InitCB init_cb_; | 80 InitCB init_cb_; |
| 79 OutputCB output_cb_; | 81 OutputCB output_cb_; |
| 80 DecodeCB decode_cb_; | 82 DecodeCB decode_cb_; |
| 81 base::Closure reset_cb_; | 83 base::Closure reset_cb_; |
| 82 | 84 |
| 85 bool remote_decoder_bound_ = false; |
| 86 |
| 83 // Flag that is set if we got connection error. Never cleared. | 87 // Flag that is set if we got connection error. Never cleared. |
| 84 bool has_connection_error_; | 88 bool has_connection_error_ = false; |
| 85 | 89 |
| 86 // Flag telling whether this decoder requires bitstream conversion. | 90 // Flag telling whether this decoder requires bitstream conversion. |
| 87 // Passed from |remote_decoder_| as a result of its initialization. | 91 // Passed from |remote_decoder_| as a result of its initialization. |
| 88 bool needs_bitstream_conversion_; | 92 bool needs_bitstream_conversion_ = false; |
| 89 | 93 |
| 90 DISALLOW_COPY_AND_ASSIGN(MojoAudioDecoder); | 94 DISALLOW_COPY_AND_ASSIGN(MojoAudioDecoder); |
| 91 }; | 95 }; |
| 92 | 96 |
| 93 } // namespace media | 97 } // namespace media |
| 94 | 98 |
| 95 #endif // MEDIA_MOJO_CLIENTS_MOJO_AUDIO_DECODER_H_ | 99 #endif // MEDIA_MOJO_CLIENTS_MOJO_AUDIO_DECODER_H_ |
| OLD | NEW |