[vlc-devel] Mac OS X blank white screen problem with fix

Scott Herscher scott at collobos.com
Thu Jan 20 23:39:27 CET 2011


Well I was going by the opengl.h implementation in 1.5.5.  It also had the following lines:

#ifdef __APPLE__
/* On OS X, use GL_TEXTURE_RECTANGLE_EXT instead of GL_TEXTURE_2D.
   This allows sizes which are not powers of 2 */
# define VLCGL_TARGET GL_TEXTURE_RECTANGLE_EXT

/* OS X OpenGL supports YUV. Hehe. */
# define VLCGL_FORMAT GL_YCBCR_422_APPLE
# define VLCGL_TYPE   GL_UNSIGNED_SHORT_8_8_APPLE

# define VLCGL_TEXTURE_COUNT (2)
#else


but, it used the constant "3" as the third argument in glTextImage2D().  The OpenGL docs were a little vague about what the constant "3" means, so it's hard to say what the right value should be.  I'm not sure why the value was changed from "3" to VLCGL_FORMAT.

Take care,

Scott

On Jan 20, 2011, at 1:28 PM, Juha Jeronen wrote:

> Hi,
> 
> On 01/20/2011 10:48 PM, Scott Herscher wrote:
>> The last couple of months on OS X there has been a blank white screen where video should be playing.  This diff has the fix.
>> 
>> --- a/modules/video_output/opengl.c
>> +++ b/modules/video_output/opengl.c
>> @@ -268,7 +268,7 @@ int vout_display_opengl_ResetTextures(vout_display_opengl_t *vgl)
>> 
>>          /* Call glTexImage2D only once, and use glTexSubImage2D later */
>>          if (vgl->buffer[i]) {
>> -            glTexImage2D(VLCGL_TARGET, 0, VLCGL_FORMAT, vgl->tex_width,
>> +            glTexImage2D(VLCGL_TARGET, 0, 3 /* VLCGL_FORMAT */, vgl->tex_width,
>>                           vgl->tex_height, 0, VLCGL_FORMAT, VLCGL_TYPE,
>>                           vgl->buffer[i]);
>>          }
>> 
>> 
>> I sadly am not enough of a OpenGL expert to know why the old code was wrong...but it was wrong. At least on Mac OS X it was wrong.  If the maintainers of the code could integrate this fix or find out why it wasn't working correctly I'd be very grateful.
>>   
> 
> I'm not an OpenGL expert either, but judging by the diff and the #defines near the beginning of the file, could this have something to do with it?
> 
> ---8<---8<---8<---
> 
> /* OS X OpenGL supports YUV. Hehe. */
> # define VLCGL_FORMAT GL_YCBCR_422_APPLE
> # define VLCGL_TYPE   GL_UNSIGNED_SHORT_8_8_APPLE
> 
> ---8<---8<---8<---
> 
> Maybe this functionality has become broken in OS X 10.6.5? What happens if we, instead of the two lines above, do
> 
> # define VLCGL_RGB_FORMAT GL_RGBA
> # define VLCGL_RGB_TYPE GL_UNSIGNED_BYTE
> 
> # define VLCGL_FORMAT VLCGL_RGB_FORMAT
> # define VLCGL_TYPE   VLCGL_RGB_TYPE
> 
> on OS X, too?
> 
> -J
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel




More information about the vlc-devel mailing list