OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <GLES2/gl2.h> | 5 #include <GLES2/gl2.h> |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "chrome/renderer/ggl/ggl.h" | 8 #include "chrome/renderer/ggl/ggl.h" |
9 #include "chrome/renderer/media/gles2_video_decode_context.h" | 9 #include "chrome/renderer/media/gles2_video_decode_context.h" |
10 | 10 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 for (size_t i = 0; i < frames_.size(); ++i) { | 92 for (size_t i = 0; i < frames_.size(); ++i) { |
93 for (size_t j = 0; j < frames_[i]->planes(); ++j) { | 93 for (size_t j = 0; j < frames_[i]->planes(); ++j) { |
94 media::VideoFrame::GlTexture texture = frames_[i]->gl_texture(j); | 94 media::VideoFrame::GlTexture texture = frames_[i]->gl_texture(j); |
95 glDeleteTextures(1, &texture); | 95 glDeleteTextures(1, &texture); |
96 } | 96 } |
97 } | 97 } |
98 frames_.clear(); | 98 frames_.clear(); |
99 } | 99 } |
100 | 100 |
101 void Gles2VideoDecodeContext::UploadToVideoFrame( | 101 void Gles2VideoDecodeContext::ConvertToVideoFrame( |
102 void* buffer, scoped_refptr<media::VideoFrame> frame, Task* task) { | 102 void* buffer, scoped_refptr<media::VideoFrame> frame, Task* task) { |
103 DCHECK(memory_mapped_); | 103 DCHECK(memory_mapped_); |
104 // TODO(hclam): Implement. | 104 // TODO(hclam): Implement. |
105 } | 105 } |
106 | 106 |
107 void Gles2VideoDecodeContext::Destroy(Task* task) { | 107 void Gles2VideoDecodeContext::Destroy(Task* task) { |
108 if (MessageLoop::current() != message_loop_) { | 108 if (MessageLoop::current() != message_loop_) { |
109 message_loop_->PostTask( | 109 message_loop_->PostTask( |
110 FROM_HERE, | 110 FROM_HERE, |
111 NewRunnableMethod(this, &Gles2VideoDecodeContext::Destroy, task)); | 111 NewRunnableMethod(this, &Gles2VideoDecodeContext::Destroy, task)); |
112 return; | 112 return; |
113 } | 113 } |
114 | 114 |
115 ReleaseAllVideoFrames(); | 115 ReleaseAllVideoFrames(); |
116 DCHECK_EQ(0u, frames_.size()); | 116 DCHECK_EQ(0u, frames_.size()); |
117 | 117 |
118 task->Run(); | 118 task->Run(); |
119 delete task; | 119 delete task; |
120 } | 120 } |
121 | 121 |
122 DISABLE_RUNNABLE_METHOD_REFCOUNT(Gles2VideoDecodeContext); | 122 DISABLE_RUNNABLE_METHOD_REFCOUNT(Gles2VideoDecodeContext); |
OLD | NEW |