2 * CoreVideo video output driver
4 * Copyright (c) 2005 Nicolas Plourde <nicolasplourde@gmail.com>
6 * This file is part of MPlayer.
8 * MPlayer is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * MPlayer is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef MPLAYER_VO_COREVIDEO_H
24 #define MPLAYER_VO_COREVIDEO_H
26 #import <Cocoa/Cocoa.h>
27 #import <QuartzCore/QuartzCore.h>
28 #import <Carbon/Carbon.h>
30 // MPlayer OS X VO Protocol
31 @protocol MPlayerOSXVOProto
32 - (int) startWithWidth
: (bycopy
int)width
33 withHeight
: (bycopy
int)height
34 withBytes
: (bycopy
int)bytes
35 withAspect
: (bycopy
int)aspect
;
38 - (void) toggleFullscreen
;
42 @interface MPlayerOpenGLView
: NSOpenGLView
48 CVPixelBufferRef frameBuffers
[2];
49 CVOpenGLTextureCacheRef textureCache
;
50 CVOpenGLTextureRef texture
;
54 GLfloat lowerRight
[2];
55 GLfloat upperRight
[2];
61 NSMenuItem
*kHalfScreenCmd
;
62 NSMenuItem
*kNormalScreenCmd
;
63 NSMenuItem
*kDoubleScreenCmd
;
64 NSMenuItem
*kFullScreenCmd
;
65 NSMenuItem
*kKeepAspectCmd
;
66 NSMenuItem
*kAspectOrgCmd
;
67 NSMenuItem
*kAspectFullCmd
;
68 NSMenuItem
*kAspectWideCmd
;
69 NSMenuItem
*kPanScanCmd
;
71 //timestamps for disabling screensaver and mouse hiding
73 int lastScreensaverUpdate
;
78 - (BOOL
) acceptsFirstResponder
;
79 - (BOOL
) becomeFirstResponder
;
80 - (BOOL
) resignFirstResponder
;
85 - (void) prepareOpenGL
;
88 - (void) setCurrentTexture
;
89 - (void) drawRect
: (NSRect
*) bounds
;
92 - (void) fullscreen
: (BOOL
) animate
;
99 - (void) menuAction
:(id
)sender
;
102 - (void) keyDown
: (NSEvent
*) theEvent
;
103 - (void) mouseMoved
: (NSEvent
*) theEvent
;
104 - (void) mouseDown
: (NSEvent
*) theEvent
;
105 - (void) mouseUp
: (NSEvent
*) theEvent
;
106 - (void) rightMouseDown
: (NSEvent
*) theEvent
;
107 - (void) rightMouseUp
: (NSEvent
*) theEvent
;
108 - (void) otherMouseDown
: (NSEvent
*) theEvent
;
109 - (void) otherMouseUp
: (NSEvent
*) theEvent
;
110 - (void) scrollWheel
: (NSEvent
*) theEvent
;
111 - (void) mouseEvent
: (NSEvent
*) theEvent
;
112 - (void) check_events
;
115 #endif /* MPLAYER_VO_COREVIDEO_H */