ijksdl_egl.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright (c) 2016 Bilibili
  3. * copyright (c) 2016 Zhang Rui <bbcallen@gmail.com>
  4. *
  5. * This file is part of ijkPlayer.
  6. *
  7. * ijkPlayer is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * ijkPlayer is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with ijkPlayer; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #ifndef IJKSDL__IJKSDL_EGL_H
  22. #define IJKSDL__IJKSDL_EGL_H
  23. #ifdef __APPLE__
  24. #include "ijksdl/ios/EGL/egl.h"
  25. #include "ijksdl/ios/EGL/eglplatform.h"
  26. #else
  27. #include <EGL/egl.h>
  28. #include <EGL/eglext.h>
  29. #include <EGL/eglplatform.h>
  30. #endif
  31. #include "ijksdl_class.h"
  32. typedef struct SDL_VoutOverlay SDL_VoutOverlay;
  33. typedef struct IJK_EGL_Opaque IJK_EGL_Opaque;
  34. #if 0
  35. enum {
  36. IJK_GLES2__GL_EXT_texture_rg,
  37. IJK_GLES2__MAX_EXT,
  38. };
  39. #endif
  40. typedef struct IJK_EGL
  41. {
  42. SDL_Class *opaque_class;
  43. IJK_EGL_Opaque *opaque;
  44. EGLNativeWindowType window;
  45. EGLDisplay display;
  46. EGLSurface surface;
  47. EGLContext context;
  48. EGLint width;
  49. EGLint height;
  50. #if 0
  51. uint8_t gles2_extensions[IJK_GLES2__MAX_EXT];
  52. #endif
  53. } IJK_EGL;
  54. IJK_EGL *IJK_EGL_create();
  55. void IJK_EGL_free(IJK_EGL *egl);
  56. void IJK_EGL_freep(IJK_EGL **egl);
  57. EGLBoolean IJK_EGL_display(IJK_EGL* egl, EGLNativeWindowType window, SDL_VoutOverlay *overlay);
  58. void IJK_EGL_terminate(IJK_EGL* egl);
  59. #endif