OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MEDIA_MOJO_SERVICES_MOJO_AUDIO_DECODER_SERVICE_H_ |
| 6 #define MEDIA_MOJO_SERVICES_MOJO_AUDIO_DECODER_SERVICE_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "media/mojo/interfaces/audio_decoder.mojom.h" |
| 11 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 12 |
| 13 namespace media { |
| 14 |
| 15 class MojoAudioDecoderService : public interfaces::AudioDecoder { |
| 16 public: |
| 17 MojoAudioDecoderService( |
| 18 scoped_ptr<AudioDecoder> decoder, |
| 19 mojo::InterfaceRequest<interfaces::AudioDecoder> request); |
| 20 |
| 21 ~MojoAudioDecoderService() final; |
| 22 |
| 23 // interfaces::AudioDecoder implementation |
| 24 void Initialize(interfaces::AudioDecoderClientPtr client, |
| 25 interfaces::AudioDecoderConfigPtr config, |
| 26 int32_t cdm_id, |
| 27 const InitializeCallback& callback) final; |
| 28 |
| 29 void Decode(interfaces::DecoderBufferPtr buffer, |
| 30 const DecodeCallback& callback) final; |
| 31 |
| 32 void Reset(const ResetCallback& callback) final; |
| 33 |
| 34 private: |
| 35 // A binding represents the association between the service and the |
| 36 // communication channel, i.e. the pipe. |
| 37 mojo::StrongBinding<interfaces::AudioDecoder> binding_; |
| 38 |
| 39 // The AudioDecoder that does actual decoding work. |
| 40 scoped_ptr<AudioDecoder> decoder_; |
| 41 |
| 42 // The destination for the decoded buffers. |
| 43 interfaces::AudioDecoderClientPtr client_; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(MojoAudioDecoderService); |
| 46 }; |
| 47 |
| 48 } // namespace media |
| 49 |
| 50 #endif // MEDIA_MOJO_SERVICES_MOJO_AUDIO_DECODER_SERVICE_H_ |
OLD | NEW |