OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/android/stream_texture_factory_impl.h" | 5 #include "content/renderer/media/android/stream_texture_factory_impl.h" |
6 | 6 |
7 #include "cc/output/context_provider.h" | 7 #include "cc/output/context_provider.h" |
8 #include "content/common/gpu/client/gpu_channel_host.h" | 8 #include "content/common/gpu/client/gpu_channel_host.h" |
9 #include "content/common/gpu/gpu_messages.h" | 9 #include "content/common/gpu/gpu_messages.h" |
10 #include "content/renderer/gpu/stream_texture_host_android.h" | 10 #include "content/renderer/gpu/stream_texture_host_android.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 StreamTextureHost* host = new StreamTextureHost(channel_.get()); | 133 StreamTextureHost* host = new StreamTextureHost(channel_.get()); |
134 return new StreamTextureProxyImpl(host); | 134 return new StreamTextureProxyImpl(host); |
135 } | 135 } |
136 | 136 |
137 void StreamTextureFactoryImpl::EstablishPeer(int32 stream_id, int player_id) { | 137 void StreamTextureFactoryImpl::EstablishPeer(int32 stream_id, int player_id) { |
138 DCHECK(channel_.get()); | 138 DCHECK(channel_.get()); |
139 channel_->Send( | 139 channel_->Send( |
140 new GpuStreamTextureMsg_EstablishPeer(stream_id, frame_id_, player_id)); | 140 new GpuStreamTextureMsg_EstablishPeer(stream_id, frame_id_, player_id)); |
141 } | 141 } |
142 | 142 |
143 unsigned StreamTextureFactoryImpl::CreateStreamTexture( | 143 int32 StreamTextureFactoryImpl::CreateStreamTexture( |
144 unsigned texture_target, | 144 unsigned texture_target, |
145 unsigned* texture_id, | 145 unsigned* texture_id, |
146 gpu::Mailbox* texture_mailbox) { | 146 gpu::Mailbox* texture_mailbox) { |
147 GLuint stream_id = 0; | 147 int32 stream_id = 0; |
148 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); | 148 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); |
149 gl->GenTextures(1, texture_id); | 149 gl->GenTextures(1, texture_id); |
150 | 150 |
151 stream_id = gl->CreateStreamTextureCHROMIUM(*texture_id); | 151 stream_id = gl->CreateStreamTextureCHROMIUM(*texture_id); |
152 | 152 |
153 gl->GenMailboxCHROMIUM(texture_mailbox->name); | 153 gl->GenMailboxCHROMIUM(texture_mailbox->name); |
154 gl->ProduceTextureDirectCHROMIUM( | 154 gl->ProduceTextureDirectCHROMIUM( |
155 *texture_id, texture_target, texture_mailbox->name); | 155 *texture_id, texture_target, texture_mailbox->name); |
156 return stream_id; | 156 return stream_id; |
157 } | 157 } |
158 | 158 |
159 void StreamTextureFactoryImpl::SetStreamTextureSize(int32 stream_id, | |
160 const gfx::Size& size) { | |
161 channel_->Send(new GpuStreamTextureMsg_SetSize(stream_id, size)); | |
162 } | |
163 | |
164 gpu::gles2::GLES2Interface* StreamTextureFactoryImpl::ContextGL() { | 159 gpu::gles2::GLES2Interface* StreamTextureFactoryImpl::ContextGL() { |
165 return context_provider_->ContextGL(); | 160 return context_provider_->ContextGL(); |
166 } | 161 } |
167 | 162 |
168 void StreamTextureFactoryImpl::AddObserver( | 163 void StreamTextureFactoryImpl::AddObserver( |
169 StreamTextureFactoryContextObserver* obs) { | 164 StreamTextureFactoryContextObserver* obs) { |
170 } | 165 } |
171 | 166 |
172 void StreamTextureFactoryImpl::RemoveObserver( | 167 void StreamTextureFactoryImpl::RemoveObserver( |
173 StreamTextureFactoryContextObserver* obs) { | 168 StreamTextureFactoryContextObserver* obs) { |
174 } | 169 } |
175 | 170 |
176 } // namespace content | 171 } // namespace content |
OLD | NEW |