X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Faccess%2Fscreen%2Fmac.c;h=2c3c54b539df5241bccb26749bb4f60a48cb69cc;hb=50c27e64ff9cb6e7220d7ac510285fc90462c58a;hp=28ef5ac20b2a09c0f306c803486001fdf769acc6;hpb=c72544e12e955a668cbc9e41ef11fd468d49c9d2;p=vlc diff --git a/modules/access/screen/mac.c b/modules/access/screen/mac.c index 28ef5ac20b..2c3c54b539 100644 --- a/modules/access/screen/mac.c +++ b/modules/access/screen/mac.c @@ -24,10 +24,12 @@ /***************************************************************************** * Preamble *****************************************************************************/ -#include + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include -#include #include #include @@ -75,8 +77,8 @@ int screen_InitCapture( demux_t *p_demux ) if( CGDisplaySamplesPerPixel(p_data->displayID) != 3 ) { msg_Err( p_demux, "screenformat not supported" ); - } - + } + switch( CGDisplaySamplesPerPixel(p_data->displayID) * CGDisplayBitsPerSample(p_data->displayID) ) { /* TODO figure out 256 colors (who uses it anyways) */ @@ -100,7 +102,7 @@ int screen_InitCapture( demux_t *p_demux ) GetPenState(&p_data->oldState); ForeColor(blackColor); BackColor(whiteColor); - + p_data->gMainDevice = GetMainDevice(); p_data->gDeviceState = HGetState((Handle)p_data->gMainDevice); HLock((Handle)p_data->gMainDevice); @@ -109,7 +111,7 @@ int screen_InitCapture( demux_t *p_demux ) NewGWorld(&p_data->LocalBufferGW, (**p_data->gDevicePix).pixelSize, &(**p_data->gDevicePix).bounds, (**p_data->gDevicePix).pmTable, NULL, 0); p_data->LocalBufferPix = GetGWorldPixMap(p_data->LocalBufferGW); LockPixels(p_data->LocalBufferPix); - + es_format_Init( &p_sys->fmt, VIDEO_ES, i_chroma ); p_sys->fmt.video.i_width = CGDisplayPixelsWide(p_data->displayID) + i_offset; p_sys->fmt.video.i_visible_width = CGDisplayPixelsWide(p_data->displayID); @@ -143,7 +145,7 @@ block_t *screen_Capture( demux_t *p_demux ) block_t *p_block; int i_size; - i_size = p_sys->fmt.video.i_height * p_sys->fmt.video.i_width * 32 / 8; + i_size = p_sys->fmt.video.i_height * p_sys->fmt.video.i_width * 32 / 8; if( !( p_block = block_New( p_demux, i_size ) ) ) {