Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: media/mojo/services/mojo_video_decoder_service.h

Issue 1899363002: Finish plumbing MojoVideoDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_VIDEO_DECODER_SERVICE_H_
6 #define MEDIA_MOJO_SERVICES_MOJO_VIDEO_DECODER_SERVICE_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "base/memory/weak_ptr.h"
12 #include "media/mojo/interfaces/video_decoder.mojom.h"
13 #include "mojo/public/cpp/bindings/strong_binding.h"
14 #include "mojo/public/cpp/system/data_pipe.h"
15
16 namespace media {
17
18 class MojoMediaClient;
19 class VideoDecoder;
20
21 class MojoVideoDecoderService : public interfaces::VideoDecoder {
22 public:
23 MojoVideoDecoderService(
24 mojo::InterfaceRequest<interfaces::VideoDecoder> request,
25 MojoMediaClient* mojo_media_client);
26 ~MojoVideoDecoderService() final;
27
28 // interfaces::VideoDecoder implementation
29 void Initialize(
30 interfaces::VideoDecoderClientPtr client,
31 mojo::ScopedDataPipeConsumerHandle decoder_buffer_consumer) final;
32 void Configure(interfaces::VideoDecoderConfigPtr config,
33 bool low_delay,
34 const ConfigureCallback& callback) final;
35 void Decode(interfaces::DecoderBufferPtr buffer,
36 const DecodeCallback& callback) final;
37 void Reset(const ResetCallback& callback) final;
38
39 private:
40 mojo::StrongBinding<interfaces::VideoDecoder> binding_;
41 interfaces::VideoDecoderClientPtr client_;
42 mojo::ScopedDataPipeConsumerHandle decoder_buffer_consumer_;
43
44 MojoMediaClient* mojo_media_client_;
45 std::unique_ptr<media::VideoDecoder> decoder_;
46
47 base::WeakPtr<MojoVideoDecoderService> weak_this_;
48 base::WeakPtrFactory<MojoVideoDecoderService> weak_factory_;
49
50 DISALLOW_COPY_AND_ASSIGN(MojoVideoDecoderService);
51 };
52
53 } // namespace media
54
55 #endif // MEDIA_MOJO_SERVICES_MOJO_VIDEO_DECODER_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698