Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: content/browser/renderer_host/media/video_capture_host.cc

Issue 2045813003: Decouple capture timestamp and reference time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 DCHECK_CURRENTLY_ON(BrowserThread::IO); 84 DCHECK_CURRENTLY_ON(BrowserThread::IO);
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) {
96 DCHECK_CURRENTLY_ON(BrowserThread::IO); 95 DCHECK_CURRENTLY_ON(BrowserThread::IO);
97 if (entries_.find(controller_id) == entries_.end()) 96 if (entries_.find(controller_id) == entries_.end())
98 return; 97 return;
99 98
100 VideoCaptureMsg_BufferReady_Params params; 99 VideoCaptureMsg_BufferReady_Params params;
101 params.device_id = controller_id; 100 params.device_id = controller_id;
102 params.buffer_id = buffer_id; 101 params.buffer_id = buffer_id;
103 params.timestamp = timestamp; 102 params.timestamp = video_frame->timestamp();
104 video_frame->metadata()->MergeInternalValuesInto(&params.metadata); 103 video_frame->metadata()->MergeInternalValuesInto(&params.metadata);
105 params.pixel_format = video_frame->format(); 104 params.pixel_format = video_frame->format();
106 params.storage_type = video_frame->storage_type(); 105 params.storage_type = video_frame->storage_type();
107 params.coded_size = video_frame->coded_size(); 106 params.coded_size = video_frame->coded_size();
108 params.visible_rect = video_frame->visible_rect(); 107 params.visible_rect = video_frame->visible_rect();
109 108
110 Send(new VideoCaptureMsg_BufferReady(params)); 109 Send(new VideoCaptureMsg_BufferReady(params));
111 } 110 }
112 111
113 void VideoCaptureHost::OnEnded(VideoCaptureControllerID controller_id) { 112 void VideoCaptureHost::OnEnded(VideoCaptureControllerID controller_id) {
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 return; 341 return;
343 342
344 if (it->second) { 343 if (it->second) {
345 media_stream_manager_->video_capture_manager()->StopCaptureForClient( 344 media_stream_manager_->video_capture_manager()->StopCaptureForClient(
346 it->second.get(), controller_id, this, on_error); 345 it->second.get(), controller_id, this, on_error);
347 } 346 }
348 entries_.erase(it); 347 entries_.erase(it);
349 } 348 }
350 349
351 } // namespace content 350 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698