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

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

Issue 9416087: Add texture target field to video frame (for use by native textures). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (c) 2011 -> (c) 2012 Created 8 years, 10 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
« no previous file with comments | « content/renderer/media/renderer_gpu_video_decoder_factories.h ('k') | media/base/video_frame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/renderer_gpu_video_decoder_factories.cc
diff --git a/content/renderer/media/renderer_gpu_video_decoder_factories.cc b/content/renderer/media/renderer_gpu_video_decoder_factories.cc
index 4d27d59fb6a83d2ccc48a046c59a242ade76ef62..e79834db313b05b15aa0e92aa42103d16cbc9e11 100644
--- a/content/renderer/media/renderer_gpu_video_decoder_factories.cc
+++ b/content/renderer/media/renderer_gpu_video_decoder_factories.cc
@@ -48,19 +48,21 @@ void RendererGpuVideoDecoderFactories::AsyncCreateVideoDecodeAccelerator(
}
bool RendererGpuVideoDecoderFactories::CreateTextures(
- int32 count, const gfx::Size& size, std::vector<uint32>* texture_ids) {
+ int32 count, const gfx::Size& size,
+ std::vector<uint32>* texture_ids,
+ uint32* texture_target) {
bool success = false;
base::WaitableEvent waiter(false, false);
message_loop_->PostTask(FROM_HERE, base::Bind(
&RendererGpuVideoDecoderFactories::AsyncCreateTextures, this,
- count, size, texture_ids, &success, &waiter));
+ count, size, texture_ids, texture_target, &success, &waiter));
waiter.Wait();
return success;
}
void RendererGpuVideoDecoderFactories::AsyncCreateTextures(
int32 count, const gfx::Size& size, std::vector<uint32>* texture_ids,
- bool* success, base::WaitableEvent* waiter) {
+ uint32* texture_target, bool* success, base::WaitableEvent* waiter) {
if (!context_) {
*success = false;
waiter->Signal();
@@ -69,15 +71,16 @@ void RendererGpuVideoDecoderFactories::AsyncCreateTextures(
gpu::gles2::GLES2Implementation* gles2 = context_->GetImplementation();
texture_ids->resize(count);
gles2->GenTextures(count, &texture_ids->at(0));
+ *texture_target = GL_TEXTURE_2D;
for (int i = 0; i < count; ++i) {
gles2->ActiveTexture(GL_TEXTURE0);
uint32 texture_id = texture_ids->at(i);
- gles2->BindTexture(GL_TEXTURE_2D, texture_id);
- gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- gles2->TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- gles2->TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- gles2->TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, size.width(), size.height(),
+ gles2->BindTexture(*texture_target, texture_id);
+ gles2->TexParameteri(*texture_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ gles2->TexParameteri(*texture_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ gles2->TexParameterf(*texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ gles2->TexParameterf(*texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ gles2->TexImage2D(*texture_target, 0, GL_RGBA, size.width(), size.height(),
0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
// We need a glFlush here to guarantee the decoder (in the GPU process) can
« no previous file with comments | « content/renderer/media/renderer_gpu_video_decoder_factories.h ('k') | media/base/video_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698