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

Unified Diff: content/browser/media/capture/web_contents_video_capture_device.cc

Issue 1199593005: Automatic resolution throttling for screen capture pipeline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@resolution_chooser_ITEM13
Patch Set: Move all end_t assignments out of for-loop init. Created 5 years, 5 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
« no previous file with comments | « no previous file | media/capture/screen_capture_device_core.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/capture/web_contents_video_capture_device.cc
diff --git a/content/browser/media/capture/web_contents_video_capture_device.cc b/content/browser/media/capture/web_contents_video_capture_device.cc
index ee38535596575280abebbd4a9b34aa34726a105f..59636a03d8b3f989625b8e80f46f2aae6d6fb2ae 100644
--- a/content/browser/media/capture/web_contents_video_capture_device.cc
+++ b/content/browser/media/capture/web_contents_video_capture_device.cc
@@ -211,6 +211,9 @@ class WebContentsCaptureMachine : public media::VideoCaptureMachine {
const media::VideoCaptureParams& params,
const base::Callback<void(bool)> callback) override;
void Stop(const base::Closure& callback) override;
+ bool IsAutoThrottlingEnabled() const override {
+ return auto_throttling_enabled_;
+ }
// Starts a copy from the backing store or the composited surface. Must be run
// on the UI BrowserThread. |deliver_frame_cb| will be run when the operation
@@ -263,6 +266,11 @@ class WebContentsCaptureMachine : public media::VideoCaptureMachine {
// capture on the correct RenderWidgetHost.
const scoped_refptr<WebContentsTracker> tracker_;
+ // Set to false to prevent the capture size from automatically adjusting in
+ // response to end-to-end utilization. This is enabled via the throttling
+ // option in the WebContentsVideoCaptureDevice device ID.
+ const bool auto_throttling_enabled_;
+
// A dedicated worker thread on which SkBitmap->VideoFrame conversion will
// occur. Only used when this activity cannot be done on the GPU.
scoped_ptr<base::Thread> render_thread_;
@@ -484,13 +492,11 @@ WebContentsCaptureMachine::WebContentsCaptureMachine(
: initial_render_process_id_(render_process_id),
initial_main_render_frame_id_(main_render_frame_id),
tracker_(new WebContentsTracker(true)),
+ auto_throttling_enabled_(enable_auto_throttling),
weak_ptr_factory_(this) {
- // TODO(miu): Use |enable_auto_throttling| to enable/disable the automatic
- // video resolution changes based on resource utilization.
- // http://crbug.com/156767.
DVLOG(1) << "Created WebContentsCaptureMachine for "
<< render_process_id << ':' << main_render_frame_id
- << (enable_auto_throttling ? " with auto-throttling enabled" : "");
+ << (auto_throttling_enabled_ ? " with auto-throttling enabled" : "");
}
WebContentsCaptureMachine::~WebContentsCaptureMachine() {}
« no previous file with comments | « no previous file | media/capture/screen_capture_device_core.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698