ad_ffmpeg: return failure from init() if initial decode fails
[mplayer/greg.git] / libvo / vo_corevideo.h
blob926399053f33c0df7c64845437c7844c5e97f550
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 #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;
36 - (void) stop;
37 - (void) render;
38 - (void) toggleFullscreen;
39 - (void) ontop;
40 @end
42 @interface MPlayerOpenGLView : NSOpenGLView
44 //Cocoa
45 NSWindow *window;
47 //CoreVideo
48 CVPixelBufferRef frameBuffers[2];
49 CVOpenGLTextureCacheRef textureCache;
50 CVOpenGLTextureRef texture;
51 NSRect textureFrame;
53 GLfloat lowerLeft[2];
54 GLfloat lowerRight[2];
55 GLfloat upperRight[2];
56 GLfloat upperLeft[2];
58 BOOL mouseHide;
60 //menu command id
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
72 int lastMouseHide;
73 int lastScreensaverUpdate;
74 @public
75 float winSizeMult;
78 - (BOOL) acceptsFirstResponder;
79 - (BOOL) becomeFirstResponder;
80 - (BOOL) resignFirstResponder;
82 //window & rendering
83 - (void) preinit;
84 - (void) config;
85 - (void) prepareOpenGL;
86 - (void) render;
87 - (void) reshape;
88 - (void) setCurrentTexture;
89 - (void) drawRect: (NSRect *) bounds;
91 //vo control
92 - (void) fullscreen: (BOOL) animate;
93 - (void) ontop;
94 - (void) panscan;
95 - (void) rootwin;
97 //menu
98 - (void) initMenu;
99 - (void) menuAction:(id)sender;
101 //event
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;
113 @end
115 #endif /* MPLAYER_VO_COREVIDEO_H */