1 /* GStreamer 2 * Copyright (C) 2004 Zaheer Abbas Merali <zaheerabbas at merali dot org> 3 * Copyright (C) 2007 Pioneers of the Inevitable <songbird@songbirdnest.com> 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Library General Public 7 * License as published by the Free Software Foundation; either 8 * version 2 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Library General Public License for more details. 14 * 15 * You should have received a copy of the GNU Library General Public 16 * License along with this library; if not, write to the 17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 18 * Boston, MA 02110-1301, USA. 19 * 20 * The development of this code was made possible due to the involvement of Pioneers 21 * of the Inevitable, the creators of the Songbird Music player 22 * 23 */ 24 25 /* inspiration gained from looking at source of osx video out of xine and vlc 26 * and is reflected in the code 27 */ 28 29 #import <Cocoa/Cocoa.h> 30 #import <glib.h> 31 #import <gst/video/navigation.h> 32 33 struct _GstOSXImage; 34 35 @interface GstGLView : NSOpenGLView 36 { 37 int i_effect; 38 unsigned int pi_texture; 39 float f_x; 40 float f_y; 41 int initDone; 42 char* data; 43 int width, height; 44 BOOL fullscreen; 45 BOOL keepAspectRatio; 46 NSOpenGLContext* fullScreenContext; 47 NSOpenGLContext* actualContext; 48 NSTrackingArea *trackingArea; 49 GstNavigation *navigation; 50 NSRect drawingBounds; 51 NSThread *mainThread; 52 NSUInteger savedModifierFlags; 53 } 54 - (void) drawQuad; 55 - (void) drawRect: (NSRect) rect; 56 - (id) initWithFrame: (NSRect) frame; 57 - (void) initTextures; 58 - (void) reloadTexture; 59 - (void) cleanUp; 60 - (void) displayTexture; 61 - (char*) getTextureBuffer; 62 - (void) setFullScreen: (BOOL) flag; 63 - (void) setKeepAspectRatio: (BOOL) flag; 64 - (void) reshape; 65 - (void) setVideoSize:(int)w : (int)h; 66 - (NSRect) getDrawingBounds; 67 - (BOOL) haveSuperview; 68 - (void) haveSuperviewReal: (NSMutableArray *)closure; 69 - (void) addToSuperview: (NSView *)superview; 70 - (void) removeFromSuperview: (id)unused; 71 - (void) setNavigation: (GstNavigation *) nav; 72 #ifndef GSTREAMER_GLIB_COCOA_NSAPPLICATION 73 - (void) setMainThread: (NSThread *) thread; 74 #endif 75 76 @end 77 78 @interface GstOSXVideoSinkWindow: NSWindow { 79 int width, height; 80 GstGLView *gstview; 81 } 82 83 - (void) setContentSize: (NSSize) size; 84 - (GstGLView *) gstView; 85 - (id)initWithContentNSRect:(NSRect)contentRect styleMask:(unsigned int)styleMask backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag screen:(NSScreen *)aScreen; 86 @end 87