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

Side by Side Diff: content/renderer/media/renderer_gpu_video_accelerator_factories.cc

Issue 170843004: Pass Client pointer in Initialize() for VDA/VEA (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 48f212da fischman@ comments. Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h" 5 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 26 matching lines...) Expand all
37 if (context_provider_->IsContextLost()) { 37 if (context_provider_->IsContextLost()) {
38 context_provider_->VerifyContexts(); 38 context_provider_->VerifyContexts();
39 context_provider_ = NULL; 39 context_provider_ = NULL;
40 return NULL; 40 return NULL;
41 } 41 }
42 return context_provider_->WebContext3D(); 42 return context_provider_->WebContext3D();
43 } 43 }
44 44
45 scoped_ptr<media::VideoDecodeAccelerator> 45 scoped_ptr<media::VideoDecodeAccelerator>
46 RendererGpuVideoAcceleratorFactories::CreateVideoDecodeAccelerator( 46 RendererGpuVideoAcceleratorFactories::CreateVideoDecodeAccelerator(
47 media::VideoCodecProfile profile, 47 media::VideoCodecProfile profile) {
48 media::VideoDecodeAccelerator::Client* client) {
49 DCHECK(task_runner_->BelongsToCurrentThread()); 48 DCHECK(task_runner_->BelongsToCurrentThread());
50 49
51 WebGraphicsContext3DCommandBufferImpl* context = GetContext3d(); 50 WebGraphicsContext3DCommandBufferImpl* context = GetContext3d();
52 if (context && context->GetCommandBufferProxy()) { 51 if (context && context->GetCommandBufferProxy()) {
53 return gpu_channel_host_->CreateVideoDecoder( 52 return gpu_channel_host_->CreateVideoDecoder(
54 context->GetCommandBufferProxy()->GetRouteID(), profile, client); 53 context->GetCommandBufferProxy()->GetRouteID(), profile);
55 } 54 }
56 55
57 return scoped_ptr<media::VideoDecodeAccelerator>(); 56 return scoped_ptr<media::VideoDecodeAccelerator>();
58 } 57 }
59 58
60 scoped_ptr<media::VideoEncodeAccelerator> 59 scoped_ptr<media::VideoEncodeAccelerator>
61 RendererGpuVideoAcceleratorFactories::CreateVideoEncodeAccelerator( 60 RendererGpuVideoAcceleratorFactories::CreateVideoEncodeAccelerator() {
62 media::VideoEncodeAccelerator::Client* client) {
63 DCHECK(task_runner_->BelongsToCurrentThread()); 61 DCHECK(task_runner_->BelongsToCurrentThread());
64 62
65 return gpu_channel_host_->CreateVideoEncoder(client); 63 return gpu_channel_host_->CreateVideoEncoder();
66 } 64 }
67 65
68 uint32 RendererGpuVideoAcceleratorFactories::CreateTextures( 66 uint32 RendererGpuVideoAcceleratorFactories::CreateTextures(
69 int32 count, 67 int32 count,
70 const gfx::Size& size, 68 const gfx::Size& size,
71 std::vector<uint32>* texture_ids, 69 std::vector<uint32>* texture_ids,
72 std::vector<gpu::Mailbox>* texture_mailboxes, 70 std::vector<gpu::Mailbox>* texture_mailboxes,
73 uint32 texture_target) { 71 uint32 texture_target) {
74 DCHECK(task_runner_->BelongsToCurrentThread()); 72 DCHECK(task_runner_->BelongsToCurrentThread());
75 DCHECK(texture_target); 73 DCHECK(texture_target);
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 DCHECK(task_runner_->BelongsToCurrentThread()); 194 DCHECK(task_runner_->BelongsToCurrentThread());
197 return ChildThread::AllocateSharedMemory(size, thread_safe_sender_.get()); 195 return ChildThread::AllocateSharedMemory(size, thread_safe_sender_.get());
198 } 196 }
199 197
200 scoped_refptr<base::SingleThreadTaskRunner> 198 scoped_refptr<base::SingleThreadTaskRunner>
201 RendererGpuVideoAcceleratorFactories::GetTaskRunner() { 199 RendererGpuVideoAcceleratorFactories::GetTaskRunner() {
202 return task_runner_; 200 return task_runner_;
203 } 201 }
204 202
205 } // namespace content 203 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698