Commit Graph

13 Commits

Author SHA1 Message Date
Niklas Haas 65979986a9 vo_opengl: refactor into vo_gpu
This is done in several steps:

1. refactor MPGLContext -> struct ra_ctx
2. move GL-specific stuff in vo_opengl into opengl/context.c
3. generalize context creation to support other APIs, and add --gpu-api
4. rename all of the --opengl- options that are no longer opengl-specific
5. move all of the stuff from opengl/* that isn't GL-specific into gpu/
   (note: opengl/gl_utils.h became opengl/utils.h)
6. rename vo_opengl to vo_gpu
7. to handle window screenshots, the short-term approach was to just add
   it to ra_swchain_fns. Long term (and for vulkan) this has to be moved to
   ra itself (and vo_gpu altered to compensate), but this was a stop-gap
   measure to prevent this commit from getting too big
8. move ra->fns->flush to ra_gl_ctx instead
9. some other minor changes that I've probably already forgotten

Note: This is one half of a major refactor, the other half of which is
provided by rossy's following commit. This commit enables support for
all linux platforms, while his version enables support for all non-linux
platforms.

Note 2: vo_opengl_cb.c also re-uses ra_gl_ctx so it benefits from the
--opengl- options like --opengl-early-flush, --opengl-finish etc. Should
be a strict superset of the old functionality.

Disclaimer: Since I have no way of compiling mpv on all platforms, some
of these ports were done blindly. Specifically, the blind ports included
context_mali_fbdev.c and context_rpi.c. Since they're both based on
egl_helpers, the port should have gone smoothly without any major
changes required. But if somebody complains about a compile error on
those platforms (assuming anybody actually uses them), you know where to
complain.
2017-09-21 15:00:55 +02:00
wm4 c9d3a79187 vo_opengl: add a generic EGL function loader function
This is pretty trivial, but also quite annoying due to details like
mismatching eglGetProcAddress() function signature (most callers just
cast the function pointer), and ARM/Linux hacks. So move them all to one
place.
2017-04-06 14:50:19 +02:00
wm4 9ea9bdf130 vo_opengl: context_rpi: fix stdatomic usage
atomic_bool is not supported with e.g. atomic_fetch_and.

Fixes #3699. Untested.
2016-10-21 17:35:48 +02:00
wm4 d3111ee777 vo_opengl: rpi: raise the video layer
Was intended to put the GL layer above the standard console. (But
actually that was done already, and the oddness I'm seeing seems to
be an unrelated bug.)
2016-09-30 13:05:58 +02:00
wm4 cf5c3fc31a vo_opengl: rpi: cosmetic change
I almost feel sorry wasting a commit on this.
2016-09-15 14:50:38 +02:00
wm4 9def3682d1 vo_rpi, vo_opengl: separate RPI/EGL-specific code for both VOs
This used to be shared, but since vo_rpi is going to be removed,
untangle them. There was barely any actual code shared since the recent
changes anyway.

As a subtle change, we also stop opening libGLESv2.so explicitly in the
vo_opengl backend, and use RTLD_DEFAULT instead.
2016-09-13 20:35:53 +02:00
wm4 5819a4e301 vo_opengl: rpi: use new egl context creation helper function
Only for the "new" vo_opengl backend code.
2016-09-13 20:16:45 +02:00
wm4 b261e1e782 vo_opengl: rpi: merge vo_rpi features
Since vo_rpi is going to be deprecated, better port its features to the
vo_opengl backend.

The most tricky part is the fact that recreating dispmanx elements will
conflict with the GL context. Fortunately, RPI's EGL support is
reasonably compliant, and we can transplant the context to newly created
dispmanx elements, making this much easier. This means unlike vo_rpi,
the GL state will actually not be recreated.
2016-09-12 20:03:55 +02:00
wm4 274e71ee8b vo_opengl: add hw overlay support and use it for RPI
This overlay support specifically skips the OpenGL rendering chain, and
uses GL rendering only for OSD/subtitles. This is for devices which
don't have performant GL support.

hwdec_rpi.c contains code ported from vo_rpi.c. vo_rpi.c is going to be
deprecated. I left in the code for uploading sw surfaces (as it might
be slightly more efficient for rendering sw decoded video), although
it's dead code for now.
2016-09-12 19:58:58 +02:00
wm4 8c02c92ab9 vo_opengl: rpi: don't include x11 header file
Copy & paste bug.
2016-04-15 09:45:15 +02:00
wm4 e4ec0f42e4 Change GPL/LGPL dual-licensed files to LGPL
Do this to make the license situation less confusing.

This change should be of no consequence, since LGPL is compatible with
GPL anyway, and making it LGPL-only does not restrict the use with GPL
code.

Additionally, the wording implies that this is allowed, and that we can
just remove the GPL part.
2016-01-19 18:36:34 +01:00
wm4 aa587580c8 vo_rpi: fix compilation
Untested, but should be fine. Broken by commit 0a0bb905.

Also fix the include statement in context_rpi.c, which caused another
compilation failure. Also untested. (Because I'm lazy.)

Fixes #2638.
2015-12-26 19:18:47 +01:00
wm4 4cc1861378 vo_opengl: prefix per-backend source files with context_ 2015-12-19 14:14:12 +01:00