| Index: media/mojo/services/mojo_video_decoder_service.h
|
| diff --git a/media/mojo/services/mojo_video_decoder_service.h b/media/mojo/services/mojo_video_decoder_service.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ee08b1c0c47aeb2a0260467ad6e1fa2f979a7440
|
| --- /dev/null
|
| +++ b/media/mojo/services/mojo_video_decoder_service.h
|
| @@ -0,0 +1,55 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef MEDIA_MOJO_SERVICES_MOJO_VIDEO_DECODER_SERVICE_H_
|
| +#define MEDIA_MOJO_SERVICES_MOJO_VIDEO_DECODER_SERVICE_H_
|
| +
|
| +#include <memory>
|
| +
|
| +#include "base/macros.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "media/mojo/interfaces/video_decoder.mojom.h"
|
| +#include "mojo/public/cpp/bindings/strong_binding.h"
|
| +#include "mojo/public/cpp/system/data_pipe.h"
|
| +
|
| +namespace media {
|
| +
|
| +class MojoMediaClient;
|
| +class VideoDecoder;
|
| +
|
| +class MojoVideoDecoderService : public interfaces::VideoDecoder {
|
| + public:
|
| + MojoVideoDecoderService(
|
| + mojo::InterfaceRequest<interfaces::VideoDecoder> request,
|
| + MojoMediaClient* mojo_media_client);
|
| + ~MojoVideoDecoderService() final;
|
| +
|
| + // interfaces::VideoDecoder implementation
|
| + void Initialize(
|
| + interfaces::VideoDecoderClientPtr client,
|
| + mojo::ScopedDataPipeConsumerHandle decoder_buffer_consumer) final;
|
| + void Configure(interfaces::VideoDecoderConfigPtr config,
|
| + bool low_delay,
|
| + const ConfigureCallback& callback) final;
|
| + void Decode(interfaces::DecoderBufferPtr buffer,
|
| + const DecodeCallback& callback) final;
|
| + void Reset(const ResetCallback& callback) final;
|
| +
|
| + private:
|
| + mojo::StrongBinding<interfaces::VideoDecoder> binding_;
|
| + interfaces::VideoDecoderClientPtr client_;
|
| + mojo::ScopedDataPipeConsumerHandle decoder_buffer_consumer_;
|
| +
|
| + MojoMediaClient* mojo_media_client_;
|
| + std::unique_ptr<media::VideoDecoder> decoder_;
|
| +
|
| + base::WeakPtr<MojoVideoDecoderService> weak_this_;
|
| + base::WeakPtrFactory<MojoVideoDecoderService> weak_factory_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(MojoVideoDecoderService);
|
| +};
|
| +
|
| +} // namespace media
|
| +
|
| +#endif // MEDIA_MOJO_SERVICES_MOJO_VIDEO_DECODER_SERVICE_H_
|
|
|