]> git.sesse.net Git - vlc/blobdiff - modules/access/screen/mac.c
macosx: added an option to disable the 'Recent Items' list as requested by multiple...
[vlc] / modules / access / screen / mac.c
index 0c1b45058118afd678a44a2e63481f03bf7f9ff6..fd14f637dc46dc27a3b2d637d0815dc91ef4d8d0 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * mac.c: Screen capture module for the Mac.
  *****************************************************************************
- * Copyright (C) 2004 VideoLAN (Centrale Réseaux) and its contributors
- * $Id: x11.c 8290 2004-07-26 20:29:24Z gbazin $
+ * Copyright (C) 2004 the VideoLAN team
+ * $Id$
  *
  * Authors: Derk-Jan Hartman <hartman at videolan dot org>
  *
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>
 
 #include <vlc/vlc.h>
-#include <vlc/input.h>
 
 #include <Carbon/Carbon.h>
 #include <ApplicationServices/ApplicationServices.h>
@@ -62,10 +60,10 @@ int screen_InitCapture( demux_t *p_demux )
     p_sys->p_data = p_data =
         (screen_data_t *)malloc( sizeof( screen_data_t ) );
 
-    p_data->gConnection = NULL;
+    p_data->gConnection = nil;
     p_data->gMainDevice = NULL;
     p_data->gDevicePix = NULL;
-    p_data->gDeviceState = NULL;
+    p_data->gDeviceState = nil;
     p_data->LocalBufferGW = NULL;
     p_data->LocalBufferPix = NULL;
 
@@ -75,8 +73,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) */
@@ -92,7 +90,7 @@ int screen_InitCapture( demux_t *p_demux )
         i_offset = 4;
         break;
     default:
-        msg_Err( p_demux, "unknown screen depth: %d", CGDisplaySamplesPerPixel(p_data->displayID) * CGDisplayBitsPerSample(p_data->displayID) );
+        msg_Err( p_demux, "unknown screen depth: %d", (int)(CGDisplaySamplesPerPixel(p_data->displayID) * CGDisplayBitsPerSample(p_data->displayID)) );
         return VLC_EGENERIC;
     }
 
@@ -100,7 +98,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 +107,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 +141,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 ) ) )
     {