OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "media/tools/player_x11/gl_video_renderer.h" | 5 #include "media/tools/player_x11/gl_video_renderer.h" |
6 | 6 |
7 #include <X11/Xutil.h> | 7 #include <X11/Xutil.h> |
8 | 8 |
9 #include "app/gfx/gl/gl_implementation.h" | |
10 #include "media/base/buffers.h" | 9 #include "media/base/buffers.h" |
11 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
12 #include "media/base/yuv_convert.h" | 11 #include "media/base/yuv_convert.h" |
| 12 #include "ui/gfx/gl/gl_implementation.h" |
13 | 13 |
14 GlVideoRenderer* GlVideoRenderer::instance_ = NULL; | 14 GlVideoRenderer* GlVideoRenderer::instance_ = NULL; |
15 | 15 |
16 GlVideoRenderer::GlVideoRenderer(Display* display, Window window, | 16 GlVideoRenderer::GlVideoRenderer(Display* display, Window window, |
17 MessageLoop* message_loop) | 17 MessageLoop* message_loop) |
18 : display_(display), | 18 : display_(display), |
19 window_(window), | 19 window_(window), |
20 gl_context_(NULL), | 20 gl_context_(NULL), |
21 glx_thread_message_loop_(message_loop) { | 21 glx_thread_message_loop_(message_loop) { |
22 } | 22 } |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 glActiveTexture(GL_TEXTURE0 + i); | 270 glActiveTexture(GL_TEXTURE0 + i); |
271 glPixelStorei(GL_UNPACK_ROW_LENGTH, video_frame->stride(i)); | 271 glPixelStorei(GL_UNPACK_ROW_LENGTH, video_frame->stride(i)); |
272 glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, width, height, 0, | 272 glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, width, height, 0, |
273 GL_LUMINANCE, GL_UNSIGNED_BYTE, video_frame->data(i)); | 273 GL_LUMINANCE, GL_UNSIGNED_BYTE, video_frame->data(i)); |
274 } | 274 } |
275 PutCurrentFrame(video_frame); | 275 PutCurrentFrame(video_frame); |
276 | 276 |
277 glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); | 277 glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); |
278 glXSwapBuffers(display_, window_); | 278 glXSwapBuffers(display_, window_); |
279 } | 279 } |
OLD | NEW |