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

Unified Diff: content/renderer/media/android/webmediaplayer_android.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: Fix ios build Created 6 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 | « content/content_tests.gypi ('k') | content/renderer/media/rtc_video_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/android/webmediaplayer_android.cc
diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc
index 419aee199185af9de76345e7e2d198f60385c2f0..13f2660213d63fad1c72f91d7ac147055030f4c4 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -72,12 +72,29 @@ const char* kMediaEme = "Media.EME.";
void OnReleaseTexture(
const scoped_refptr<content::StreamTextureFactory>& factories,
uint32 texture_id,
- const std::vector<uint32>& release_sync_points) {
+ uint32 release_sync_point) {
GLES2Interface* gl = factories->ContextGL();
- for (size_t i = 0; i < release_sync_points.size(); i++)
- gl->WaitSyncPointCHROMIUM(release_sync_points[i]);
+ gl->WaitSyncPointCHROMIUM(release_sync_point);
gl->DeleteTextures(1, &texture_id);
}
+
+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() OVERRIDE {
+ return web_graphics_context_->insertSyncPoint();
+ }
+ virtual void WaitSyncPoint(uint32 sync_point) OVERRIDE {
+ web_graphics_context_->waitSyncPoint(sync_point);
+ }
+
+ private:
+ blink::WebGraphicsContext3D* web_graphics_context_;
+};
+
} // namespace
namespace content {
@@ -539,7 +556,9 @@ bool WebMediaPlayerAndroid::copyVideoTextureToPlatformTexture(
web_graphics_context->bindTexture(GL_TEXTURE_2D, texture);
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;
}
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/media/rtc_video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698