Commit b2522de8 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

vout_macosx: Remove trailing spaces.

And a debug code.
parent fe403f88
...@@ -90,7 +90,7 @@ vlc_module_end () ...@@ -90,7 +90,7 @@ vlc_module_end ()
} }
- (void)setVoutDisplay:(vout_display_t *)vd; - (void)setVoutDisplay:(vout_display_t *)vd;
@end @end
struct vout_display_sys_t struct vout_display_sys_t
{ {
...@@ -99,7 +99,7 @@ struct vout_display_sys_t ...@@ -99,7 +99,7 @@ struct vout_display_sys_t
vout_opengl_t gl; vout_opengl_t gl;
vout_display_opengl_t vgl; vout_display_opengl_t vgl;
picture_pool_t *pool; picture_pool_t *pool;
picture_t *current; picture_t *current;
bool has_first_frame; bool has_first_frame;
...@@ -117,7 +117,7 @@ static int Open(vlc_object_t *this) ...@@ -117,7 +117,7 @@ static int Open(vlc_object_t *this)
vd->sys = sys; vd->sys = sys;
sys->pool = NULL; sys->pool = NULL;
sys->gl.sys = NULL; sys->gl.sys = NULL;
/* Get the drawable object */ /* Get the drawable object */
id container = var_CreateGetAddress(vd, "drawable-nsobject"); id container = var_CreateGetAddress(vd, "drawable-nsobject");
if (!container) if (!container)
...@@ -132,7 +132,7 @@ static int Open(vlc_object_t *this) ...@@ -132,7 +132,7 @@ static int Open(vlc_object_t *this)
/* Get our main view*/ /* Get our main view*/
nsPool = [[NSAutoreleasePool alloc] init]; nsPool = [[NSAutoreleasePool alloc] init];
[VLCOpenGLVideoView performSelectorOnMainThread:@selector(getNewView:) withObject:[NSValue valueWithPointer:&sys->glView] waitUntilDone:YES]; [VLCOpenGLVideoView performSelectorOnMainThread:@selector(getNewView:) withObject:[NSValue valueWithPointer:&sys->glView] waitUntilDone:YES];
if (!sys->glView) if (!sys->glView)
goto error; goto error;
...@@ -151,7 +151,7 @@ static int Open(vlc_object_t *this) ...@@ -151,7 +151,7 @@ static int Open(vlc_object_t *this)
sys->gl.unlock = OpenglUnlock; sys->gl.unlock = OpenglUnlock;
sys->gl.swap = OpenglSwap; sys->gl.swap = OpenglSwap;
sys->gl.sys = sys; sys->gl.sys = sys;
if (vout_display_opengl_Init(&sys->vgl, &vd->fmt, &sys->gl)) if (vout_display_opengl_Init(&sys->vgl, &vd->fmt, &sys->gl))
{ {
sys->gl.sys = NULL; sys->gl.sys = NULL;
...@@ -161,10 +161,10 @@ static int Open(vlc_object_t *this) ...@@ -161,10 +161,10 @@ static int Open(vlc_object_t *this)
/* */ /* */
vout_display_info_t info = vd->info; vout_display_info_t info = vd->info;
info.has_pictures_invalid = false; info.has_pictures_invalid = false;
/* Setup vout_display_t once everything is fine */ /* Setup vout_display_t once everything is fine */
vd->info = info; vd->info = info;
vd->pool = Pool; vd->pool = Pool;
vd->prepare = PictureRender; vd->prepare = PictureRender;
vd->display = PictureDisplay; vd->display = PictureDisplay;
...@@ -195,7 +195,7 @@ void Close(vlc_object_t *this) ...@@ -195,7 +195,7 @@ void Close(vlc_object_t *this)
/* release on main thread as explained in Open() */ /* release on main thread as explained in Open() */
[(id)sys->container performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:NO]; [(id)sys->container performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:NO];
[sys->glView performSelectorOnMainThread:@selector(removeFromSuperview) withObject:nil waitUntilDone:NO]; [sys->glView performSelectorOnMainThread:@selector(removeFromSuperview) withObject:nil waitUntilDone:NO];
[sys->glView release]; [sys->glView release];
if (sys->gl.sys != NULL) if (sys->gl.sys != NULL)
...@@ -223,7 +223,7 @@ static void PictureRender(vout_display_t *vd, picture_t *pic) ...@@ -223,7 +223,7 @@ static void PictureRender(vout_display_t *vd, picture_t *pic)
{ {
vout_display_sys_t *sys = vd->sys; vout_display_sys_t *sys = vd->sys;
vout_display_opengl_Prepare( &sys->vgl, pic ); vout_display_opengl_Prepare( &sys->vgl, pic );
} }
...@@ -238,10 +238,10 @@ static void PictureDisplay(vout_display_t *vd, picture_t *pic) ...@@ -238,10 +238,10 @@ static void PictureDisplay(vout_display_t *vd, picture_t *pic)
static int Control (vout_display_t *vd, int query, va_list ap) static int Control (vout_display_t *vd, int query, va_list ap)
{ {
vout_display_sys_t *sys = vd->sys; vout_display_sys_t *sys = vd->sys;
switch (query) switch (query)
{ {
case VOUT_DISPLAY_CHANGE_FULLSCREEN: case VOUT_DISPLAY_CHANGE_FULLSCREEN:
case VOUT_DISPLAY_CHANGE_WINDOW_STATE: case VOUT_DISPLAY_CHANGE_WINDOW_STATE:
case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE: case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED: case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
...@@ -254,21 +254,20 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -254,21 +254,20 @@ static int Control (vout_display_t *vd, int query, va_list ap)
} }
case VOUT_DISPLAY_HIDE_MOUSE: case VOUT_DISPLAY_HIDE_MOUSE:
return VLC_SUCCESS; return VLC_SUCCESS;
case VOUT_DISPLAY_GET_OPENGL: case VOUT_DISPLAY_GET_OPENGL:
{ {
vout_opengl_t **gl = va_arg (ap, vout_opengl_t **); vout_opengl_t **gl = va_arg (ap, vout_opengl_t **);
*gl = &sys->gl; *gl = &sys->gl;
return VLC_SUCCESS; return VLC_SUCCESS;
} }
case VOUT_DISPLAY_RESET_PICTURES: case VOUT_DISPLAY_RESET_PICTURES:
assert (0); assert (0);
default: default:
msg_Err (vd, "Unknown request in Mac OS X vout display"); msg_Err (vd, "Unknown request in Mac OS X vout display");
return VLC_EGENERIC; return VLC_EGENERIC;
} }
printf("query %d\n", query);
} }
/***************************************************************************** /*****************************************************************************
...@@ -284,7 +283,7 @@ static int OpenglLock(vout_opengl_t *gl) ...@@ -284,7 +283,7 @@ static int OpenglLock(vout_opengl_t *gl)
[context makeCurrentContext]; [context makeCurrentContext];
return 0; return 0;
} }
return 1; return 1;
} }
static void OpenglUnlock(vout_opengl_t *gl) static void OpenglUnlock(vout_opengl_t *gl)
...@@ -332,9 +331,9 @@ static void OpenglSwap(vout_opengl_t *gl) ...@@ -332,9 +331,9 @@ static void OpenglSwap(vout_opengl_t *gl)
NSOpenGLPFAWindow, NSOpenGLPFAWindow,
0 0
}; };
NSOpenGLPixelFormat *fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attribs]; NSOpenGLPixelFormat *fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attribs];
if (!fmt) if (!fmt)
return nil; return nil;
...@@ -398,8 +397,8 @@ static void OpenglSwap(vout_opengl_t *gl) ...@@ -398,8 +397,8 @@ static void OpenglSwap(vout_opengl_t *gl)
else { else {
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
} }
} }
} }
/** /**
...@@ -408,7 +407,7 @@ static void OpenglSwap(vout_opengl_t *gl) ...@@ -408,7 +407,7 @@ static void OpenglSwap(vout_opengl_t *gl)
- (void)reshape - (void)reshape
{ {
VLCAssertMainThread(); VLCAssertMainThread();
NSRect bounds = [self bounds]; NSRect bounds = [self bounds];
CGFloat height = bounds.size.height; CGFloat height = bounds.size.height;
...@@ -420,10 +419,10 @@ static void OpenglSwap(vout_opengl_t *gl) ...@@ -420,10 +419,10 @@ static void OpenglSwap(vout_opengl_t *gl)
if (vd) { if (vd) {
CGFloat videoHeight = vd->source.i_visible_height; CGFloat videoHeight = vd->source.i_visible_height;
CGFloat videoWidth = vd->source.i_visible_width; CGFloat videoWidth = vd->source.i_visible_width;
GLint sarNum = vd->source.i_sar_num; GLint sarNum = vd->source.i_sar_num;
GLint sarDen = vd->source.i_sar_den; GLint sarDen = vd->source.i_sar_den;
if (height * videoWidth * sarNum < width * videoHeight * sarDen) if (height * videoWidth * sarNum < width * videoHeight * sarDen)
{ {
x = (height * videoWidth * sarNum) / (videoHeight * sarDen); x = (height * videoWidth * sarNum) / (videoHeight * sarDen);
...@@ -433,10 +432,10 @@ static void OpenglSwap(vout_opengl_t *gl) ...@@ -433,10 +432,10 @@ static void OpenglSwap(vout_opengl_t *gl)
{ {
x = width; x = width;
y = (width * videoHeight * sarDen) / (videoWidth * sarNum); y = (width * videoHeight * sarDen) / (videoWidth * sarNum);
} }
} }
} }
[self lockgl]; [self lockgl];
glClearColor(0, 0, 0, 1); glClearColor(0, 0, 0, 1);
glViewport((width - x) / 2, (height - y) / 2, x, y); glViewport((width - x) / 2, (height - y) / 2, x, y);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment