| 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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 } | 415 } |
| 416 | 416 |
| 417 OnIncomingCapturedBuffer(buffer.Pass(), frame_format, timestamp); | 417 OnIncomingCapturedBuffer(buffer.Pass(), frame_format, timestamp); |
| 418 }; | 418 }; |
| 419 | 419 |
| 420 scoped_ptr<media::VideoCaptureDevice::Client::Buffer> | 420 scoped_ptr<media::VideoCaptureDevice::Client::Buffer> |
| 421 VideoCaptureDeviceClient::ReserveOutputBuffer(media::VideoPixelFormat format, | 421 VideoCaptureDeviceClient::ReserveOutputBuffer(media::VideoPixelFormat format, |
| 422 const gfx::Size& dimensions) { | 422 const gfx::Size& dimensions) { |
| 423 DCHECK(format == media::PIXEL_FORMAT_I420 || | 423 DCHECK(format == media::PIXEL_FORMAT_I420 || |
| 424 format == media::PIXEL_FORMAT_TEXTURE || | 424 format == media::PIXEL_FORMAT_TEXTURE || |
| 425 format == media::PIXEL_FORMAT_GPUMEMORYBUFFER); | 425 format == media::PIXEL_FORMAT_GPUMEMORYBUFFER) |
| 426 << "format " << media::VideoCaptureFormat::PixelFormatToString(format); |
| 426 DCHECK_GT(dimensions.width(), 0); | 427 DCHECK_GT(dimensions.width(), 0); |
| 427 DCHECK_GT(dimensions.height(), 0); | 428 DCHECK_GT(dimensions.height(), 0); |
| 428 | 429 |
| 429 if (format == media::PIXEL_FORMAT_GPUMEMORYBUFFER && !texture_wrap_helper_) { | 430 if (format == media::PIXEL_FORMAT_GPUMEMORYBUFFER && !texture_wrap_helper_) { |
| 430 texture_wrap_helper_ = | 431 texture_wrap_helper_ = |
| 431 new TextureWrapHelper(controller_, capture_task_runner_); | 432 new TextureWrapHelper(controller_, capture_task_runner_); |
| 432 } | 433 } |
| 433 | 434 |
| 434 int buffer_id_to_drop = VideoCaptureBufferPool::kInvalidId; | 435 int buffer_id_to_drop = VideoCaptureBufferPool::kInvalidId; |
| 435 const int buffer_id = | 436 const int buffer_id = |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 void VideoCaptureDeviceClient::TextureWrapHelper::OnError( | 680 void VideoCaptureDeviceClient::TextureWrapHelper::OnError( |
| 680 const std::string& message) { | 681 const std::string& message) { |
| 681 DCHECK(capture_task_runner_->BelongsToCurrentThread()); | 682 DCHECK(capture_task_runner_->BelongsToCurrentThread()); |
| 682 DLOG(ERROR) << message; | 683 DLOG(ERROR) << message; |
| 683 BrowserThread::PostTask( | 684 BrowserThread::PostTask( |
| 684 BrowserThread::IO, FROM_HERE, | 685 BrowserThread::IO, FROM_HERE, |
| 685 base::Bind(&VideoCaptureController::DoErrorOnIOThread, controller_)); | 686 base::Bind(&VideoCaptureController::DoErrorOnIOThread, controller_)); |
| 686 } | 687 } |
| 687 | 688 |
| 688 } // namespace content | 689 } // namespace content |
| OLD | NEW |