| 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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 DCHECK(mailbox_holder.texture_target); | 559 DCHECK(mailbox_holder.texture_target); |
| 560 DCHECK(mailbox_holder.sync_point); | 560 DCHECK(mailbox_holder.sync_point); |
| 561 | 561 |
| 562 scoped_refptr<media::VideoFrame> video_frame = | 562 scoped_refptr<media::VideoFrame> video_frame = |
| 563 media::VideoFrame::WrapNativeTexture( | 563 media::VideoFrame::WrapNativeTexture( |
| 564 mailbox_holder, | 564 mailbox_holder, |
| 565 media::BindToCurrentLoop(base::Bind( | 565 media::BindToCurrentLoop(base::Bind( |
| 566 &VideoCaptureDeviceClient::TextureWrapHelper::ReleaseCallback, | 566 &VideoCaptureDeviceClient::TextureWrapHelper::ReleaseCallback, |
| 567 this, image_id, texture_id)), | 567 this, image_id, texture_id)), |
| 568 frame_format.frame_size, gfx::Rect(frame_format.frame_size), | 568 frame_format.frame_size, gfx::Rect(frame_format.frame_size), |
| 569 frame_format.frame_size, base::TimeDelta(), true /* allow_overlay */); | 569 frame_format.frame_size, base::TimeDelta(), true /* allow_overlay */, |
| 570 true /* has_alpha */); |
| 570 video_frame->metadata()->SetDouble(media::VideoFrameMetadata::FRAME_RATE, | 571 video_frame->metadata()->SetDouble(media::VideoFrameMetadata::FRAME_RATE, |
| 571 frame_format.frame_rate); | 572 frame_format.frame_rate); |
| 572 | 573 |
| 573 BrowserThread::PostTask( | 574 BrowserThread::PostTask( |
| 574 BrowserThread::IO, FROM_HERE, | 575 BrowserThread::IO, FROM_HERE, |
| 575 base::Bind( | 576 base::Bind( |
| 576 &VideoCaptureController::DoIncomingCapturedVideoFrameOnIOThread, | 577 &VideoCaptureController::DoIncomingCapturedVideoFrameOnIOThread, |
| 577 controller_, base::Passed(&buffer), video_frame, timestamp)); | 578 controller_, base::Passed(&buffer), video_frame, timestamp)); |
| 578 } | 579 } |
| 579 | 580 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 void VideoCaptureDeviceClient::TextureWrapHelper::OnError( | 664 void VideoCaptureDeviceClient::TextureWrapHelper::OnError( |
| 664 const std::string& message) { | 665 const std::string& message) { |
| 665 DCHECK(capture_task_runner_->BelongsToCurrentThread()); | 666 DCHECK(capture_task_runner_->BelongsToCurrentThread()); |
| 666 DLOG(ERROR) << message; | 667 DLOG(ERROR) << message; |
| 667 BrowserThread::PostTask( | 668 BrowserThread::PostTask( |
| 668 BrowserThread::IO, FROM_HERE, | 669 BrowserThread::IO, FROM_HERE, |
| 669 base::Bind(&VideoCaptureController::DoErrorOnIOThread, controller_)); | 670 base::Bind(&VideoCaptureController::DoErrorOnIOThread, controller_)); |
| 670 } | 671 } |
| 671 | 672 |
| 672 } // namespace content | 673 } // namespace content |
| OLD | NEW |