Mercurial > mplayer.hg
annotate libvo/vo_corevideo.h @ 35077:c9d302e5e4be
Fix translation of mouse coordinates when panscan is used.
author | reimar |
---|---|
date | Wed, 12 Sep 2012 21:03:45 +0000 |
parents | 90a2e4fedfab |
children | a10c7a7a9232 |
rev | line source |
---|---|
15289 | 1 /* |
29210 | 2 * CoreVideo video output driver |
28446
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 |
32126 | 23 #ifndef MPLAYER_VO_COREVIDEO_H |
24 #define MPLAYER_VO_COREVIDEO_H | |
25 | |
15289 | 26 #import <Cocoa/Cocoa.h> |
27 #import <QuartzCore/QuartzCore.h> | |
29207
5044f4496791
Replace QuickTime.h #include with Carbon.h, which is really needed.
diego
parents:
28446
diff
changeset
|
28 #import <Carbon/Carbon.h> |
15289 | 29 |
25157
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
30 // MPlayer OS X VO Protocol |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
31 @protocol MPlayerOSXVOProto |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
32 - (int) startWithWidth: (bycopy int)width |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
33 withHeight: (bycopy int)height |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
34 withBytes: (bycopy int)bytes |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
35 withAspect: (bycopy int)aspect; |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
36 - (void) stop; |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
37 - (void) render; |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
38 - (void) toggleFullscreen; |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
39 - (void) ontop; |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
40 @end |
cf3b6015735d
Set protocol for the vo proxy used in shared-buffer mode.
ulion
parents:
24077
diff
changeset
|
41 |
35068 | 42 @interface MPlayerOpenGLView : NSOpenGLView |
43 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 | |
44 <NSWindowDelegate> | |
45 #endif | |
15289 | 46 { |
47 //Cocoa | |
48 NSWindow *window; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29210
diff
changeset
|
49 |
15289 | 50 //CoreVideo |
25180 | 51 CVPixelBufferRef frameBuffers[2]; |
15289 | 52 CVOpenGLTextureCacheRef textureCache; |
53 CVOpenGLTextureRef texture; | |
15729 | 54 NSRect textureFrame; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29210
diff
changeset
|
55 |
31744 | 56 GLfloat lowerLeft[2]; |
57 GLfloat lowerRight[2]; | |
58 GLfloat upperRight[2]; | |
59 GLfloat upperLeft[2]; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29210
diff
changeset
|
60 |
15289 | 61 BOOL mouseHide; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29210
diff
changeset
|
62 |
15570 | 63 //menu command id |
64 NSMenuItem *kHalfScreenCmd; | |
65 NSMenuItem *kNormalScreenCmd; | |
66 NSMenuItem *kDoubleScreenCmd; | |
67 NSMenuItem *kFullScreenCmd; | |
68 NSMenuItem *kKeepAspectCmd; | |
69 NSMenuItem *kAspectOrgCmd; | |
70 NSMenuItem *kAspectFullCmd; | |
71 NSMenuItem *kAspectWideCmd; | |
72 NSMenuItem *kPanScanCmd; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29210
diff
changeset
|
73 |
28010
0a0f63090e60
factorize mouse hiding and screensaver disabling code
gpoirier
parents:
25180
diff
changeset
|
74 //timestamps for disabling screensaver and mouse hiding |
0a0f63090e60
factorize mouse hiding and screensaver disabling code
gpoirier
parents:
25180
diff
changeset
|
75 int lastMouseHide; |
0a0f63090e60
factorize mouse hiding and screensaver disabling code
gpoirier
parents:
25180
diff
changeset
|
76 int lastScreensaverUpdate; |
29564
4ae3d2d7946e
Use MPlayer's standard aspect handling functions in corevideo
reimar
parents:
29263
diff
changeset
|
77 @public |
4ae3d2d7946e
Use MPlayer's standard aspect handling functions in corevideo
reimar
parents:
29263
diff
changeset
|
78 float winSizeMult; |
15289 | 79 } |
80 | |
81 - (BOOL) acceptsFirstResponder; | |
82 - (BOOL) becomeFirstResponder; | |
83 - (BOOL) resignFirstResponder; | |
84 | |
85 //window & rendering | |
24076 | 86 - (void) preinit; |
87 - (void) config; | |
15289 | 88 - (void) prepareOpenGL; |
89 - (void) render; | |
90 - (void) reshape; | |
91 - (void) setCurrentTexture; | |
92 - (void) drawRect: (NSRect *) bounds; | |
15611 | 93 |
94 //vo control | |
15289 | 95 - (void) fullscreen: (BOOL) animate; |
96 - (void) ontop; | |
15327 | 97 - (void) rootwin; |
15289 | 98 |
15611 | 99 //menu |
100 - (void) initMenu; | |
101 - (void) menuAction:(id)sender; | |
102 | |
15289 | 103 //event |
104 - (void) keyDown: (NSEvent *) theEvent; | |
105 - (void) mouseMoved: (NSEvent *) theEvent; | |
106 - (void) mouseDown: (NSEvent *) theEvent; | |
24077
9ce03980ed0c
added double click support in vo_macosx. Patch by Ulion <ulion2002@gmail.com>
nplourde
parents:
24076
diff
changeset
|
107 - (void) mouseUp: (NSEvent *) theEvent; |
15289 | 108 - (void) rightMouseDown: (NSEvent *) theEvent; |
24077
9ce03980ed0c
added double click support in vo_macosx. Patch by Ulion <ulion2002@gmail.com>
nplourde
parents:
24076
diff
changeset
|
109 - (void) rightMouseUp: (NSEvent *) theEvent; |
15289 | 110 - (void) otherMouseDown: (NSEvent *) theEvent; |
24077
9ce03980ed0c
added double click support in vo_macosx. Patch by Ulion <ulion2002@gmail.com>
nplourde
parents:
24076
diff
changeset
|
111 - (void) otherMouseUp: (NSEvent *) theEvent; |
15289 | 112 - (void) scrollWheel: (NSEvent *) theEvent; |
113 - (void) mouseEvent: (NSEvent *) theEvent; | |
114 - (void) check_events; | |
24075 | 115 @end |
32126 | 116 |
117 #endif /* MPLAYER_VO_COREVIDEO_H */ |