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

Side by Side Diff: media/mojo/clients/mojo_video_decoder.h

Issue 2096063003: media: Add MojoDecoderBuffer{Reader|Writer} (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 4 years, 5 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
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_VIDEO_DECODER_H_ 5 #ifndef MEDIA_MOJO_CLIENTS_MOJO_VIDEO_DECODER_H_
6 #define MEDIA_MOJO_CLIENTS_MOJO_VIDEO_DECODER_H_ 6 #define MEDIA_MOJO_CLIENTS_MOJO_VIDEO_DECODER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "media/base/video_decoder.h" 10 #include "media/base/video_decoder.h"
11 #include "media/mojo/interfaces/video_decoder.mojom.h" 11 #include "media/mojo/interfaces/video_decoder.mojom.h"
12 #include "mojo/public/cpp/bindings/binding.h" 12 #include "mojo/public/cpp/bindings/binding.h"
13 #include "mojo/public/cpp/system/data_pipe.h"
14 13
15 namespace base { 14 namespace base {
16 class SingleThreadTaskRunner; 15 class SingleThreadTaskRunner;
17 } 16 }
18 17
19 namespace media { 18 namespace media {
20 19
21 class GpuVideoAcceleratorFactories; 20 class GpuVideoAcceleratorFactories;
21 class MojoDecoderBufferWriter;
22 22
23 // A VideoDecoder, for use in the renderer process, that proxies to a 23 // A VideoDecoder, for use in the renderer process, that proxies to a
24 // mojom::VideoDecoder. It is assumed that the other side will be implemented by 24 // mojom::VideoDecoder. It is assumed that the other side will be implemented by
25 // MojoVideoDecoderService, running in the GPU process, and that the remote 25 // MojoVideoDecoderService, running in the GPU process, and that the remote
26 // decoder will be hardware accelerated. 26 // decoder will be hardware accelerated.
27 class MojoVideoDecoder final : public VideoDecoder, 27 class MojoVideoDecoder final : public VideoDecoder,
28 public mojom::VideoDecoderClient { 28 public mojom::VideoDecoderClient {
29 public: 29 public:
30 MojoVideoDecoder(scoped_refptr<base::SingleThreadTaskRunner> task_runner, 30 MojoVideoDecoder(scoped_refptr<base::SingleThreadTaskRunner> task_runner,
31 GpuVideoAcceleratorFactories* gpu_factories, 31 GpuVideoAcceleratorFactories* gpu_factories,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // Used to pass the remote decoder from the constructor (on the main thread) 63 // Used to pass the remote decoder from the constructor (on the main thread)
64 // to Initialize() (on the media thread). 64 // to Initialize() (on the media thread).
65 mojom::VideoDecoderPtrInfo remote_decoder_info_; 65 mojom::VideoDecoderPtrInfo remote_decoder_info_;
66 66
67 InitCB init_cb_; 67 InitCB init_cb_;
68 OutputCB output_cb_; 68 OutputCB output_cb_;
69 DecodeCB decode_cb_; 69 DecodeCB decode_cb_;
70 base::Closure reset_cb_; 70 base::Closure reset_cb_;
71 71
72 mojom::VideoDecoderPtr remote_decoder_; 72 mojom::VideoDecoderPtr remote_decoder_;
73 mojo::ScopedDataPipeProducerHandle decoder_buffer_pipe_; 73 std::unique_ptr<MojoDecoderBufferWriter> mojo_decoder_buffer_writer_;
74 bool remote_decoder_bound_ = false; 74 bool remote_decoder_bound_ = false;
75 bool has_connection_error_ = false; 75 bool has_connection_error_ = false;
76 mojo::Binding<VideoDecoderClient> binding_; 76 mojo::Binding<VideoDecoderClient> binding_;
77 77
78 DISALLOW_COPY_AND_ASSIGN(MojoVideoDecoder); 78 DISALLOW_COPY_AND_ASSIGN(MojoVideoDecoder);
79 }; 79 };
80 80
81 } // namespace media 81 } // namespace media
82 82
83 #endif // MEDIA_MOJO_CLIENTS_MOJO_VIDEO_DECODER_H_ 83 #endif // MEDIA_MOJO_CLIENTS_MOJO_VIDEO_DECODER_H_
OLDNEW
« no previous file with comments | « media/mojo/clients/mojo_demuxer_stream_impl.cc ('k') | media/mojo/clients/mojo_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698