glx_renderer.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef TEST_LINUX_GLX_RENDERER_H_
  11. #define TEST_LINUX_GLX_RENDERER_H_
  12. #include <GL/glx.h>
  13. #include <X11/X.h>
  14. #include <X11/Xlib.h>
  15. #include <stddef.h>
  16. #include "api/video/video_frame.h"
  17. #include "test/gl/gl_renderer.h"
  18. namespace webrtc {
  19. namespace test {
  20. class GlxRenderer : public GlRenderer {
  21. public:
  22. static GlxRenderer* Create(const char* window_title,
  23. size_t width,
  24. size_t height);
  25. virtual ~GlxRenderer();
  26. void OnFrame(const webrtc::VideoFrame& frame) override;
  27. private:
  28. GlxRenderer(size_t width, size_t height);
  29. bool Init(const char* window_title);
  30. void Resize(size_t width, size_t height);
  31. void Destroy();
  32. size_t width_, height_;
  33. Display* display_;
  34. Window window_;
  35. GLXContext context_;
  36. };
  37. } // namespace test
  38. } // namespace webrtc
  39. #endif // TEST_LINUX_GLX_RENDERER_H_