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

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

Issue 24762003: Set the texture to cleared in VideoDecodeAccelerator::PictureReady. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: refactor SendPictureReady by kcwu's suggestion Created 7 years, 2 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 <map>
8 #include <vector> 9 #include <vector>
9 10
10 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
11 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
12 #include "base/memory/shared_memory.h" 13 #include "base/memory/shared_memory.h"
13 #include "content/common/gpu/gpu_command_buffer_stub.h" 14 #include "content/common/gpu/gpu_command_buffer_stub.h"
14 #include "content/common/gpu/media/video_decode_accelerator_impl.h" 15 #include "content/common/gpu/media/video_decode_accelerator_impl.h"
16 #include "gpu/command_buffer/service/texture_manager.h"
15 #include "ipc/ipc_listener.h" 17 #include "ipc/ipc_listener.h"
16 #include "ipc/ipc_sender.h" 18 #include "ipc/ipc_sender.h"
17 #include "media/video/video_decode_accelerator.h" 19 #include "media/video/video_decode_accelerator.h"
18 #include "ui/gfx/size.h" 20 #include "ui/gfx/size.h"
19 21
20 namespace base { 22 namespace base {
21 class MessageLoopProxy; 23 class MessageLoopProxy;
22 } 24 }
23 25
24 namespace content { 26 namespace content {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 void OnAssignPictureBuffers(const std::vector<int32>& buffer_ids, 76 void OnAssignPictureBuffers(const std::vector<int32>& buffer_ids,
75 const std::vector<uint32>& texture_ids); 77 const std::vector<uint32>& texture_ids);
76 void OnReusePictureBuffer(int32 picture_buffer_id); 78 void OnReusePictureBuffer(int32 picture_buffer_id);
77 void OnFlush(); 79 void OnFlush();
78 void OnReset(); 80 void OnReset();
79 void OnDestroy(); 81 void OnDestroy();
80 82
81 // Called on IO thread when |filter_| has been removed. 83 // Called on IO thread when |filter_| has been removed.
82 void OnFilterRemoved(); 84 void OnFilterRemoved();
83 85
86 // Sets the texture to cleared.
87 void SetTextureCleared(const media::Picture& picture);
88
84 // Message to Send() when initialization is done. Is only non-NULL during 89 // Message to Send() when initialization is done. Is only non-NULL during
85 // initialization and is owned by the IPC channel underlying the 90 // initialization and is owned by the IPC channel underlying the
86 // GpuCommandBufferStub. 91 // GpuCommandBufferStub.
87 IPC::Message* init_done_msg_; 92 IPC::Message* init_done_msg_;
88 93
89 // Route ID to communicate with the host. 94 // Route ID to communicate with the host.
90 int32 host_route_id_; 95 int32 host_route_id_;
91 96
92 // Unowned pointer to the underlying GpuCommandBufferStub. 97 // Unowned pointer to the underlying GpuCommandBufferStub.
93 GpuCommandBufferStub* stub_; 98 GpuCommandBufferStub* stub_;
(...skipping 16 matching lines...) Expand all
110 115
111 // GPU child message loop. 116 // GPU child message loop.
112 scoped_refptr<base::MessageLoopProxy> child_message_loop_; 117 scoped_refptr<base::MessageLoopProxy> child_message_loop_;
113 118
114 // GPU IO message loop. 119 // GPU IO message loop.
115 scoped_refptr<base::MessageLoopProxy> io_message_loop_; 120 scoped_refptr<base::MessageLoopProxy> io_message_loop_;
116 121
117 // Weak pointers will be invalidated on IO thread. 122 // Weak pointers will be invalidated on IO thread.
118 base::WeakPtrFactory<Client> weak_factory_for_io_; 123 base::WeakPtrFactory<Client> weak_factory_for_io_;
119 124
125 // Protects |uncleared_textures_| when DCHECK is on. This is for debugging
126 // only. We don't want to hold a lock on IO thread. When DCHECK is off,
127 // |uncleared_textures_| is only accessed from the child thread.
128 base::Lock debug_uncleared_textures_lock_;
129
130 // A map from picture buffer ID to TextureRef that have not been cleared.
131 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> > uncleared_textures_;
132
120 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); 133 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator);
121 }; 134 };
122 135
123 } // namespace content 136 } // namespace content
124 137
125 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ 138 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW
« no previous file with comments | « content/common/gpu/media/exynos_video_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