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_controller.h" | 5 #include "content/browser/renderer_host/media/video_capture_controller.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/debug/trace_event.h" |
10 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
11 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
12 #include "content/browser/renderer_host/media/media_stream_manager.h" | 13 #include "content/browser/renderer_host/media/media_stream_manager.h" |
13 #include "content/browser/renderer_host/media/video_capture_manager.h" | 14 #include "content/browser/renderer_host/media/video_capture_manager.h" |
14 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
15 #include "media/base/video_frame.h" | 16 #include "media/base/video_frame.h" |
16 #include "media/base/video_util.h" | 17 #include "media/base/video_util.h" |
17 #include "media/base/yuv_convert.h" | 18 #include "media/base/yuv_convert.h" |
18 | 19 |
19 #if !defined(OS_IOS) && !defined(OS_ANDROID) | 20 #if !defined(OS_IOS) && !defined(OS_ANDROID) |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 const uint8* data, | 262 const uint8* data, |
262 int length, | 263 int length, |
263 base::Time timestamp, | 264 base::Time timestamp, |
264 int rotation, | 265 int rotation, |
265 bool flip_vert, | 266 bool flip_vert, |
266 bool flip_horiz) { | 267 bool flip_horiz) { |
267 DCHECK(frame_info_.color == media::VideoCaptureCapability::kI420 || | 268 DCHECK(frame_info_.color == media::VideoCaptureCapability::kI420 || |
268 frame_info_.color == media::VideoCaptureCapability::kYV12 || | 269 frame_info_.color == media::VideoCaptureCapability::kYV12 || |
269 (rotation == 0 && !flip_vert && !flip_horiz)); | 270 (rotation == 0 && !flip_vert && !flip_horiz)); |
270 | 271 |
| 272 TRACE_EVENT0("video", "VideoCaptureController::OnIncomingCapturedFrame"); |
| 273 |
271 scoped_refptr<media::VideoFrame> dst; | 274 scoped_refptr<media::VideoFrame> dst; |
272 { | 275 { |
273 base::AutoLock lock(buffer_pool_lock_); | 276 base::AutoLock lock(buffer_pool_lock_); |
274 if (!buffer_pool_.get()) | 277 if (!buffer_pool_.get()) |
275 return; | 278 return; |
276 dst = buffer_pool_->ReserveI420VideoFrame(gfx::Size(frame_info_.width, | 279 dst = buffer_pool_->ReserveI420VideoFrame(gfx::Size(frame_info_.width, |
277 frame_info_.height), | 280 frame_info_.height), |
278 rotation); | 281 rotation); |
279 } | 282 } |
280 | 283 |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 controller_clients_.push_back((*client_it)); | 729 controller_clients_.push_back((*client_it)); |
727 pending_clients_.erase(client_it++); | 730 pending_clients_.erase(client_it++); |
728 } | 731 } |
729 // Request the manager to start the actual capture. | 732 // Request the manager to start the actual capture. |
730 video_capture_manager_->Start(current_params_, this); | 733 video_capture_manager_->Start(current_params_, this); |
731 state_ = VIDEO_CAPTURE_STATE_STARTED; | 734 state_ = VIDEO_CAPTURE_STATE_STARTED; |
732 device_in_use_ = true; | 735 device_in_use_ = true; |
733 } | 736 } |
734 | 737 |
735 } // namespace content | 738 } // namespace content |
OLD | NEW |