| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/browser/renderer_host/media/video_capture_texture_wrapper.h" | 5 #include "content/browser/renderer_host/media/video_capture_texture_wrapper.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "content/browser/compositor/image_transport_factory.h" | 8 #include "content/browser/compositor/image_transport_factory.h" |
| 9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 10 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 10 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 DCHECK(gpu_channel_host); | 91 DCHECK(gpu_channel_host); |
| 92 return CreateContextCommon(gpu_channel_host, 0); | 92 return CreateContextCommon(gpu_channel_host, 0); |
| 93 } | 93 } |
| 94 | 94 |
| 95 typedef base::Callback<void(scoped_refptr<ContextProviderCommandBuffer>)> | 95 typedef base::Callback<void(scoped_refptr<ContextProviderCommandBuffer>)> |
| 96 ProcessContextCallback; | 96 ProcessContextCallback; |
| 97 | 97 |
| 98 void CreateContextOnUIThread(ProcessContextCallback bottom_half) { | 98 void CreateContextOnUIThread(ProcessContextCallback bottom_half) { |
| 99 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 99 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 100 bottom_half.Run(ContextProviderCommandBuffer::Create( | 100 bottom_half.Run(ContextProviderCommandBuffer::Create( |
| 101 CreateOffscreenCommandBufferContext(), "Offscreen-CaptureThread")); | 101 CreateOffscreenCommandBufferContext(), OFFSCREEN_VIDEO_CAPTURE_CONTEXT)); |
| 102 return; | 102 return; |
| 103 } | 103 } |
| 104 | 104 |
| 105 void ResetLostContextCallback( | 105 void ResetLostContextCallback( |
| 106 const scoped_refptr<ContextProviderCommandBuffer>& capture_thread_context) { | 106 const scoped_refptr<ContextProviderCommandBuffer>& capture_thread_context) { |
| 107 capture_thread_context->SetLostContextCallback( | 107 capture_thread_context->SetLostContextCallback( |
| 108 cc::ContextProvider::LostContextCallback()); | 108 cc::ContextProvider::LostContextCallback()); |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // anonymous namespace | 111 } // anonymous namespace |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 void VideoCaptureTextureWrapper::TextureWrapperDelegate::OnError( | 454 void VideoCaptureTextureWrapper::TextureWrapperDelegate::OnError( |
| 455 const std::string& message) { | 455 const std::string& message) { |
| 456 DCHECK(capture_task_runner_->BelongsToCurrentThread()); | 456 DCHECK(capture_task_runner_->BelongsToCurrentThread()); |
| 457 DLOG(ERROR) << message; | 457 DLOG(ERROR) << message; |
| 458 BrowserThread::PostTask( | 458 BrowserThread::PostTask( |
| 459 BrowserThread::IO, FROM_HERE, | 459 BrowserThread::IO, FROM_HERE, |
| 460 base::Bind(&VideoCaptureController::DoErrorOnIOThread, controller_)); | 460 base::Bind(&VideoCaptureController::DoErrorOnIOThread, controller_)); |
| 461 } | 461 } |
| 462 | 462 |
| 463 } // namespace content | 463 } // namespace content |
| OLD | NEW |