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

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: Address danakj@'s concern 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/android/webmediaplayer_android.cc
diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc
index 983354691660172779f851bc1588b26dcd00f485..b9e25c0ff6cfb5c08c6e0252d962d21b3f554608 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -72,12 +72,36 @@ 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 SyncPointProviderImpl : public media::VideoFrame::SyncPointProvider {
+ public:
+ explicit SyncPointProviderImpl(
+ blink::WebGraphicsContext3D* web_graphics_context)
+ : web_graphics_context_(web_graphics_context) {}
+ virtual ~SyncPointProviderImpl();
+ virtual uint32 InsertSyncPoint();
danakj 2014/06/19 15:56:26 since you're in the .cc you could define these met
dshwang 2014/06/23 18:33:20 Done.
+ virtual void WaitSyncPoint(uint32 sync_point);
+
+ private:
+ blink::WebGraphicsContext3D* web_graphics_context_;
+};
+
+SyncPointProviderImpl::~SyncPointProviderImpl() {
+}
+
+uint32 SyncPointProviderImpl::InsertSyncPoint() {
+ return web_graphics_context_->insertSyncPoint();
+}
+
+void SyncPointProviderImpl::WaitSyncPoint(uint32 sync_point) {
+ web_graphics_context_->waitSyncPoint(sync_point);
+}
+
} // namespace
namespace content {
@@ -539,7 +563,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());
+
+ SyncPointProviderImpl provider(web_graphics_context);
+ video_frame->UpdateReleaseSyncPoint(provider);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698