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

Unified Diff: content/renderer/media/webmediaplayer_impl.cc

Issue 312803002: Android media: VideoFrame should not store so many sync points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use WeakPtr and Correct video_capture_controller.cc Created 6 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/renderer/media/webmediaplayer_impl.cc
diff --git a/content/renderer/media/webmediaplayer_impl.cc b/content/renderer/media/webmediaplayer_impl.cc
index 9e22d4f72b7d0fca5c6e52e8d4e538f7cc61f1bc..e01bdc07b4fa16ba9289809b7b66872eaafea872 100644
--- a/content/renderer/media/webmediaplayer_impl.cc
+++ b/content/renderer/media/webmediaplayer_impl.cc
@@ -118,6 +118,23 @@ const double kMaxRate = 16.0;
// Prefix for histograms related to Encrypted Media Extensions.
const char* kMediaEme = "Media.EME.";
+class SyncPointClientImpl : public media::VideoFrame::SyncPointClient {
+ public:
+ explicit SyncPointClientImpl(
+ blink::WebGraphicsContext3D* web_graphics_context)
+ : web_graphics_context_(web_graphics_context) {}
+ virtual ~SyncPointClientImpl() {}
+ virtual uint32 InsertSyncPoint() {
+ return web_graphics_context_->insertSyncPoint();
+ }
+ virtual void WaitSyncPoint(uint32 sync_point) {
+ web_graphics_context_->waitSyncPoint(sync_point);
+ }
+
+ private:
+ blink::WebGraphicsContext3D* web_graphics_context_;
+};
+
} // namespace
namespace content {
@@ -651,7 +668,9 @@ bool WebMediaPlayerImpl::copyVideoTextureToPlatformTexture(
web_graphics_context->deleteTexture(source_texture);
web_graphics_context->flush();
- video_frame->AppendReleaseSyncPoint(web_graphics_context->insertSyncPoint());
+
+ SyncPointClientImpl client(web_graphics_context);
+ video_frame->UpdateReleaseSyncPoint(&client);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698