| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 class MojoAudioDecoderService : public mojom::AudioDecoder { | 24 class MojoAudioDecoderService : public mojom::AudioDecoder { |
| 25 public: | 25 public: |
| 26 MojoAudioDecoderService( | 26 MojoAudioDecoderService( |
| 27 base::WeakPtr<MojoCdmServiceContext> mojo_cdm_service_context, | 27 base::WeakPtr<MojoCdmServiceContext> mojo_cdm_service_context, |
| 28 std::unique_ptr<media::AudioDecoder> decoder, | 28 std::unique_ptr<media::AudioDecoder> decoder, |
| 29 mojo::InterfaceRequest<mojom::AudioDecoder> request); | 29 mojo::InterfaceRequest<mojom::AudioDecoder> request); |
| 30 | 30 |
| 31 ~MojoAudioDecoderService() final; | 31 ~MojoAudioDecoderService() final; |
| 32 | 32 |
| 33 // mojom::AudioDecoder implementation | 33 // mojom::AudioDecoder implementation |
| 34 void Initialize(mojom::AudioDecoderClientPtr client, | 34 void Initialize(mojom::AudioDecoderClientAssociatedPtrInfo client, |
| 35 mojom::AudioDecoderConfigPtr config, | 35 mojom::AudioDecoderConfigPtr config, |
| 36 int32_t cdm_id, | 36 int32_t cdm_id, |
| 37 const InitializeCallback& callback) final; | 37 const InitializeCallback& callback) final; |
| 38 | 38 |
| 39 void SetDataSource(mojo::ScopedDataPipeConsumerHandle receive_pipe) final; | 39 void SetDataSource(mojo::ScopedDataPipeConsumerHandle receive_pipe) final; |
| 40 | 40 |
| 41 void Decode(mojom::DecoderBufferPtr buffer, | 41 void Decode(mojom::DecoderBufferPtr buffer, |
| 42 const DecodeCallback& callback) final; | 42 const DecodeCallback& callback) final; |
| 43 | 43 |
| 44 void Reset(const ResetCallback& callback) final; | 44 void Reset(const ResetCallback& callback) final; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 65 | 65 |
| 66 std::unique_ptr<MojoDecoderBufferReader> mojo_decoder_buffer_reader_; | 66 std::unique_ptr<MojoDecoderBufferReader> mojo_decoder_buffer_reader_; |
| 67 | 67 |
| 68 // A helper object required to get CDM from CDM id. | 68 // A helper object required to get CDM from CDM id. |
| 69 base::WeakPtr<MojoCdmServiceContext> mojo_cdm_service_context_; | 69 base::WeakPtr<MojoCdmServiceContext> mojo_cdm_service_context_; |
| 70 | 70 |
| 71 // The AudioDecoder that does actual decoding work. | 71 // The AudioDecoder that does actual decoding work. |
| 72 std::unique_ptr<media::AudioDecoder> decoder_; | 72 std::unique_ptr<media::AudioDecoder> decoder_; |
| 73 | 73 |
| 74 // The destination for the decoded buffers. | 74 // The destination for the decoded buffers. |
| 75 mojom::AudioDecoderClientPtr client_; | 75 mojom::AudioDecoderClientAssociatedPtr client_; |
| 76 | 76 |
| 77 // Hold a reference to the CDM to keep it alive for the lifetime of the | 77 // Hold a reference to the CDM to keep it alive for the lifetime of the |
| 78 // |decoder_|. The |cdm_| owns the CdmContext which is passed to |decoder_|. | 78 // |decoder_|. The |cdm_| owns the CdmContext which is passed to |decoder_|. |
| 79 scoped_refptr<MediaKeys> cdm_; | 79 scoped_refptr<MediaKeys> cdm_; |
| 80 | 80 |
| 81 base::WeakPtr<MojoAudioDecoderService> weak_this_; | 81 base::WeakPtr<MojoAudioDecoderService> weak_this_; |
| 82 base::WeakPtrFactory<MojoAudioDecoderService> weak_factory_; | 82 base::WeakPtrFactory<MojoAudioDecoderService> weak_factory_; |
| 83 | 83 |
| 84 DISALLOW_COPY_AND_ASSIGN(MojoAudioDecoderService); | 84 DISALLOW_COPY_AND_ASSIGN(MojoAudioDecoderService); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 } // namespace media | 87 } // namespace media |
| 88 | 88 |
| 89 #endif // MEDIA_MOJO_SERVICES_MOJO_AUDIO_DECODER_SERVICE_H_ | 89 #endif // MEDIA_MOJO_SERVICES_MOJO_AUDIO_DECODER_SERVICE_H_ |
| OLD | NEW |