codecs.conf: add matchware screen codec fourcc MWSC
[mplayer/glamo.git] / libvo / vo_corevideo.h
blob2590df871ce6f2b8c86418bdc4f52a95f8ee6142
1 /*
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 #import <Cocoa/Cocoa.h>
24 #import <QuartzCore/QuartzCore.h>
25 #import <Carbon/Carbon.h>
27 // MPlayer OS X VO Protocol
28 @protocol MPlayerOSXVOProto
29 - (int) startWithWidth: (bycopy int)width
30 withHeight: (bycopy int)height
31 withBytes: (bycopy int)bytes
32 withAspect: (bycopy int)aspect;
33 - (void) stop;
34 - (void) render;
35 - (void) toggleFullscreen;
36 - (void) ontop;
37 @end
39 @interface MPlayerOpenGLView : NSOpenGLView
41 //Cocoa
42 NSWindow *window;
44 //CoreVideo
45 CVPixelBufferRef frameBuffers[2];
46 CVOpenGLTextureCacheRef textureCache;
47 CVOpenGLTextureRef texture;
48 NSRect textureFrame;
50 GLfloat lowerLeft[2];
51 GLfloat lowerRight[2];
52 GLfloat upperRight[2];
53 GLfloat upperLeft[2];
55 BOOL mouseHide;
57 //menu command id
58 NSMenuItem *kHalfScreenCmd;
59 NSMenuItem *kNormalScreenCmd;
60 NSMenuItem *kDoubleScreenCmd;
61 NSMenuItem *kFullScreenCmd;
62 NSMenuItem *kKeepAspectCmd;
63 NSMenuItem *kAspectOrgCmd;
64 NSMenuItem *kAspectFullCmd;
65 NSMenuItem *kAspectWideCmd;
66 NSMenuItem *kPanScanCmd;
68 //timestamps for disabling screensaver and mouse hiding
69 int lastMouseHide;
70 int lastScreensaverUpdate;
71 @public
72 float winSizeMult;
75 - (BOOL) acceptsFirstResponder;
76 - (BOOL) becomeFirstResponder;
77 - (BOOL) resignFirstResponder;
79 //window & rendering
80 - (void) preinit;
81 - (void) config;
82 - (void) prepareOpenGL;
83 - (void) render;
84 - (void) reshape;
85 - (void) setCurrentTexture;
86 - (void) drawRect: (NSRect *) bounds;
88 //vo control
89 - (void) fullscreen: (BOOL) animate;
90 - (void) ontop;
91 - (void) panscan;
92 - (void) rootwin;
94 //menu
95 - (void) initMenu;
96 - (void) menuAction:(id)sender;
98 //event
99 - (void) keyDown: (NSEvent *) theEvent;
100 - (void) mouseMoved: (NSEvent *) theEvent;
101 - (void) mouseDown: (NSEvent *) theEvent;
102 - (void) mouseUp: (NSEvent *) theEvent;
103 - (void) rightMouseDown: (NSEvent *) theEvent;
104 - (void) rightMouseUp: (NSEvent *) theEvent;
105 - (void) otherMouseDown: (NSEvent *) theEvent;
106 - (void) otherMouseUp: (NSEvent *) theEvent;
107 - (void) scrollWheel: (NSEvent *) theEvent;
108 - (void) mouseEvent: (NSEvent *) theEvent;
109 - (void) check_events;
110 @end