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

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: tommi@ and mlamouri@ 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 174e5e0eba5288ef7053b09028bcf83571350afa..2e920c058af3d673185eb6d82e331505df4d7151 100644
--- a/content/browser/renderer_host/media/video_capture_manager.cc
+++ b/content/browser/renderer_host/media/video_capture_manager.cc
@@ -840,6 +840,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");
« no previous file with comments | « content/browser/renderer_host/media/video_capture_manager.h ('k') | media/capture/video/fake_video_capture_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698