comparison libvo/vo_macosx.m @ 15647:0968fd3d5675

Pure cosmetic
author nplourde
date Sun, 05 Jun 2005 14:57:36 +0000
parents 06e30282b170
children e695fcd731e0
comparison
equal deleted inserted replaced
15646:f46eae5e271b 15647:0968fd3d5675
19 19
20 #include "input/input.h" 20 #include "input/input.h"
21 #include "input/mouse.h" 21 #include "input/mouse.h"
22 22
23 #include "osdep/keycodes.h" 23 #include "osdep/keycodes.h"
24
25 extern void mplayer_put_key(int code);
26 24
27 //Cocoa 25 //Cocoa
28 MPlayerOpenGLView *mpGLView; 26 MPlayerOpenGLView *mpGLView;
29 NSAutoreleasePool *autoreleasepool; 27 NSAutoreleasePool *autoreleasepool;
30 OSType pixelFormat; 28 OSType pixelFormat;
295 293
296 294
297 //create window 295 //create window
298 window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, frame.size.width, frame.size.height) 296 window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, frame.size.width, frame.size.height)
299 styleMask:NSTitledWindowMask|NSTexturedBackgroundWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask 297 styleMask:NSTitledWindowMask|NSTexturedBackgroundWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask
300 backing:NSBackingStoreBuffered 298 backing:NSBackingStoreBuffered defer:NO];
301 defer:NO];
302 299
303 [window setDelegate:self]; 300 [window setDelegate:self];
304 [window setContentView:self]; 301 [window setContentView:self];
305 [window setInitialFirstResponder:self]; 302 [window setInitialFirstResponder:self];
306 [window setAcceptsMouseMovedEvents:YES]; 303 [window setAcceptsMouseMovedEvents:YES];
307 [window setTitle:@"MPlayer - The Movie Player"]; 304 [window setTitle:@"MPlayer - The Movie Player"];
308 [window center]; 305 [window center];
309 [window makeKeyAndOrderFront:self]; 306 [window makeKeyAndOrderFront:self];
310 307
308
311 [self setOpenGLContext:glContext]; 309 [self setOpenGLContext:glContext];
312 [[self openGLContext] setValues:&swapInterval forParameter:NSOpenGLCPSwapInterval]; 310 [glContext setValues:&swapInterval forParameter:NSOpenGLCPSwapInterval];
313 [glContext setView:self]; 311 [glContext setView:self];
314 [glContext makeCurrentContext]; 312 [glContext makeCurrentContext];
315 313
316 error = CVPixelBufferCreateWithBytes( NULL, 314 error = CVPixelBufferCreateWithBytes( NULL, image_width, image_height, pixelFormat, image_data, image_width*image_bytes, NULL, NULL, NULL, &currentFrameBuffer);
317 image_width, image_height,
318 pixelFormat,
319 image_data,
320 image_width*image_bytes,
321 NULL, NULL, NULL,
322 &currentFrameBuffer);
323 if(error != kCVReturnSuccess) 315 if(error != kCVReturnSuccess)
324 mp_msg(MSGT_VO, MSGL_ERR,"Failed to create Pixel Buffer(%d)\n", error); 316 mp_msg(MSGT_VO, MSGL_ERR,"Failed to create Pixel Buffer(%d)\n", error);
325 317
326 error = CVOpenGLTextureCacheCreate(NULL, 0, [glContext CGLContextObj], [[self pixelFormat] CGLPixelFormatObj], 0, &textureCache); 318 error = CVOpenGLTextureCacheCreate(NULL, 0, [glContext CGLContextObj], [[self pixelFormat] CGLPixelFormatObj], 0, &textureCache);
327 if(error != kCVReturnSuccess) 319 if(error != kCVReturnSuccess)