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_device_client.h" | 5 #include "content/browser/renderer_host/media/video_capture_device_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "content/browser/compositor/image_transport_factory.h" | 10 #include "content/browser/compositor/image_transport_factory.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 83 } |
84 #endif | 84 #endif |
85 | 85 |
86 typedef base::Callback<void(scoped_refptr<ContextProviderCommandBuffer>)> | 86 typedef base::Callback<void(scoped_refptr<ContextProviderCommandBuffer>)> |
87 ProcessContextCallback; | 87 ProcessContextCallback; |
88 | 88 |
89 void CreateContextOnUIThread(ProcessContextCallback bottom_half) { | 89 void CreateContextOnUIThread(ProcessContextCallback bottom_half) { |
90 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 90 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
91 #if !defined(OS_ANDROID) | 91 #if !defined(OS_ANDROID) |
92 bottom_half.Run(ContextProviderCommandBuffer::Create( | 92 bottom_half.Run(ContextProviderCommandBuffer::Create( |
93 CreateOffscreenCommandBufferContext(), "Offscreen-CaptureThread")); | 93 CreateOffscreenCommandBufferContext(), OFFSCREEN_VIDEO_CAPTURE_CONTEXT)); |
94 return; | 94 return; |
95 #endif | 95 #endif |
96 } | 96 } |
97 | 97 |
98 void ResetLostContextCallback( | 98 void ResetLostContextCallback( |
99 const scoped_refptr<ContextProviderCommandBuffer>& capture_thread_context) { | 99 const scoped_refptr<ContextProviderCommandBuffer>& capture_thread_context) { |
100 capture_thread_context->SetLostContextCallback( | 100 capture_thread_context->SetLostContextCallback( |
101 cc::ContextProvider::LostContextCallback()); | 101 cc::ContextProvider::LostContextCallback()); |
102 } | 102 } |
103 | 103 |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 void VideoCaptureDeviceClient::TextureWrapHelper::OnError( | 664 void VideoCaptureDeviceClient::TextureWrapHelper::OnError( |
665 const std::string& message) { | 665 const std::string& message) { |
666 DCHECK(capture_task_runner_->BelongsToCurrentThread()); | 666 DCHECK(capture_task_runner_->BelongsToCurrentThread()); |
667 DLOG(ERROR) << message; | 667 DLOG(ERROR) << message; |
668 BrowserThread::PostTask( | 668 BrowserThread::PostTask( |
669 BrowserThread::IO, FROM_HERE, | 669 BrowserThread::IO, FROM_HERE, |
670 base::Bind(&VideoCaptureController::DoErrorOnIOThread, controller_)); | 670 base::Bind(&VideoCaptureController::DoErrorOnIOThread, controller_)); |
671 } | 671 } |
672 | 672 |
673 } // namespace content | 673 } // namespace content |
OLD | NEW |