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

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

Issue 1427543002: Modified old wait sync point functions to also accept new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mock gpu video accelerator factory Created 5 years, 2 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_controller.cc
diff --git a/content/browser/renderer_host/media/video_capture_controller.cc b/content/browser/renderer_host/media/video_capture_controller.cc
index 53c2110d80701867f525d1c968d85a0d1414c226..e56c88be433a1117774f27cccc195f82544afbc6 100644
--- a/content/browser/renderer_host/media/video_capture_controller.cc
+++ b/content/browser/renderer_host/media/video_capture_controller.cc
@@ -46,8 +46,9 @@ class SyncPointClientImpl : public VideoFrame::SyncPointClient {
explicit SyncPointClientImpl(GLHelper* gl_helper) : gl_helper_(gl_helper) {}
~SyncPointClientImpl() override {}
uint32 InsertSyncPoint() override { return gl_helper_->InsertSyncPoint(); }
- void WaitSyncPoint(uint32 sync_point) override {
- gl_helper_->WaitSyncPoint(sync_point);
+ void WaitSyncPoint(uint32 sync_point,
+ const gpu::SyncToken& sync_token) override {
+ gl_helper_->WaitSyncPoint(sync_point, sync_token);
}
private:
@@ -55,7 +56,8 @@ class SyncPointClientImpl : public VideoFrame::SyncPointClient {
};
void ReturnVideoFrame(const scoped_refptr<VideoFrame>& video_frame,
- uint32 sync_point) {
+ uint32 sync_point,
+ const gpu::SyncToken& sync_token) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
#if defined(OS_ANDROID)
NOTREACHED();
@@ -64,7 +66,7 @@ void ReturnVideoFrame(const scoped_refptr<VideoFrame>& video_frame,
// UpdateReleaseSyncPoint() creates a new sync_point using |gl_helper|, so
// wait the given |sync_point| using |gl_helper|.
if (gl_helper) {
- gl_helper->WaitSyncPoint(sync_point);
+ gl_helper->WaitSyncPoint(sync_point, sync_token);
SyncPointClientImpl client(gl_helper);
video_frame->UpdateReleaseSyncPoint(&client);
}
@@ -254,6 +256,7 @@ void VideoCaptureController::ReturnBuffer(
VideoCaptureControllerEventHandler* event_handler,
int buffer_id,
uint32 sync_point,
+ const gpu::SyncToken& sync_token,
double consumer_resource_utilization) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
@@ -293,11 +296,12 @@ void VideoCaptureController::ReturnBuffer(
#if defined(OS_ANDROID)
DCHECK_EQ(0u, sync_point);
+ DCHECK_FALSE(sync_token.HasData());
#endif
if (sync_point)
- BrowserThread::PostTask(BrowserThread::UI,
- FROM_HERE,
- base::Bind(&ReturnVideoFrame, frame, sync_point));
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(&ReturnVideoFrame, frame, sync_point, sync_token));
}
const media::VideoCaptureFormat&

Powered by Google App Engine
This is Rietveld 408576698