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_host.h" | 5 #include "content/browser/renderer_host/media/video_capture_host.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 if (entries_.find(controller_id) == entries_.end()) | 85 if (entries_.find(controller_id) == entries_.end()) |
| 86 return; | 86 return; |
| 87 | 87 |
| 88 Send(new VideoCaptureMsg_FreeBuffer(controller_id, buffer_id)); | 88 Send(new VideoCaptureMsg_FreeBuffer(controller_id, buffer_id)); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void VideoCaptureHost::OnBufferReady( | 91 void VideoCaptureHost::OnBufferReady( |
| 92 VideoCaptureControllerID controller_id, | 92 VideoCaptureControllerID controller_id, |
| 93 int buffer_id, | 93 int buffer_id, |
| 94 const scoped_refptr<media::VideoFrame>& video_frame, | 94 const scoped_refptr<media::VideoFrame>& video_frame, |
| 95 const base::TimeTicks& timestamp) { | 95 base::TimeTicks reference_time) { |
| 96 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 96 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 97 if (entries_.find(controller_id) == entries_.end()) | 97 if (entries_.find(controller_id) == entries_.end()) |
| 98 return; | 98 return; |
| 99 | 99 |
| 100 VideoCaptureMsg_BufferReady_Params params; | 100 VideoCaptureMsg_BufferReady_Params params; |
| 101 params.device_id = controller_id; | 101 params.device_id = controller_id; |
| 102 params.buffer_id = buffer_id; | 102 params.buffer_id = buffer_id; |
| 103 params.timestamp = timestamp; | 103 params.timestamp = video_frame->timestamp(); |
| 104 params.reference_time = reference_time; | |
|
miu
2016/06/07 20:03:47
There's no need to add a new |reference_time| to t
qiangchen
2016/06/08 18:04:30
Done.
| |
| 104 video_frame->metadata()->MergeInternalValuesInto(¶ms.metadata); | 105 video_frame->metadata()->MergeInternalValuesInto(¶ms.metadata); |
| 105 params.pixel_format = video_frame->format(); | 106 params.pixel_format = video_frame->format(); |
| 106 params.storage_type = video_frame->storage_type(); | 107 params.storage_type = video_frame->storage_type(); |
| 107 params.coded_size = video_frame->coded_size(); | 108 params.coded_size = video_frame->coded_size(); |
| 108 params.visible_rect = video_frame->visible_rect(); | 109 params.visible_rect = video_frame->visible_rect(); |
| 109 | 110 |
| 110 Send(new VideoCaptureMsg_BufferReady(params)); | 111 Send(new VideoCaptureMsg_BufferReady(params)); |
| 111 } | 112 } |
| 112 | 113 |
| 113 void VideoCaptureHost::OnEnded(VideoCaptureControllerID controller_id) { | 114 void VideoCaptureHost::OnEnded(VideoCaptureControllerID controller_id) { |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 342 return; | 343 return; |
| 343 | 344 |
| 344 if (it->second) { | 345 if (it->second) { |
| 345 media_stream_manager_->video_capture_manager()->StopCaptureForClient( | 346 media_stream_manager_->video_capture_manager()->StopCaptureForClient( |
| 346 it->second.get(), controller_id, this, on_error); | 347 it->second.get(), controller_id, this, on_error); |
| 347 } | 348 } |
| 348 entries_.erase(it); | 349 entries_.erase(it); |
| 349 } | 350 } |
| 350 | 351 |
| 351 } // namespace content | 352 } // namespace content |
| OLD | NEW |