Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/media/stream_texture_factory_impl_android.h" | 5 #include "content/renderer/media/stream_texture_factory_impl_android.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 StreamTextureHost* host = new StreamTextureHost(channel_.get()); | 109 StreamTextureHost* host = new StreamTextureHost(channel_.get()); |
| 110 return new StreamTextureProxyImpl(host); | 110 return new StreamTextureProxyImpl(host); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void StreamTextureFactoryImpl::EstablishPeer(int stream_id, int player_id) { | 113 void StreamTextureFactoryImpl::EstablishPeer(int stream_id, int player_id) { |
| 114 DCHECK(channel_.get()); | 114 DCHECK(channel_.get()); |
| 115 channel_->Send(new GpuChannelMsg_EstablishStreamTexture( | 115 channel_->Send(new GpuChannelMsg_EstablishStreamTexture( |
| 116 stream_id, view_id_, player_id)); | 116 stream_id, view_id_, player_id)); |
| 117 } | 117 } |
| 118 | 118 |
| 119 unsigned StreamTextureFactoryImpl::CreateStreamTexture(unsigned* texture_id) { | 119 unsigned StreamTextureFactoryImpl::CreateStreamTexture( |
| 120 unsigned texture_target, | |
| 121 unsigned* texture_id, | |
| 122 gpu::Mailbox* texture_mailbox, | |
| 123 unsigned* texture_mailbox_sync_point) { | |
| 120 unsigned stream_id = 0; | 124 unsigned stream_id = 0; |
| 121 if (context_->makeContextCurrent()) { | 125 if (context_->makeContextCurrent()) { |
| 122 *texture_id = context_->createTexture(); | 126 *texture_id = context_->createTexture(); |
| 127 context_->genMailboxCHROMIUM(texture_mailbox->name); | |
| 128 context_->bindTexture(texture_target, *texture_id); | |
| 129 context_->produceTextureCHROMIUM(texture_target, texture_mailbox->name); | |
| 130 *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
| |
| 131 | |
| 123 stream_id = context_->createStreamTextureCHROMIUM(*texture_id); | 132 stream_id = context_->createStreamTextureCHROMIUM(*texture_id); |
| 124 context_->flush(); | 133 context_->flush(); |
| 125 } | 134 } |
| 126 return stream_id; | 135 return stream_id; |
| 127 } | 136 } |
| 128 | 137 |
| 129 void StreamTextureFactoryImpl::DestroyStreamTexture(unsigned texture_id) { | 138 void StreamTextureFactoryImpl::DestroyStreamTexture( |
| 139 unsigned texture_target, | |
| 140 unsigned texture_id, | |
| 141 const gpu::Mailbox& texture_mailbox, | |
| 142 unsigned texture_mailbox_sync_point) { | |
| 130 if (context_->makeContextCurrent()) { | 143 if (context_->makeContextCurrent()) { |
| 131 context_->destroyStreamTextureCHROMIUM(texture_id); | 144 context_->destroyStreamTextureCHROMIUM(texture_id); |
| 145 | |
| 146 if (texture_mailbox_sync_point) | |
| 147 context_->waitSyncPoint(texture_mailbox_sync_point); | |
| 148 context_->bindTexture(texture_target, texture_id); | |
| 149 context_->consumeTextureCHROMIUM(texture_target, texture_mailbox.name); | |
| 132 context_->deleteTexture(texture_id); | 150 context_->deleteTexture(texture_id); |
| 133 context_->flush(); | 151 context_->flush(); |
| 134 } | 152 } |
| 135 } | 153 } |
| 136 | 154 |
| 137 } // namespace content | 155 } // namespace content |
| OLD | NEW |