OpenGL/C++ ( Video to a GL Texture? )

This forum is about all development around libVLC.
ninjamint
New Cone
New Cone
Posts: 7
Joined: 05 Feb 2010 22:40

OpenGL/C++ ( Video to a GL Texture? )

Postby ninjamint » 05 Feb 2010 22:47

Okay, so im using the tutorial located here:
http://wiki.videolan.org/LibVLC_SampleCode_SDL

I'm currently generating my OpenGL texture using:

Code: Select all

glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_PRIORITY, 1.0 ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, 0x812F ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, 0x812F ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); glTexImage2D( GL_TEXTURE_2D, 0, 3, ctx.surf->w, ctx.surf->h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ctx.surf->pixels );
which looks something like this.. Image

though that appears to be obviously wrong.. any insight?

Thanks!

[FIX]
changed chroma to "RV32", and set the pitch to width*4, its working now as expected, all aside from the red/blue colors being reversed.. not sure how to fix that, because my SDL_Surface mask is correct.. =| I temperarly fixed this using GL_BGRA_EXT, but I'd like to know the less ~crappy~ way of resolving this..

Rémi Denis-Courmont
Developer
Developer
Posts: 15280
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: OpenGL/C++ ( Video to a GL Texture? )

Postby Rémi Denis-Courmont » 06 Feb 2010 11:46

VLC uses the RGB masks specified by SDL. There seems to be a disagreement between SDL and OpenGL (not much VLC can do about).
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Flicker
New Cone
New Cone
Posts: 2
Joined: 28 Feb 2010 15:35

Re: OpenGL/C++ ( Video to a GL Texture? )

Postby Flicker » 28 Feb 2010 15:46

edit: Nevermind, stupid mistake. Just looked at the example code closely and saw that the drawing of the boxes was in there :roll:


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 8 guests