Skip to content

Instantly share code, notes, and snippets.

@quink-black
Created October 30, 2020 06:43
Show Gist options
  • Save quink-black/0435a39fc928bbdb660426be79a51372 to your computer and use it in GitHub Desktop.
Save quink-black/0435a39fc928bbdb660426be79a51372 to your computer and use it in GitHub Desktop.
vlc opengl RGB mask
diff --git a/modules/video_output/opengl/interop.c b/modules/video_output/opengl/interop.c
index 96d548519e..6ded931189 100644
--- a/modules/video_output/opengl/interop.c
+++ b/modules/video_output/opengl/interop.c
@@ -321,6 +321,24 @@ interop_rgb_base_init(struct vlc_gl_interop *interop, GLenum tex_target,
break;
case VLC_CODEC_RGB32:
+ if (interop->fmt_in.i_rmask == 0x00ff0000
+ && interop->fmt_in.i_gmask == 0x0000ff00
+ && interop->fmt_in.i_bmask == 0x000000ff)
+ {
+ if (GetTexFormatSize(interop->vt, tex_target, GL_BGRA, GL_RGBA,
+ GL_UNSIGNED_BYTE) != 32)
+ return VLC_EGENERIC;
+ interop->texs[0] = (struct vlc_gl_tex_cfg) {
+ { 1, 1 }, { 1, 1 }, GL_RGBA, GL_BGRA, GL_UNSIGNED_BYTE
+ };
+ }
+ else
+ {
+ interop->texs[0] = (struct vlc_gl_tex_cfg) {
+ { 1, 1 }, { 1, 1 }, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE
+ };
+ }
+ break;
case VLC_CODEC_RGBA:
interop->texs[0] = (struct vlc_gl_tex_cfg) {
{ 1, 1 }, { 1, 1 }, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment