| OLD | NEW |
| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 return base::UnguessableToken(); | 121 return base::UnguessableToken(); |
| 122 | 122 |
| 123 if (channel_token_.is_empty()) { | 123 if (channel_token_.is_empty()) { |
| 124 context_provider_->GetCommandBufferProxy()->channel()->Send( | 124 context_provider_->GetCommandBufferProxy()->channel()->Send( |
| 125 new GpuCommandBufferMsg_GetChannelToken(&channel_token_)); | 125 new GpuCommandBufferMsg_GetChannelToken(&channel_token_)); |
| 126 } | 126 } |
| 127 | 127 |
| 128 return channel_token_; | 128 return channel_token_; |
| 129 } | 129 } |
| 130 | 130 |
| 131 int32_t RendererGpuVideoAcceleratorFactories::GetCommandBufferRouteId() { |
| 132 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 133 if (!context_provider_) |
| 134 return 0; |
| 135 LOG(ERROR) << "stream_id should be: " << context_provider_->GetCommandBufferPr
oxy()->GetExtraCommandBufferData(); |
| 136 return context_provider_->GetCommandBufferProxy()->route_id(); |
| 137 } |
| 138 |
| 131 std::unique_ptr<media::VideoDecodeAccelerator> | 139 std::unique_ptr<media::VideoDecodeAccelerator> |
| 132 RendererGpuVideoAcceleratorFactories::CreateVideoDecodeAccelerator() { | 140 RendererGpuVideoAcceleratorFactories::CreateVideoDecodeAccelerator() { |
| 133 DCHECK(video_accelerator_enabled_); | 141 DCHECK(video_accelerator_enabled_); |
| 134 DCHECK(task_runner_->BelongsToCurrentThread()); | 142 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 135 if (CheckContextLost()) | 143 if (CheckContextLost()) |
| 136 return nullptr; | 144 return nullptr; |
| 137 | 145 |
| 138 return std::unique_ptr<media::VideoDecodeAccelerator>( | 146 return std::unique_ptr<media::VideoDecodeAccelerator>( |
| 139 new media::GpuVideoDecodeAcceleratorHost( | 147 new media::GpuVideoDecodeAcceleratorHost( |
| 140 context_provider_->GetCommandBufferProxy())); | 148 context_provider_->GetCommandBufferProxy())); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 context_provider_refptr_ = nullptr; | 339 context_provider_refptr_ = nullptr; |
| 332 } | 340 } |
| 333 | 341 |
| 334 scoped_refptr<ContextProviderCommandBuffer> | 342 scoped_refptr<ContextProviderCommandBuffer> |
| 335 RendererGpuVideoAcceleratorFactories::ContextProviderMainThread() { | 343 RendererGpuVideoAcceleratorFactories::ContextProviderMainThread() { |
| 336 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); | 344 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); |
| 337 return context_provider_refptr_; | 345 return context_provider_refptr_; |
| 338 } | 346 } |
| 339 | 347 |
| 340 } // namespace content | 348 } // namespace content |
| OLD | NEW |