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

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

Issue 1191443003: VideoCaptureParams: add flag for hinting capture using GpuMemoryBuffers & flag for it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added #include "build/build_config.h" Created 5 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 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 b9297a4bd652f1a3320f46502f1efae1c9f276de..d56a13cc33fdaf9b22aabe9ab5e3a32701eb30a2 100644
--- a/content/browser/renderer_host/media/video_capture_manager.cc
+++ b/content/browser/renderer_host/media/video_capture_manager.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/command_line.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
@@ -25,6 +26,7 @@
#include "content/public/browser/desktop_media_id.h"
#include "content/public/common/media_stream_request.h"
#include "media/base/bind_to_current_loop.h"
+#include "media/base/media_switches.h"
#include "media/video/capture/video_capture_device.h"
#include "media/video/capture/video_capture_device_factory.h"
@@ -323,6 +325,13 @@ void VideoCaptureManager::HandleQueuedStartRequest() {
DCHECK(entry_it != devices_.end());
DeviceEntry* entry = (*entry_it);
+ media::VideoCaptureParams params = request->params();
+#if defined(OS_LINUX)
+ params.use_native_gpu_memory_buffers =
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kUseNativeGpuMemoryBuffersForCapture);
+#endif
+
DVLOG(3) << "HandleQueuedStartRequest, Post start to device thread, device = "
<< entry->id << " start id = " << entry->serial_id;
base::PostTaskAndReplyWithResult(
@@ -334,7 +343,7 @@ void VideoCaptureManager::HandleQueuedStartRequest() {
request->session_id(),
entry->id,
entry->stream_type,
- request->params(),
+ params,
base::Passed(entry->video_capture_controller()->NewDeviceClient(
device_task_runner_))),
base::Bind(&VideoCaptureManager::OnDeviceStarted, this,
« no previous file with comments | « content/browser/renderer_host/media/video_capture_controller.cc ('k') | content/common/media/media_param_traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698