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

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

Issue 10830265: Test context_->GetCommandBufferProxy() before following it blindly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | no next file » | 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 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h" 5 #include "content/renderer/media/renderer_gpu_video_decoder_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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 waiter.Wait(); 60 waiter.Wait();
61 return vda; 61 return vda;
62 } 62 }
63 63
64 void RendererGpuVideoDecoderFactories::AsyncCreateVideoDecodeAccelerator( 64 void RendererGpuVideoDecoderFactories::AsyncCreateVideoDecodeAccelerator(
65 media::VideoCodecProfile profile, 65 media::VideoCodecProfile profile,
66 media::VideoDecodeAccelerator::Client* client, 66 media::VideoDecodeAccelerator::Client* client,
67 media::VideoDecodeAccelerator** vda, 67 media::VideoDecodeAccelerator** vda,
68 base::WaitableEvent* waiter) { 68 base::WaitableEvent* waiter) {
69 DCHECK_EQ(MessageLoop::current(), message_loop_); 69 DCHECK_EQ(MessageLoop::current(), message_loop_);
70 if (context_) { 70 if (context_ && context_->GetCommandBufferProxy()) {
71 *vda = gpu_channel_host_->CreateVideoDecoder( 71 *vda = gpu_channel_host_->CreateVideoDecoder(
72 context_->GetCommandBufferProxy()->GetRouteID(), 72 context_->GetCommandBufferProxy()->GetRouteID(),
73 profile, client); 73 profile, client);
74 } else { 74 } else {
75 *vda = NULL; 75 *vda = NULL;
76 } 76 }
77 waiter->Signal(); 77 waiter->Signal();
78 } 78 }
79 79
80 bool RendererGpuVideoDecoderFactories::CreateTextures( 80 bool RendererGpuVideoDecoderFactories::CreateTextures(
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 waiter.Wait(); 152 waiter.Wait();
153 return shm; 153 return shm;
154 } 154 }
155 155
156 void RendererGpuVideoDecoderFactories::AsyncCreateSharedMemory( 156 void RendererGpuVideoDecoderFactories::AsyncCreateSharedMemory(
157 size_t size, base::SharedMemory** shm, base::WaitableEvent* waiter) { 157 size_t size, base::SharedMemory** shm, base::WaitableEvent* waiter) {
158 DCHECK_EQ(MessageLoop::current(), ChildThread::current()->message_loop()); 158 DCHECK_EQ(MessageLoop::current(), ChildThread::current()->message_loop());
159 *shm = ChildThread::current()->AllocateSharedMemory(size); 159 *shm = ChildThread::current()->AllocateSharedMemory(size);
160 waiter->Signal(); 160 waiter->Signal();
161 } 161 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698