Mercurial > mplayer.hg
annotate libvo/vo_macosx.h @ 28816:6e5b9867646c
sync w/r28807
author | gpoirier |
---|---|
date | Fri, 06 Mar 2009 15:52:48 +0000 |
parents | 7681eab10aea |
children | 5044f4496791 |
rev | line source |
---|---|
15289 | 1 /* |
28446
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28010
diff
changeset
|
2 * MPlayer Mac OS X video output driver |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28010
diff
changeset
|
3 * |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28010
diff
changeset
|
4 * Copyright (c) 2005 Nicolas Plourde <nicolasplourde@gmail.com> |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28010
diff
changeset
|
5 * |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28010
diff
changeset
|
6 * This file is part of MPlayer. |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28010
diff
changeset
|
7 * |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28010
diff
changeset
|
8 * MPlayer is free software; you can redistribute it and/or modify |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28010
diff
changeset
|
9 * it under the terms of the GNU General Public License as published by |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28010
diff
changeset
|
10 * the Free Software Foundation; either version 2 of the License, or |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28010
diff
changeset
|
11 * (at your option) any later version. |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28010
diff
changeset
|
12 * |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28010
diff
changeset
|
13 * MPlayer is distributed in the hope that it will be useful, |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28010
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28010
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28010
diff
changeset
|
16 * GNU General Public License for more details. |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28010
diff
changeset
|
17 * |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28010
diff
changeset
|
18 * You should have received a copy of the GNU General Public License along |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28010
diff
changeset
|
19 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28010
diff
changeset
|
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28010
diff
changeset
|
21 */ |
15289 | 22 |
23 #import <Cocoa/Cocoa.h> | |
24 #import <QuartzCore/QuartzCore.h> | |
15327 | 25 #import <QuickTime/QuickTime.h> |
15289 | 26 |
25157
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
27 // MPlayer OS X VO Protocol |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
28 @protocol MPlayerOSXVOProto |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
29 - (int) startWithWidth: (bycopy int)width |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
30 withHeight: (bycopy int)height |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
31 withBytes: (bycopy int)bytes |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
32 withAspect: (bycopy int)aspect; |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
33 - (void) stop; |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
34 - (void) render; |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
35 - (void) toggleFullscreen; |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
36 - (void) ontop; |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
37 @end |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
38 |
15611 | 39 @interface MPlayerOpenGLView : NSOpenGLView |
15289 | 40 { |
41 //Cocoa | |
42 NSWindow *window; | |
43 NSOpenGLContext *glContext; | |
44 NSEvent *event; | |
45 | |
46 //CoreVideo | |
25180 | 47 CVPixelBufferRef frameBuffers[2]; |
15289 | 48 CVOpenGLTextureCacheRef textureCache; |
49 CVOpenGLTextureRef texture; | |
15729 | 50 NSRect textureFrame; |
15289 | 51 |
52 GLfloat lowerLeft[2]; | |
53 GLfloat lowerRight[2]; | |
54 GLfloat upperRight[2]; | |
55 GLfloat upperLeft[2]; | |
56 | |
57 BOOL mouseHide; | |
15855 | 58 float winSizeMult; |
15570 | 59 |
60 //menu command id | |
61 NSMenuItem *kQuitCmd; | |
62 NSMenuItem *kHalfScreenCmd; | |
63 NSMenuItem *kNormalScreenCmd; | |
64 NSMenuItem *kDoubleScreenCmd; | |
65 NSMenuItem *kFullScreenCmd; | |
66 NSMenuItem *kKeepAspectCmd; | |
67 NSMenuItem *kAspectOrgCmd; | |
68 NSMenuItem *kAspectFullCmd; | |
69 NSMenuItem *kAspectWideCmd; | |
70 NSMenuItem *kPanScanCmd; | |
28010
0a0f63090e60
factorize mouse hiding and screensaver disabling code
gpoirier
parents:
25180
diff
changeset
|
71 |
0a0f63090e60
factorize mouse hiding and screensaver disabling code
gpoirier
parents:
25180
diff
changeset
|
72 //timestamps for disabling screensaver and mouse hiding |
0a0f63090e60
factorize mouse hiding and screensaver disabling code
gpoirier
parents:
25180
diff
changeset
|
73 int lastMouseHide; |
0a0f63090e60
factorize mouse hiding and screensaver disabling code
gpoirier
parents:
25180
diff
changeset
|
74 int lastScreensaverUpdate; |
15289 | 75 } |
76 | |
77 - (BOOL) acceptsFirstResponder; | |
78 - (BOOL) becomeFirstResponder; | |
79 - (BOOL) resignFirstResponder; | |
80 | |
81 //window & rendering | |
24076 | 82 - (void) preinit; |
83 - (void) config; | |
15289 | 84 - (void) prepareOpenGL; |
85 - (void) render; | |
86 - (void) reshape; | |
87 - (void) setCurrentTexture; | |
88 - (void) drawRect: (NSRect *) bounds; | |
15611 | 89 |
90 //vo control | |
15289 | 91 - (void) fullscreen: (BOOL) animate; |
92 - (void) ontop; | |
93 - (void) panscan; | |
15327 | 94 - (void) rootwin; |
15289 | 95 |
15611 | 96 //menu |
97 - (void) initMenu; | |
98 - (void) menuAction:(id)sender; | |
99 | |
15289 | 100 //event |
101 - (void) keyDown: (NSEvent *) theEvent; | |
102 - (void) mouseMoved: (NSEvent *) theEvent; | |
103 - (void) mouseDown: (NSEvent *) theEvent; | |
24077
9ce03980ed0c
added double click support in vo_macosx. Patch by Ulion <ulion2002@gmail.com>
nplourde
parents:
24076
diff
changeset
|
104 - (void) mouseUp: (NSEvent *) theEvent; |
15289 | 105 - (void) rightMouseDown: (NSEvent *) theEvent; |
24077
9ce03980ed0c
added double click support in vo_macosx. Patch by Ulion <ulion2002@gmail.com>
nplourde
parents:
24076
diff
changeset
|
106 - (void) rightMouseUp: (NSEvent *) theEvent; |
15289 | 107 - (void) otherMouseDown: (NSEvent *) theEvent; |
24077
9ce03980ed0c
added double click support in vo_macosx. Patch by Ulion <ulion2002@gmail.com>
nplourde
parents:
24076
diff
changeset
|
108 - (void) otherMouseUp: (NSEvent *) theEvent; |
15289 | 109 - (void) scrollWheel: (NSEvent *) theEvent; |
110 - (void) mouseEvent: (NSEvent *) theEvent; | |
111 - (void) check_events; | |
24075 | 112 @end |