Add support for -geometry to corevideo.

Based on a patch by Tim Wojtulewicz (timwoj at ieee dot org).


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30043 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
adrian 2009-12-15 20:38:54 +00:00
parent 5f0b5dcaa9
commit 2a33cd01f6
2 changed files with 13 additions and 9 deletions

View File

@ -3138,7 +3138,7 @@ y coordinates are relative to the top-left corner of the window rather
than the screen. than the screen.
The coordinates are relative to the screen given with \-xineramascreen for The coordinates are relative to the screen given with \-xineramascreen for
the video output drivers that fully support \-xineramascreen (direct3d, gl, gl2, the video output drivers that fully support \-xineramascreen (direct3d, gl, gl2,
vdpau, x11, xv, xvmc). vdpau, x11, xv, xvmc, corevideo).
.br .br
.I NOTE: .I NOTE:
This option is only supported by the x11, xmga, xv, xvmc, xvidix, This option is only supported by the x11, xmga, xv, xvmc, xvidix,

View File

@ -497,16 +497,21 @@ static int control(uint32_t request, void *data, ...)
- (void) config - (void) config
{ {
uint32_t d_width; NSRect visibleFrame;
uint32_t d_height;
NSRect frame;
CVReturn error = kCVReturnSuccess; CVReturn error = kCVReturnSuccess;
//config window //config window
d_width = vo_dwidth; d_height = vo_dheight; [window setContentSize:NSMakeSize(vo_dwidth, vo_dheight)];
frame = NSMakeRect(0, 0, d_width, d_height);
[window setContentSize: frame.size]; // Use visibleFrame to position the window taking the menu bar and dock into account.
// Also flip vo_dy since the screen origin is in the bottom left on OSX.
if (screen_id < 0)
visibleFrame = [[[mpGLView window] screen] visibleFrame];
else
visibleFrame = [[[NSScreen screens] objectAtIndex:screen_id] visibleFrame];
[window setFrameTopLeftPoint:NSMakePoint(
visibleFrame.origin.x + vo_dx,
visibleFrame.origin.y + visibleFrame.size.height - vo_dy)];
[self releaseVideoSpecific]; [self releaseVideoSpecific];
error = CVPixelBufferCreateWithBytes(NULL, image_width, image_height, pixelFormat, image_datas[0], image_width*image_bytes, NULL, NULL, NULL, &frameBuffers[0]); error = CVPixelBufferCreateWithBytes(NULL, image_width, image_height, pixelFormat, image_datas[0], image_width*image_bytes, NULL, NULL, NULL, &frameBuffers[0]);
@ -523,7 +528,6 @@ static int control(uint32_t request, void *data, ...)
mp_msg(MSGT_VO, MSGL_ERR,"[vo_corevideo] Failed to create OpenGL texture(%d)\n", error); mp_msg(MSGT_VO, MSGL_ERR,"[vo_corevideo] Failed to create OpenGL texture(%d)\n", error);
//show window //show window
[window center];
[window makeKeyAndOrderFront:mpGLView]; [window makeKeyAndOrderFront:mpGLView];
if(vo_rootwin) if(vo_rootwin)