* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
- *
- * The development of this code was made possible due to the involvement of Pioneers
+ *
+ * The development of this code was made possible due to the involvement of Pioneers
* of the Inevitable, the creators of the Songbird Music player
*
*/
/* The object has to be released */
- (id) initWithContentNSRect: (NSRect) rect
styleMask: (unsigned int) styleMask
- backing: (NSBackingStoreType) bufferingType
+ backing: (NSBackingStoreType) bufferingType
defer: (BOOL) flag
screen:(NSScreen *) aScreen
{
self = [super initWithContentRect: rect
styleMask: styleMask
- backing: bufferingType
- defer: flag
+ backing: bufferingType
+ defer: flag
screen:aScreen];
GST_DEBUG ("Initializing GstOSXvideoSinkWindow");
gstview = [[GstGLView alloc] initWithFrame:rect];
-
+
if (gstview)
[self setContentView:gstview];
[self setTitle:@"GStreamer Video Output"];
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
glPixelStorei (GL_UNPACK_ROW_LENGTH, width);
-
+
glBindTexture (GL_TEXTURE_RECTANGLE_EXT, pi_texture);
/* Use VRAM texturing */
// glPixelStorei (GL_UNPACK_ROW_LENGTH, 0); WHY ??
glTexImage2D (GL_TEXTURE_RECTANGLE_EXT, 0, GL_RGBA,
- width, height, 0,
+ width, height, 0,
GL_YCBCR_422_APPLE, GL_UNSIGNED_SHORT_8_8_APPLE, data);
} else if (fullscreen && !flag) {
// fullscreen now and needs to go back to normal
initDone = NO;
-
+
actualContext = [self openGLContext];
[NSOpenGLContext clearCurrentContext];
* OSX video sink
* Copyright (C) 2004-6 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* Copyright (C) 2007,2008,2009 Pioneers of the Inevitable <songbird@songbirdnest.com>
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
*
* The development of this code was made possible due to the involvement of
* Pioneers of the Inevitable, the creators of the Songbird Music player.
- *
+ *
*/
/**
* The OSXVideoSink renders video frames to a MacOSX window. The video output
* must be directed to a window embedded in an existing NSApp.
*
- * When the NSView to be embedded is created an element #GstMessage with a
- * name of 'have-ns-view' will be created and posted on the bus.
- * The pointer to the NSView to embed will be in the 'nsview' field of that
+ * When the NSView to be embedded is created an element #GstMessage with a
+ * name of 'have-ns-view' will be created and posted on the bus.
+ * The pointer to the NSView to embed will be in the 'nsview' field of that
* message. The application MUST handle this message and embed the view
* appropriately.
*/
osxvideosink = GST_OSX_VIDEO_SINK (element);
- GST_DEBUG_OBJECT (osxvideosink, "%s => %s",
+ GST_DEBUG_OBJECT (osxvideosink, "%s => %s",
gst_element_state_get_name(GST_STATE_TRANSITION_CURRENT (transition)),
gst_element_state_get_name(GST_STATE_TRANSITION_NEXT (transition)));
-(void) createInternalWindow
{
GstOSXWindow *osxwindow = osxvideosink->osxwindow;
- ProcessSerialNumber psn;
NSRect rect;
unsigned int mask;
rect.size.width = (float) osxwindow->width;
rect.size.height = (float) osxwindow->height;
-
- if (!GetCurrentProcess(&psn)) {
- TransformProcessType(&psn, kProcessTransformToForegroundApplication);
- SetFrontProcess(&psn);
- }
-
osxwindow->win =[[[GstOSXVideoSinkWindow alloc]
initWithContentNSRect: rect
styleMask: mask
defer: NO
screen: nil] retain];
GST_DEBUG("VideoSinkWindow created, %p", osxwindow->win);
- [osxwindow->win makeKeyAndOrderFront:NSApp];
+ [osxwindow->win orderFrontRegardless];
osxwindow->gstview =[osxwindow->win gstView];
[osxwindow->win setDelegate:[[GstWindowDelegate alloc]
initWithSink:osxvideosink]];
GST_OBJECT_LOCK (osxvideosink);
if (osxvideosink->osxwindow == NULL)
goto no_window;
-
+
texture_buffer = (guint8 *) [osxvideosink->osxwindow->gstview getTextureBuffer];
if (G_UNLIKELY (texture_buffer == NULL))
goto no_texture_buffer;
-
+
vmeta = (GstVideoMeta *) gst_buffer_get_meta (buf, GST_VIDEO_META_API_TYPE);
gst_video_meta_map (vmeta, 0, &info, (gpointer *) &data, &stride, GST_MAP_READ);
readp = data;