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

Side by Side Diff: content/renderer/media/video_capture_impl_manager.cc

Issue 1849003002: Add video frame refresh to MediaStream and VideoCapture stacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nick's PS3 comments (moving non-observer impl out of MSVideoSink interface). Created 4 years, 8 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 // Implementation notes about interactions with VideoCaptureImpl. 5 // Implementation notes about interactions with VideoCaptureImpl.
6 // 6 //
7 // How is VideoCaptureImpl used: 7 // How is VideoCaptureImpl used:
8 // 8 //
9 // VideoCaptureImpl is an IO thread object while VideoCaptureImplManager 9 // VideoCaptureImpl is an IO thread object while VideoCaptureImplManager
10 // lives only on the render thread. It is only possible to access an 10 // lives only on the render thread. It is only possible to access an
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 const int client_id = ++next_client_id_; 89 const int client_id = ++next_client_id_;
90 90
91 ChildProcess::current()->io_task_runner()->PostTask( 91 ChildProcess::current()->io_task_runner()->PostTask(
92 FROM_HERE, 92 FROM_HERE,
93 base::Bind(&VideoCaptureImpl::StartCapture, base::Unretained(impl), 93 base::Bind(&VideoCaptureImpl::StartCapture, base::Unretained(impl),
94 client_id, params, state_update_cb, deliver_frame_cb)); 94 client_id, params, state_update_cb, deliver_frame_cb));
95 return base::Bind(&VideoCaptureImplManager::StopCapture, 95 return base::Bind(&VideoCaptureImplManager::StopCapture,
96 weak_factory_.GetWeakPtr(), client_id, id); 96 weak_factory_.GetWeakPtr(), client_id, id);
97 } 97 }
98 98
99 void VideoCaptureImplManager::RequestRefreshFrame(
100 media::VideoCaptureSessionId id) {
101 DCHECK(render_main_task_runner_->BelongsToCurrentThread());
102 const VideoCaptureDeviceMap::const_iterator it = devices_.find(id);
103 DCHECK(it != devices_.end());
104 VideoCaptureImpl* const impl = it->second.second;
105 ChildProcess::current()->io_task_runner()->PostTask(
106 FROM_HERE,
107 base::Bind(&VideoCaptureImpl::RequestRefreshFrame,
108 base::Unretained(impl)));
109 }
110
111
99 void VideoCaptureImplManager::GetDeviceSupportedFormats( 112 void VideoCaptureImplManager::GetDeviceSupportedFormats(
100 media::VideoCaptureSessionId id, 113 media::VideoCaptureSessionId id,
101 const VideoCaptureDeviceFormatsCB& callback) { 114 const VideoCaptureDeviceFormatsCB& callback) {
102 DCHECK(render_main_task_runner_->BelongsToCurrentThread()); 115 DCHECK(render_main_task_runner_->BelongsToCurrentThread());
103 const VideoCaptureDeviceMap::const_iterator it = devices_.find(id); 116 const VideoCaptureDeviceMap::const_iterator it = devices_.find(id);
104 DCHECK(it != devices_.end()); 117 DCHECK(it != devices_.end());
105 VideoCaptureImpl* const impl = it->second.second; 118 VideoCaptureImpl* const impl = it->second.second;
106 ChildProcess::current()->io_task_runner()->PostTask( 119 ChildProcess::current()->io_task_runner()->PostTask(
107 FROM_HERE, base::Bind(&VideoCaptureImpl::GetDeviceSupportedFormats, 120 FROM_HERE, base::Bind(&VideoCaptureImpl::GetDeviceSupportedFormats,
108 base::Unretained(impl), callback)); 121 base::Unretained(impl), callback));
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 DCHECK(render_main_task_runner_->BelongsToCurrentThread()); 174 DCHECK(render_main_task_runner_->BelongsToCurrentThread());
162 for (const auto& device : devices_) { 175 for (const auto& device : devices_) {
163 VideoCaptureImpl* const impl = device.second.second; 176 VideoCaptureImpl* const impl = device.second.second;
164 ChildProcess::current()->io_task_runner()->PostTask( 177 ChildProcess::current()->io_task_runner()->PostTask(
165 FROM_HERE, base::Bind(&VideoCaptureImpl::SuspendCapture, 178 FROM_HERE, base::Bind(&VideoCaptureImpl::SuspendCapture,
166 base::Unretained(impl), suspend)); 179 base::Unretained(impl), suspend));
167 } 180 }
168 } 181 }
169 182
170 } // namespace content 183 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/video_capture_impl_manager.h ('k') | content/renderer/media/video_track_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698