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

Unified Diff: cc/resources/video_resource_updater.cc

Issue 175223003: HW Video: Make media::VideoFrame handle the sync point of the compositor as well as webgl (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Add WaitSyncPoint in WMPImpl::paint(...) Created 6 years, 10 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: cc/resources/video_resource_updater.cc
diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc
index b170be6784b2a443978d6d2fcc94782fb7a4fe2d..50afdd2ef18446153460b20d9fd1afa39cb04379 100644
--- a/cc/resources/video_resource_updater.cc
+++ b/cc/resources/video_resource_updater.cc
@@ -310,10 +310,20 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes(
return external_resources;
}
-static void ReturnTexture(const scoped_refptr<media::VideoFrame>& frame,
- uint32 sync_point,
- bool lost_resource) {
- frame->mailbox_holder()->sync_point = sync_point;
+// static
+void VideoResourceUpdater::ReturnTexture(
+ base::WeakPtr<VideoResourceUpdater> updater,
+ const scoped_refptr<media::VideoFrame>& frame,
+ uint32 sync_point,
+ bool lost_resource) {
+ uint32 previous_sync_point = frame->SwapReleaseSyncPoint(sync_point);
+ // TODO(dshwang): |updater| can be deleted while ResourceProvider keeps
+ // this mailbox. If below code causes critical issue, ResourceProvider
danakj 2014/02/28 21:47:03 This is kinda ugly.. and since cc is giving the re
dshwang 2014/02/28 21:54:17 Yeah, I agree. your idea is better. I'll change Vi
+ // can provide ContextProvider* like |sync_point|.
+ if (updater && previous_sync_point) {
+ gpu::gles2::GLES2Interface* gl = updater->context_provider_->ContextGL();
+ GLC(gl, gl->WaitSyncPointCHROMIUM(previous_sync_point));
danakj 2014/02/28 21:47:03 This is inverted, you'd need to wait on the existi
dshwang 2014/02/28 21:54:17 Thank you for explanation. After VideoFrame keep m
+ }
}
VideoFrameExternalResources VideoResourceUpdater::CreateForHardwarePlanes(
@@ -350,7 +360,7 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForHardwarePlanes(
mailbox_holder->texture_target,
mailbox_holder->sync_point));
external_resources.release_callbacks.push_back(
- base::Bind(&ReturnTexture, video_frame));
+ base::Bind(&ReturnTexture, AsWeakPtr(), video_frame));
return external_resources;
}
« no previous file with comments | « cc/resources/video_resource_updater.h ('k') | content/renderer/media/renderer_gpu_video_accelerator_factories.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698