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

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

Issue 1157193002: RESOURCE_UTILIZATION in VideoFrameMetadata, a consumer feedback signal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@video_frame_done_callback
Patch Set: Addressed hubbe's round 2 comments, and REBASE. 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_host.cc
diff --git a/content/browser/renderer_host/media/video_capture_host.cc b/content/browser/renderer_host/media/video_capture_host.cc
index a546bbd26ab14525d51415b604b25d39942d9fad..b44e132cf7b5adfa5cf0805f4f66dfbc1160070e 100644
--- a/content/browser/renderer_host/media/video_capture_host.cc
+++ b/content/browser/renderer_host/media/video_capture_host.cc
@@ -159,7 +159,8 @@ bool VideoCaptureHost::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_Pause, OnPauseCapture)
IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_Resume, OnResumeCapture)
IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_Stop, OnStopCapture)
- IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_BufferReady, OnReceiveEmptyBuffer)
+ IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_BufferReady,
+ OnRendererFinishedWithBuffer)
IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_GetDeviceSupportedFormats,
OnGetDeviceSupportedFormats)
IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_GetDeviceFormatsInUse,
@@ -272,17 +273,24 @@ void VideoCaptureHost::OnResumeCapture(
}
}
-void VideoCaptureHost::OnReceiveEmptyBuffer(int device_id,
- int buffer_id,
- uint32 sync_point) {
+void VideoCaptureHost::OnRendererFinishedWithBuffer(
+ int device_id,
+ int buffer_id,
+ uint32 sync_point,
+ double consumer_resource_utilization) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
VideoCaptureControllerID controller_id(device_id);
EntryMap::iterator it = entries_.find(controller_id);
if (it != entries_.end()) {
const base::WeakPtr<VideoCaptureController>& controller = it->second;
- if (controller)
- controller->ReturnBuffer(controller_id, this, buffer_id, sync_point);
+ if (controller) {
+ controller->ReturnBuffer(controller_id,
+ this,
+ buffer_id,
+ sync_point,
+ consumer_resource_utilization);
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698