container = sys->embed->handle.nsobject;
if (!container) {
- msg_Dbg(vd, "No drawable-nsobject nor vout_window_t found, passing over.");
+ msg_Err(vd, "No drawable-nsobject nor vout_window_t found, passing over.");
goto error;
}
}
sys->vgl = vout_display_opengl_New (&vd->fmt, &subpicture_chromas, &sys->gl);
if (!sys->vgl) {
+ msg_Err(vd, "Error while initializing opengl display.");
sys->gl.sys = NULL;
goto error;
}
{
vout_display_sys_t *sys = vd->sys;
+ if (!vd->sys)
+ return VLC_EGENERIC;
+
+ if (!sys->embed)
+ return VLC_EGENERIC;
+
switch (query)
{
case VOUT_DISPLAY_CHANGE_FULLSCREEN:
case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
{
- if (!vd->sys)
- return VLC_EGENERIC;
-
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
id o_window = [sys->glView window];
GLint params[] = { 1 };
CGLSetParameter ([[self openGLContext] CGLContextObj], kCGLCPSwapInterval, params);
+ [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationDidChangeScreenParametersNotification
+ object:[NSApplication sharedApplication]
+ queue:nil
+ usingBlock:^(NSNotification *notification) {
+ [self performSelectorOnMainThread:@selector(reshape)
+ withObject:nil
+ waitUntilDone:NO];
+ }];
+
[self setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
return self;
}
+- (void)dealloc
+{
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+ [super dealloc];
+}
+
/**
* Gets called by the Open() method.
*/