| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_host.h" | 5 #include "content/browser/renderer_host/media/video_capture_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/browser/browser_main_loop.h" | 10 #include "content/browser/browser_main_loop.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 VideoCaptureMsg_BufferReady_Params params; | 99 VideoCaptureMsg_BufferReady_Params params; |
| 100 params.device_id = controller_id; | 100 params.device_id = controller_id; |
| 101 params.buffer_id = buffer_id; | 101 params.buffer_id = buffer_id; |
| 102 params.timestamp = timestamp; | 102 params.timestamp = timestamp; |
| 103 video_frame->metadata()->MergeInternalValuesInto(¶ms.metadata); | 103 video_frame->metadata()->MergeInternalValuesInto(¶ms.metadata); |
| 104 params.pixel_format = video_frame->format(); | 104 params.pixel_format = video_frame->format(); |
| 105 params.storage_type = video_frame->storage_type(); | 105 params.storage_type = video_frame->storage_type(); |
| 106 params.coded_size = video_frame->coded_size(); | 106 params.coded_size = video_frame->coded_size(); |
| 107 params.visible_rect = video_frame->visible_rect(); | 107 params.visible_rect = video_frame->visible_rect(); |
| 108 if (video_frame->HasTextures()) { | |
| 109 DCHECK_EQ(1u, media::VideoFrame::NumPlanes(video_frame->format())) | |
| 110 << "Only single planar textures are supported"; | |
| 111 params.mailbox_holder = video_frame->mailbox_holder(0); | |
| 112 } | |
| 113 | 108 |
| 114 Send(new VideoCaptureMsg_BufferReady(params)); | 109 Send(new VideoCaptureMsg_BufferReady(params)); |
| 115 } | 110 } |
| 116 | 111 |
| 117 void VideoCaptureHost::OnEnded(VideoCaptureControllerID controller_id) { | 112 void VideoCaptureHost::OnEnded(VideoCaptureControllerID controller_id) { |
| 118 DVLOG(1) << "VideoCaptureHost::OnEnded"; | 113 DVLOG(1) << "VideoCaptureHost::OnEnded"; |
| 119 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 114 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 120 BrowserThread::PostTask( | 115 BrowserThread::PostTask( |
| 121 BrowserThread::IO, FROM_HERE, | 116 BrowserThread::IO, FROM_HERE, |
| 122 base::Bind(&VideoCaptureHost::DoEnded, this, controller_id)); | 117 base::Bind(&VideoCaptureHost::DoEnded, this, controller_id)); |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 return; | 323 return; |
| 329 | 324 |
| 330 if (it->second) { | 325 if (it->second) { |
| 331 media_stream_manager_->video_capture_manager()->StopCaptureForClient( | 326 media_stream_manager_->video_capture_manager()->StopCaptureForClient( |
| 332 it->second.get(), controller_id, this, on_error); | 327 it->second.get(), controller_id, this, on_error); |
| 333 } | 328 } |
| 334 entries_.erase(it); | 329 entries_.erase(it); |
| 335 } | 330 } |
| 336 | 331 |
| 337 } // namespace content | 332 } // namespace content |
| OLD | NEW |