summaryrefslogtreecommitdiffstats
path: root/media/tools/player_x11/gl_video_renderer.h
blob: 2ecdc0badd8c688f275b540d6ba0b35a419b962c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MEDIA_TOOLS_PLAYER_X11_GL_VIDEO_RENDERER_H_
#define MEDIA_TOOLS_PLAYER_X11_GL_VIDEO_RENDERER_H_

#include "base/basictypes.h"
#include "ui/gfx/gl/gl_bindings.h"

class MessageLoop;

namespace media {
class VideoFrame;
}

class GlVideoRenderer {
 public:
  GlVideoRenderer(Display* display, Window window);
  ~GlVideoRenderer();

  void Paint(media::VideoFrame* video_frame);

 private:
  // Initializes GL rendering for the given dimensions.
  void Initialize(int width, int height);

  Display* display_;
  Window window_;

  // GL context.
  GLXContext gl_context_;

  // 3 textures, one for each plane.
  GLuint textures_[3];

  DISALLOW_COPY_AND_ASSIGN(GlVideoRenderer);
};

#endif  // MEDIA_TOOLS_PLAYER_X11_GL_VIDEO_RENDERER_H_