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

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

Issue 14199002: Send hardware video frames with mailboxes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No ifdefs Created 7 years, 8 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/stream_texture_factory_impl_android.cc
diff --git a/content/renderer/media/stream_texture_factory_impl_android.cc b/content/renderer/media/stream_texture_factory_impl_android.cc
index 355519f2738aa2ef641c5d4b99f11641c169294e..b444742f78fa89dbafc55cc2b5a69997223ccc69 100644
--- a/content/renderer/media/stream_texture_factory_impl_android.cc
+++ b/content/renderer/media/stream_texture_factory_impl_android.cc
@@ -116,19 +116,37 @@ void StreamTextureFactoryImpl::EstablishPeer(int stream_id, int player_id) {
stream_id, view_id_, player_id));
}
-unsigned StreamTextureFactoryImpl::CreateStreamTexture(unsigned* texture_id) {
+unsigned StreamTextureFactoryImpl::CreateStreamTexture(
+ unsigned texture_target,
+ unsigned* texture_id,
+ gpu::Mailbox* texture_mailbox,
+ unsigned* texture_mailbox_sync_point) {
unsigned stream_id = 0;
if (context_->makeContextCurrent()) {
*texture_id = context_->createTexture();
+ context_->genMailboxCHROMIUM(texture_mailbox->name);
+ context_->bindTexture(texture_target, *texture_id);
+ context_->produceTextureCHROMIUM(texture_target, texture_mailbox->name);
+ *texture_mailbox_sync_point = context_->insertSyncPoint();
no sievers 2013/04/18 17:37:08 You'll have to move this after createStreamTexture
danakj 2013/04/19 18:03:52 Ok done, but I still am getting black output for t
no sievers 2013/04/19 18:12:07 Not sure where the flush in the code comes from, c
+
stream_id = context_->createStreamTextureCHROMIUM(*texture_id);
context_->flush();
}
return stream_id;
}
-void StreamTextureFactoryImpl::DestroyStreamTexture(unsigned texture_id) {
+void StreamTextureFactoryImpl::DestroyStreamTexture(
+ unsigned texture_target,
+ unsigned texture_id,
+ const gpu::Mailbox& texture_mailbox,
+ unsigned texture_mailbox_sync_point) {
if (context_->makeContextCurrent()) {
context_->destroyStreamTextureCHROMIUM(texture_id);
+
+ if (texture_mailbox_sync_point)
+ context_->waitSyncPoint(texture_mailbox_sync_point);
+ context_->bindTexture(texture_target, texture_id);
+ context_->consumeTextureCHROMIUM(texture_target, texture_mailbox.name);
context_->deleteTexture(texture_id);
context_->flush();
}

Powered by Google App Engine
This is Rietveld 408576698