Commit Graph

4 Commits

Author SHA1 Message Date
wm4 e59e917e71 vo_opengl: hwdec_osx: use new format setup function
We can drop the custom table.

For some reason, the interop does not accept GL_RGB_RAW_422_APPLE as
internal format for GL_RGB_422_APPLE, so switch the format table to use
GL_RGB (this way both interop and real textures work the same).

Another victim of the apparent requirement of exactly matching texture
formats is kCVPixelFormatType_32BGRA. vo_opengl wants to handle this as
normal RGBA texture, with a swizzle applied in the shader.
CGLTexImageIOSurface2D() rejects this, because it wants the exact
internal format. Just drop the format, because it's useless anyway.

(Maybe this is a bit too fragile...)
2017-02-17 17:08:37 +01:00
wm4 b5eb326dcb videotoolbox: fix RGB format
Wrong colors. This didn't matter for the OpenGL interop code, because
the CV format was mapped to the correct texture format.
2017-02-17 14:14:58 +01:00
wm4 b5bbcc9f93 videotoolbox: add reverse format mapping function
Introduce mp_imgfmt_to_cvpixelformat(), and change the existing
mp_imgfmt_from_cvpixelformat() to a table to avoid duplication.
2017-02-17 13:51:03 +01:00
wm4 1e4fd996bb videotoolbox: factor some duplicated code
The code for copying a videotoolbox surface to mp_image was duplicated
(with some minor differences - I picked the hw_videotoolbox.c version,
because it was "better"). mp_imgfmt_from_cvpixelformat() is somewhat
duplicated with the vt_formats[] table, but this will be fixed in a
later commit, and moving the function to shared code is preparation.
2017-02-17 13:32:27 +01:00