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

Side by Side Diff: media/gpu/ipc/client/gpu_video_decode_accelerator_host.h

Issue 2627173002: Adds locks for CommandBufferProxyImpl invalidation (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | media/gpu/ipc/client/gpu_video_decode_accelerator_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 MEDIA_GPU_IPC_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ 5 #ifndef MEDIA_GPU_IPC_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_
6 #define MEDIA_GPU_IPC_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ 6 #define MEDIA_GPU_IPC_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/single_thread_task_runner.h"
14 #include "base/threading/non_thread_safe.h" 15 #include "base/threading/non_thread_safe.h"
15 #include "gpu/ipc/client/command_buffer_proxy_impl.h" 16 #include "gpu/ipc/client/command_buffer_proxy_impl.h"
16 #include "ipc/ipc_listener.h" 17 #include "ipc/ipc_listener.h"
17 #include "media/video/video_decode_accelerator.h" 18 #include "media/video/video_decode_accelerator.h"
18 #include "ui/gfx/geometry/size.h" 19 #include "ui/gfx/geometry/size.h"
19 20
20 struct AcceleratedVideoDecoderHostMsg_PictureReady_Params; 21 struct AcceleratedVideoDecoderHostMsg_PictureReady_Params;
21 22
22 namespace gpu { 23 namespace gpu {
23 class GpuChannelHost; 24 class GpuChannelHost;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 void OnNotifyError(uint32_t error); 80 void OnNotifyError(uint32_t error);
80 81
81 scoped_refptr<gpu::GpuChannelHost> channel_; 82 scoped_refptr<gpu::GpuChannelHost> channel_;
82 83
83 // Route ID for the associated decoder in the GPU process. 84 // Route ID for the associated decoder in the GPU process.
84 int32_t decoder_route_id_; 85 int32_t decoder_route_id_;
85 86
86 // The client that will receive callbacks from the decoder. 87 // The client that will receive callbacks from the decoder.
87 Client* client_; 88 Client* client_;
88 89
90 // Protect |impl_|. |impl_| is used on media thread, but it can be invalidated
91 // on main thread.
92 base::Lock impl_lock_;
93
89 // Unowned reference to the gpu::CommandBufferProxyImpl that created us. 94 // Unowned reference to the gpu::CommandBufferProxyImpl that created us.
90 // |this| registers as a DeletionObserver of |impl_|, the so reference is 95 // |this| registers as a DeletionObserver of |impl_|, the so reference is
91 // always valid as long as it is not NULL. 96 // always valid as long as it is not NULL.
92 gpu::CommandBufferProxyImpl* impl_; 97 gpu::CommandBufferProxyImpl* impl_;
93 98
94 // Requested dimensions of the buffer, from ProvidePictureBuffers(). 99 // Requested dimensions of the buffer, from ProvidePictureBuffers().
95 gfx::Size picture_buffer_dimensions_; 100 gfx::Size picture_buffer_dimensions_;
96 101
102 // Task runner for tasks that should run on the thread this class is
103 // constructed.
104 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_;
105
97 // WeakPtr factory for posting tasks back to itself. 106 // WeakPtr factory for posting tasks back to itself.
98 base::WeakPtrFactory<GpuVideoDecodeAcceleratorHost> weak_this_factory_; 107 base::WeakPtrFactory<GpuVideoDecodeAcceleratorHost> weak_this_factory_;
99 108
100 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecodeAcceleratorHost); 109 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecodeAcceleratorHost);
101 }; 110 };
102 111
103 } // namespace media 112 } // namespace media
104 113
105 #endif // MEDIA_GPU_IPC_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ 114 #endif // MEDIA_GPU_IPC_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | media/gpu/ipc/client/gpu_video_decode_accelerator_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698