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

Unified Diff: content/renderer/media/android/stream_texture_factory_android.cc

Issue 14199002: Send hardware video frames with mailboxes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: video-mailbox: virtualandroid Created 7 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/stream_texture_factory_android.cc
diff --git a/content/renderer/media/android/stream_texture_factory_android.cc b/content/renderer/media/android/stream_texture_factory_android.cc
index de739786df5f42e08da379c713162e7b0f5e1515..67f33f069134313b6184ad9082769117a22e72d0 100644
--- a/content/renderer/media/android/stream_texture_factory_android.cc
+++ b/content/renderer/media/android/stream_texture_factory_android.cc
@@ -73,18 +73,30 @@ void StreamTextureFactory::EstablishPeer(int stream_id, int player_id) {
new GpuChannelMsg_EstablishStreamTexture(stream_id, view_id_, player_id));
}
-unsigned StreamTextureFactory::CreateStreamTexture(unsigned* texture_id) {
+unsigned StreamTextureFactory::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();
stream_id = context_->createStreamTextureCHROMIUM(*texture_id);
+
+ context_->genMailboxCHROMIUM(texture_mailbox->name);
+ context_->bindTexture(texture_target, *texture_id);
+ context_->produceTextureCHROMIUM(texture_target, texture_mailbox->name);
+
context_->flush();
+ *texture_mailbox_sync_point = context_->insertSyncPoint();
}
return stream_id;
}
void StreamTextureFactory::DestroyStreamTexture(unsigned texture_id) {
if (context_->makeContextCurrent()) {
+ // TODO(sievers): Make the destroyStreamTexture implicit when the last
+ // texture referencing it is lost.
context_->destroyStreamTextureCHROMIUM(texture_id);
context_->deleteTexture(texture_id);
context_->flush();

Powered by Google App Engine
This is Rietveld 408576698