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

Unified Diff: content/browser/renderer_host/media/video_capture_manager.cc

Issue 1952463002: Media Stream Image Capture (4): wire takePhoto and implement in FakeVCDevice (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: miu@s comments Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/media/video_capture_manager.cc
diff --git a/content/browser/renderer_host/media/video_capture_manager.cc b/content/browser/renderer_host/media/video_capture_manager.cc
index cf31a65f6d979d06dc646f6fdd68d8f2d8ee3a03..f8e308815e46da04a9de2976f5a2dc474f0500ec 100644
--- a/content/browser/renderer_host/media/video_capture_manager.cc
+++ b/content/browser/renderer_host/media/video_capture_manager.cc
@@ -786,6 +786,21 @@ void VideoCaptureManager::MaybePostDesktopCaptureWindowId(
notification_window_ids_.erase(window_id_it);
}
+bool VideoCaptureManager::TakePhoto(
+ int session_id,
+ const media::VideoCaptureDevice::TakePhotoCallback& photo_callback) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ SessionMap::const_iterator session_it = sessions_.find(session_id);
+ if (session_it == sessions_.end())
+ return false;
+
+ DeviceEntry* const device_info =
+ GetDeviceEntryForMediaStreamDevice(session_it->second);
+ if (!device_info)
+ return false;
+ return device_info->video_capture_device()->TakePhoto(photo_callback);
+}
+
void VideoCaptureManager::DoStopDeviceOnDeviceThread(
std::unique_ptr<media::VideoCaptureDevice> device) {
SCOPED_UMA_HISTOGRAM_TIMER("Media.VideoCaptureManager.StopDeviceTime");

Powered by Google App Engine
This is Rietveld 408576698