OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |