Chromium Code Reviews| 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 <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 289 STLDeleteContainerPointers(controller_clients_.begin(), | 289 STLDeleteContainerPointers(controller_clients_.begin(), |
| 290 controller_clients_.end()); | 290 controller_clients_.end()); |
| 291 } | 291 } |
| 292 | 292 |
| 293 void VideoCaptureController::DoIncomingCapturedVideoFrameOnIOThread( | 293 void VideoCaptureController::DoIncomingCapturedVideoFrameOnIOThread( |
| 294 const scoped_refptr<media::VideoCaptureDevice::Client::Buffer>& buffer, | 294 const scoped_refptr<media::VideoCaptureDevice::Client::Buffer>& buffer, |
| 295 const scoped_refptr<VideoFrame>& frame, | 295 const scoped_refptr<VideoFrame>& frame, |
| 296 const base::TimeTicks& timestamp) { | 296 const base::TimeTicks& timestamp) { |
| 297 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 297 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 298 DCHECK_NE(buffer->id(), VideoCaptureBufferPool::kInvalidId); | 298 DCHECK_NE(buffer->id(), VideoCaptureBufferPool::kInvalidId); |
| 299 DVLOG(3) << __func__; | |
|
wuchengli
2015/04/14 09:41:43
remove
kcwu
2015/04/14 20:02:34
Done.
| |
| 299 | 300 |
| 300 int count = 0; | 301 int count = 0; |
| 301 if (state_ == VIDEO_CAPTURE_STATE_STARTED) { | 302 if (state_ == VIDEO_CAPTURE_STATE_STARTED) { |
| 302 if (!frame->metadata()->HasKey(media::VideoFrameMetadata::FRAME_RATE)) { | 303 if (!frame->metadata()->HasKey(media::VideoFrameMetadata::FRAME_RATE)) { |
| 303 frame->metadata()->SetDouble(media::VideoFrameMetadata::FRAME_RATE, | 304 frame->metadata()->SetDouble(media::VideoFrameMetadata::FRAME_RATE, |
| 304 video_capture_format_.frame_rate); | 305 video_capture_format_.frame_rate); |
| 305 } | 306 } |
| 306 scoped_ptr<base::DictionaryValue> metadata(new base::DictionaryValue()); | 307 scoped_ptr<base::DictionaryValue> metadata(new base::DictionaryValue()); |
| 307 frame->metadata()->MergeInternalValuesInto(metadata.get()); | 308 frame->metadata()->MergeInternalValuesInto(metadata.get()); |
| 308 | 309 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 445 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 446 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 446 int active_client_count = 0; | 447 int active_client_count = 0; |
| 447 for (ControllerClient* client : controller_clients_) { | 448 for (ControllerClient* client : controller_clients_) { |
| 448 if (!client->paused) | 449 if (!client->paused) |
| 449 ++active_client_count; | 450 ++active_client_count; |
| 450 } | 451 } |
| 451 return active_client_count; | 452 return active_client_count; |
| 452 } | 453 } |
| 453 | 454 |
| 454 } // namespace content | 455 } // namespace content |
| OLD | NEW |