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

Side by Side Diff: content/common/gpu/media/gpu_video_decode_accelerator.h

Issue 1656433002: Sample code: IPC Transport object for GPU Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: GpuMemoryBufferService + Transport object. TODO: Eliminate ChildThreadImpl dependency Created 4 years, 10 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ 5 #ifndef CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_
6 #define CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ 6 #define CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "base/memory/shared_memory.h" 16 #include "base/memory/shared_memory.h"
17 #include "base/synchronization/waitable_event.h" 17 #include "base/synchronization/waitable_event.h"
18 #include "content/common/gpu/gpu_command_buffer_stub.h" 18 #include "content/common/gpu/gpu_command_buffer_stub.h"
19 #include "gpu/command_buffer/service/texture_manager.h" 19 #include "gpu/command_buffer/service/texture_manager.h"
20 #include "gpu/config/gpu_info.h" 20 #include "gpu/config/gpu_info.h"
21 #include "ipc/ipc_listener.h" 21 #include "ipc/ipc_listener.h"
22 #include "ipc/ipc_sender.h" 22 #include "ipc/ipc_sender.h"
23 #include "media/video/video_decode_accelerator.h" 23 #include "media/video/video_decode_accelerator.h"
24 #include "ui/gfx/geometry/size.h" 24 #include "ui/gfx/geometry/size.h"
25 25
26 struct AcceleratedVideoDecoderMsg_Decode_Params; 26 namespace content {
27 27
28 namespace content { 28 struct VideoDecodeParams;
29 29
30 class GpuVideoDecodeAccelerator 30 class GpuVideoDecodeAccelerator
31 : public IPC::Listener, 31 : public IPC::Listener,
32 public IPC::Sender, 32 public IPC::Sender,
33 public media::VideoDecodeAccelerator::Client, 33 public media::VideoDecodeAccelerator::Client,
34 public GpuCommandBufferStub::DestructionObserver { 34 public GpuCommandBufferStub::DestructionObserver {
35 public: 35 public:
36 // Each of the arguments to the constructor must outlive this object. 36 // Each of the arguments to the constructor must outlive this object.
37 // |stub->decoder()| will be made current around any operation that touches 37 // |stub->decoder()| will be made current around any operation that touches
38 // the underlying VDA so that it can make GL calls safely. 38 // the underlying VDA so that it can make GL calls safely.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 scoped_ptr<media::VideoDecodeAccelerator> CreateVaapiVDA(); 86 scoped_ptr<media::VideoDecodeAccelerator> CreateVaapiVDA();
87 scoped_ptr<media::VideoDecodeAccelerator> CreateVTVDA(); 87 scoped_ptr<media::VideoDecodeAccelerator> CreateVTVDA();
88 scoped_ptr<media::VideoDecodeAccelerator> CreateOzoneVDA(); 88 scoped_ptr<media::VideoDecodeAccelerator> CreateOzoneVDA();
89 scoped_ptr<media::VideoDecodeAccelerator> CreateAndroidVDA(); 89 scoped_ptr<media::VideoDecodeAccelerator> CreateAndroidVDA();
90 90
91 // We only allow self-delete, from OnWillDestroyStub(), after cleanup there. 91 // We only allow self-delete, from OnWillDestroyStub(), after cleanup there.
92 ~GpuVideoDecodeAccelerator() override; 92 ~GpuVideoDecodeAccelerator() override;
93 93
94 // Handlers for IPC messages. 94 // Handlers for IPC messages.
95 void OnSetCdm(int cdm_id); 95 void OnSetCdm(int cdm_id);
96 void OnDecode(const AcceleratedVideoDecoderMsg_Decode_Params& params); 96 void OnDecode(const VideoDecodeParams& params);
97 void OnAssignPictureBuffers(const std::vector<int32_t>& buffer_ids, 97 void OnAssignPictureBuffers(const std::vector<int32_t>& buffer_ids,
98 const std::vector<uint32_t>& texture_ids); 98 const std::vector<uint32_t>& texture_ids);
99 void OnReusePictureBuffer(int32_t picture_buffer_id); 99 void OnReusePictureBuffer(int32_t picture_buffer_id);
100 void OnFlush(); 100 void OnFlush();
101 void OnReset(); 101 void OnReset();
102 void OnDestroy(); 102 void OnDestroy();
103 103
104 // Called on IO thread when |filter_| has been removed. 104 // Called on IO thread when |filter_| has been removed.
105 void OnFilterRemoved(); 105 void OnFilterRemoved();
106 106
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 159
160 // A map from picture buffer ID to TextureRef that have not been cleared. 160 // A map from picture buffer ID to TextureRef that have not been cleared.
161 std::map<int32_t, scoped_refptr<gpu::gles2::TextureRef>> uncleared_textures_; 161 std::map<int32_t, scoped_refptr<gpu::gles2::TextureRef>> uncleared_textures_;
162 162
163 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); 163 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator);
164 }; 164 };
165 165
166 } // namespace content 166 } // namespace content
167 167
168 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ 168 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW
« no previous file with comments | « content/common/gpu/media/gpu_jpeg_decode_accelerator.cc ('k') | content/common/gpu/media/gpu_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698