2002-01-12 23:28:22 +00:00
|
|
|
/*
|
2009-02-08 03:27:30 +00:00
|
|
|
* VIDIX-accelerated overlay in an X window
|
|
|
|
*
|
|
|
|
* copyright (C) Alex Beregszaszi & Zoltan Ponekker & Nick Kurshev
|
|
|
|
*
|
|
|
|
* WS window manager by Pontscho/Fresh!
|
|
|
|
*
|
|
|
|
* based on vo_gl.c and vo_vesa.c and vo_xmga.c (.so mastah! ;))
|
|
|
|
*
|
|
|
|
* This file is part of MPlayer.
|
|
|
|
*
|
|
|
|
* MPlayer is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* MPlayer is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2002-01-12 23:28:22 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <math.h>
|
|
|
|
#include <errno.h>
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "video_out.h"
|
|
|
|
#include "video_out_internal.h"
|
|
|
|
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xutil.h>
|
|
|
|
//#include <X11/keysym.h>
|
|
|
|
|
2008-08-04 06:16:23 +00:00
|
|
|
#ifdef CONFIG_XINERAMA
|
2002-01-18 18:15:43 +00:00
|
|
|
#include <X11/extensions/Xinerama.h>
|
|
|
|
#endif
|
|
|
|
|
2002-01-12 23:28:22 +00:00
|
|
|
#include "x11_common.h"
|
|
|
|
#include "aspect.h"
|
|
|
|
#include "mp_msg.h"
|
|
|
|
|
|
|
|
#include "vosub_vidix.h"
|
2008-06-20 20:16:34 +00:00
|
|
|
#include "vidix/vidix.h"
|
2002-01-12 23:28:22 +00:00
|
|
|
|
2007-12-02 14:06:03 +00:00
|
|
|
static const vo_info_t info = {
|
2002-01-12 23:28:22 +00:00
|
|
|
"X11 (VIDIX)",
|
|
|
|
"xvidix",
|
|
|
|
"Alex Beregszaszi",
|
|
|
|
""
|
|
|
|
};
|
|
|
|
|
2002-11-11 15:22:10 +00:00
|
|
|
LIBVO_EXTERN(xvidix)
|
2004-06-14 04:53:03 +00:00
|
|
|
#define UNUSED(x) ((void)(x)) /* Removes warning about unused arguments */
|
2002-01-12 23:28:22 +00:00
|
|
|
/* X11 related variables */
|
2002-01-26 19:42:21 +00:00
|
|
|
/* Colorkey handling */
|
2003-10-03 18:13:45 +00:00
|
|
|
static int colorkey;
|
2002-01-26 19:42:21 +00:00
|
|
|
static vidix_grkey_t gr_key;
|
2002-01-18 18:15:43 +00:00
|
|
|
|
2002-01-26 19:42:21 +00:00
|
|
|
/* VIDIX related */
|
|
|
|
static char *vidix_name;
|
2002-01-12 23:28:22 +00:00
|
|
|
|
|
|
|
/* Image parameters */
|
|
|
|
static uint32_t image_width;
|
|
|
|
static uint32_t image_height;
|
|
|
|
static uint32_t image_format;
|
|
|
|
|
|
|
|
/* Window parameters */
|
2002-06-04 18:39:16 +00:00
|
|
|
static uint32_t window_x, window_y;
|
2002-01-12 23:28:22 +00:00
|
|
|
static uint32_t window_width, window_height;
|
|
|
|
|
2002-01-26 19:42:21 +00:00
|
|
|
/* used by XGetGeometry & XTranslateCoordinates for moving/resizing window */
|
2002-01-12 23:28:22 +00:00
|
|
|
static uint32_t drwX, drwY, drwWidth, drwHeight, drwBorderWidth,
|
2002-03-07 17:50:25 +00:00
|
|
|
drwDepth, drwcX, drwcY, dwidth, dheight;
|
2002-01-12 23:28:22 +00:00
|
|
|
|
2008-12-03 23:01:03 +00:00
|
|
|
void set_video_eq(int cap);
|
2002-07-19 20:51:48 +00:00
|
|
|
|
2003-01-18 15:05:06 +00:00
|
|
|
|
2002-08-28 21:32:32 +00:00
|
|
|
static void set_window(int force_update)
|
2002-01-12 23:28:22 +00:00
|
|
|
{
|
2002-05-14 23:44:35 +00:00
|
|
|
Window mRoot;
|
2004-06-14 04:53:03 +00:00
|
|
|
|
|
|
|
if (WinID)
|
|
|
|
{
|
|
|
|
XGetGeometry(mDisplay, vo_window, &mRoot, &drwX, &drwY, &drwWidth,
|
|
|
|
&drwHeight, &drwBorderWidth, &drwDepth);
|
|
|
|
drwX = drwY = 0;
|
|
|
|
|
|
|
|
XTranslateCoordinates(mDisplay, vo_window, mRoot, 0, 0,
|
|
|
|
&drwcX, &drwcY, &mRoot);
|
|
|
|
aspect(&dwidth, &dheight, A_NOZOOM);
|
|
|
|
if (!vo_fs)
|
|
|
|
mp_msg(MSGT_VO, MSGL_V,
|
|
|
|
"[xvidix] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",
|
|
|
|
drwcX, drwcY, drwX, drwY, drwWidth, drwHeight);
|
|
|
|
|
|
|
|
/* following stuff copied from vo_xmga.c */
|
|
|
|
} else
|
|
|
|
{
|
|
|
|
aspect(&dwidth, &dheight, A_NOZOOM);
|
|
|
|
drwcX = drwX = vo_dx;
|
|
|
|
drwcY = drwY = vo_dy;
|
|
|
|
drwWidth = vo_dwidth;
|
|
|
|
drwHeight = vo_dheight;
|
|
|
|
}
|
2002-05-11 14:57:41 +00:00
|
|
|
|
2002-01-18 18:15:43 +00:00
|
|
|
#if X11_FULLSCREEN
|
2002-03-07 17:50:25 +00:00
|
|
|
if (vo_fs)
|
2002-01-18 18:15:43 +00:00
|
|
|
{
|
2004-06-14 04:53:03 +00:00
|
|
|
aspect(&dwidth, &dheight, A_ZOOM);
|
|
|
|
drwX =
|
|
|
|
(vo_screenwidth -
|
|
|
|
(dwidth > vo_screenwidth ? vo_screenwidth : dwidth)) / 2;
|
|
|
|
drwcX = drwX;
|
|
|
|
drwY =
|
|
|
|
(vo_screenheight -
|
|
|
|
(dheight > vo_screenheight ? vo_screenheight : dheight)) / 2;
|
|
|
|
drwcY = drwY;
|
|
|
|
drwWidth = (dwidth > vo_screenwidth ? vo_screenwidth : dwidth);
|
|
|
|
drwHeight =
|
|
|
|
(dheight > vo_screenheight ? vo_screenheight : dheight);
|
|
|
|
mp_msg(MSGT_VO, MSGL_V,
|
|
|
|
"[xvidix-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",
|
|
|
|
drwcX, drwcY, drwX, drwY, drwWidth, drwHeight);
|
2002-01-18 18:15:43 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-06-14 04:53:03 +00:00
|
|
|
vo_dwidth = drwWidth;
|
|
|
|
vo_dheight = drwHeight;
|
2002-06-05 19:35:54 +00:00
|
|
|
|
2008-10-16 18:13:26 +00:00
|
|
|
update_xinerama_info();
|
|
|
|
drwcX -= xinerama_x;
|
|
|
|
drwcY -= xinerama_y;
|
2002-01-18 18:15:43 +00:00
|
|
|
|
2004-06-14 04:53:03 +00:00
|
|
|
if (vo_panscan > 0.0f && vo_fs)
|
|
|
|
{
|
|
|
|
drwcX -= vo_panscan_x >> 1;
|
|
|
|
drwcY -= vo_panscan_y >> 1;
|
|
|
|
drwX -= vo_panscan_x >> 1;
|
|
|
|
drwY -= vo_panscan_y >> 1;
|
|
|
|
drwWidth += vo_panscan_x;
|
|
|
|
drwHeight += vo_panscan_y;
|
|
|
|
}
|
2002-06-05 19:35:54 +00:00
|
|
|
|
2002-01-18 18:15:43 +00:00
|
|
|
/* set new values in VIDIX */
|
2002-06-04 18:39:16 +00:00
|
|
|
if (force_update || (window_x != drwcX) || (window_y != drwcY) ||
|
2004-06-14 04:53:03 +00:00
|
|
|
(window_width != drwWidth) || (window_height != drwHeight))
|
2002-01-12 23:28:22 +00:00
|
|
|
{
|
2004-06-14 04:53:03 +00:00
|
|
|
// do a backup of window coordinates
|
|
|
|
window_x = drwcX;
|
|
|
|
window_y = drwcY;
|
|
|
|
vo_dx = drwcX;
|
|
|
|
vo_dy = drwcY;
|
|
|
|
window_width = drwWidth;
|
|
|
|
window_height = drwHeight;
|
|
|
|
|
|
|
|
/* FIXME: implement runtime resize/move if possible, this way is very ugly! */
|
|
|
|
vidix_stop();
|
|
|
|
if (vidix_init(image_width, image_height, vo_dx, vo_dy,
|
|
|
|
window_width, window_height, image_format,
|
|
|
|
vo_depthonscreen, vo_screenwidth,
|
|
|
|
vo_screenheight) != 0)
|
2002-01-12 23:28:22 +00:00
|
|
|
{
|
2004-06-14 04:53:03 +00:00
|
|
|
mp_msg(MSGT_VO, MSGL_FATAL,
|
|
|
|
"Can't initialize VIDIX driver: %s\n", strerror(errno));
|
|
|
|
abort();
|
|
|
|
}
|
|
|
|
vidix_start();
|
2002-01-12 23:28:22 +00:00
|
|
|
}
|
2004-06-14 04:53:03 +00:00
|
|
|
|
|
|
|
mp_msg(MSGT_VO, MSGL_V,
|
|
|
|
"[xvidix] window properties: pos: %dx%d, size: %dx%d\n", vo_dx,
|
|
|
|
vo_dy, window_width, window_height);
|
2002-01-12 23:28:22 +00:00
|
|
|
|
2002-01-19 22:43:19 +00:00
|
|
|
/* mDrawColorKey: */
|
|
|
|
|
|
|
|
/* fill drawable with specified color */
|
2003-10-22 13:22:00 +00:00
|
|
|
if (!(vo_colorkey & 0xff000000))
|
2003-10-17 09:08:37 +00:00
|
|
|
{
|
2004-06-14 04:53:03 +00:00
|
|
|
XSetBackground(mDisplay, vo_gc, 0L);
|
|
|
|
XClearWindow(mDisplay, vo_window);
|
|
|
|
XSetForeground(mDisplay, vo_gc, colorkey);
|
|
|
|
XFillRectangle(mDisplay, vo_window, vo_gc, drwX, drwY, drwWidth,
|
|
|
|
(vo_fs ? drwHeight - 1 : drwHeight));
|
2003-10-17 09:08:37 +00:00
|
|
|
}
|
2002-01-19 22:43:19 +00:00
|
|
|
/* flush, update drawable */
|
|
|
|
XFlush(mDisplay);
|
|
|
|
|
2002-01-12 23:28:22 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* connect to server, create and map window,
|
|
|
|
* allocate colors and (shared) memory
|
|
|
|
*/
|
2005-08-05 01:24:37 +00:00
|
|
|
static int config(uint32_t width, uint32_t height, uint32_t d_width,
|
2004-06-14 04:53:03 +00:00
|
|
|
uint32_t d_height, uint32_t flags, char *title,
|
|
|
|
uint32_t format)
|
2002-01-12 23:28:22 +00:00
|
|
|
{
|
|
|
|
XVisualInfo vinfo;
|
2004-06-14 04:53:03 +00:00
|
|
|
|
2002-11-06 23:54:29 +00:00
|
|
|
// XSizeHints hint;
|
2002-01-12 23:28:22 +00:00
|
|
|
XSetWindowAttributes xswa;
|
|
|
|
unsigned long xswamask;
|
|
|
|
XWindowAttributes attribs;
|
2003-10-03 18:13:45 +00:00
|
|
|
int window_depth, r, g, b;
|
2002-01-13 00:23:47 +00:00
|
|
|
|
2002-04-20 22:58:15 +00:00
|
|
|
title = "MPlayer VIDIX X11 Overlay";
|
2002-01-12 23:28:22 +00:00
|
|
|
|
|
|
|
image_height = height;
|
|
|
|
image_width = width;
|
|
|
|
image_format = format;
|
2002-02-01 10:20:00 +00:00
|
|
|
|
2002-01-18 18:15:43 +00:00
|
|
|
window_width = d_width;
|
|
|
|
window_height = d_height;
|
|
|
|
|
2002-05-07 13:31:29 +00:00
|
|
|
// vo_fs = flags&0x01;
|
|
|
|
// if (vo_fs)
|
|
|
|
// { vo_old_width=d_width; vo_old_height=d_height; }
|
2002-01-12 23:28:22 +00:00
|
|
|
|
2003-10-03 18:13:45 +00:00
|
|
|
r = (vo_colorkey & 0x00ff0000) >> 16;
|
|
|
|
g = (vo_colorkey & 0x0000ff00) >> 8;
|
|
|
|
b = vo_colorkey & 0x000000ff;
|
2004-06-14 04:53:03 +00:00
|
|
|
switch (vo_depthonscreen)
|
2002-01-18 18:15:43 +00:00
|
|
|
{
|
2004-06-14 04:53:03 +00:00
|
|
|
case 32:
|
|
|
|
colorkey = vo_colorkey;
|
|
|
|
break;
|
|
|
|
case 24:
|
|
|
|
colorkey = vo_colorkey & 0x00ffffff;
|
|
|
|
break;
|
|
|
|
case 16:
|
|
|
|
colorkey = ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);
|
|
|
|
break;
|
|
|
|
case 15:
|
|
|
|
colorkey = ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
mp_msg(MSGT_VO, MSGL_ERR,
|
|
|
|
"Sorry, this (%d) color depth is not supported\n",
|
|
|
|
vo_depthonscreen);
|
2002-01-18 18:15:43 +00:00
|
|
|
}
|
2004-11-15 09:09:29 +00:00
|
|
|
mp_msg(MSGT_VO, MSGL_V, "Using colorkey: %x\n", colorkey);
|
2002-01-12 23:28:22 +00:00
|
|
|
|
2002-01-18 18:15:43 +00:00
|
|
|
#ifdef X11_FULLSCREEN
|
2005-04-18 15:52:38 +00:00
|
|
|
if ((flags & VOFLAG_FULLSCREEN) || (flags & VOFLAG_SWSCALE))
|
2004-06-14 04:53:03 +00:00
|
|
|
aspect(&d_width, &d_height, A_ZOOM);
|
2002-01-18 18:15:43 +00:00
|
|
|
#endif
|
2004-06-14 04:53:03 +00:00
|
|
|
dwidth = d_width;
|
|
|
|
dheight = d_height;
|
|
|
|
/* Make the window */
|
|
|
|
XGetWindowAttributes(mDisplay, DefaultRootWindow(mDisplay),
|
|
|
|
&attribs);
|
|
|
|
|
|
|
|
/* from vo_x11 */
|
|
|
|
window_depth = attribs.depth;
|
|
|
|
if ((window_depth != 15) && (window_depth != 16)
|
|
|
|
&& (window_depth != 24) && (window_depth != 32))
|
|
|
|
window_depth = 24;
|
|
|
|
XMatchVisualInfo(mDisplay, mScreen, window_depth, TrueColor,
|
|
|
|
&vinfo);
|
|
|
|
|
|
|
|
xswa.background_pixel = BlackPixel(mDisplay, mScreen);
|
|
|
|
xswa.border_pixel = 0;
|
|
|
|
xswa.colormap =
|
|
|
|
XCreateColormap(mDisplay, RootWindow(mDisplay, mScreen),
|
|
|
|
vinfo.visual, AllocNone);
|
2008-11-19 20:19:25 +00:00
|
|
|
xswamask = CWBackPixel | CWBorderPixel | CWColormap;
|
|
|
|
|
2007-06-27 10:26:13 +00:00
|
|
|
vo_x11_create_vo_window(&vinfo, vo_dx, vo_dy,
|
|
|
|
window_width, window_height, flags,
|
|
|
|
CopyFromParent, "xvidix", title);
|
|
|
|
XChangeWindowAttributes(mDisplay, vo_window, xswamask, &xswa);
|
2004-06-14 04:53:03 +00:00
|
|
|
|
2005-04-18 15:52:38 +00:00
|
|
|
if ((!WinID) && (flags & VOFLAG_FULLSCREEN))
|
2004-06-14 04:53:03 +00:00
|
|
|
{
|
|
|
|
vo_dx = 0;
|
|
|
|
vo_dy = 0;
|
|
|
|
vo_dwidth = vo_screenwidth;
|
|
|
|
vo_dheight = vo_screenheight;
|
|
|
|
vo_fs = 1;
|
|
|
|
}
|
2002-01-19 22:43:19 +00:00
|
|
|
|
2002-01-19 16:58:33 +00:00
|
|
|
if (vidix_grkey_support())
|
|
|
|
{
|
2004-06-14 04:53:03 +00:00
|
|
|
vidix_grkey_get(&gr_key);
|
|
|
|
gr_key.key_op = KEYS_PUT;
|
|
|
|
if (!(vo_colorkey & 0xff000000))
|
|
|
|
{
|
|
|
|
gr_key.ckey.op = CKEY_TRUE;
|
|
|
|
gr_key.ckey.red = r;
|
|
|
|
gr_key.ckey.green = g;
|
|
|
|
gr_key.ckey.blue = b;
|
|
|
|
} else
|
|
|
|
gr_key.ckey.op = CKEY_FALSE;
|
|
|
|
vidix_grkey_set(&gr_key);
|
2002-01-19 16:58:33 +00:00
|
|
|
}
|
2002-01-12 23:28:22 +00:00
|
|
|
|
2002-08-28 21:32:32 +00:00
|
|
|
set_window(1);
|
2002-07-19 20:51:48 +00:00
|
|
|
|
2002-02-22 15:22:27 +00:00
|
|
|
XSync(mDisplay, False);
|
2002-01-12 23:28:22 +00:00
|
|
|
|
2002-06-10 18:40:19 +00:00
|
|
|
panscan_calc();
|
|
|
|
|
2008-05-16 08:33:27 +00:00
|
|
|
return 0;
|
2002-01-12 23:28:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void check_events(void)
|
|
|
|
{
|
|
|
|
const int event = vo_x11_check_events(mDisplay);
|
2002-01-13 00:23:47 +00:00
|
|
|
|
2002-01-19 22:43:19 +00:00
|
|
|
if ((event & VO_EVENT_RESIZE) || (event & VO_EVENT_EXPOSE))
|
2004-06-14 04:53:03 +00:00
|
|
|
set_window(0);
|
2002-01-18 18:15:43 +00:00
|
|
|
|
2002-01-13 00:23:47 +00:00
|
|
|
return;
|
2002-01-12 23:28:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* draw_osd, flip_page, draw_slice, draw_frame should be
|
|
|
|
overwritten with vidix functions (vosub_vidix.c) */
|
|
|
|
static void draw_osd(void)
|
|
|
|
{
|
2004-06-14 04:53:03 +00:00
|
|
|
mp_msg(MSGT_VO, MSGL_FATAL,
|
|
|
|
"[xvidix] error: didn't used vidix draw_osd!\n");
|
2002-01-12 23:28:22 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void flip_page(void)
|
|
|
|
{
|
2004-06-14 04:53:03 +00:00
|
|
|
mp_msg(MSGT_VO, MSGL_FATAL,
|
|
|
|
"[xvidix] error: didn't used vidix flip_page!\n");
|
2002-01-12 23:28:22 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2005-08-05 01:24:37 +00:00
|
|
|
static int draw_slice(uint8_t * src[], int stride[],
|
2004-06-14 04:53:03 +00:00
|
|
|
int w, int h, int x, int y)
|
2002-01-12 23:28:22 +00:00
|
|
|
{
|
2002-01-19 22:43:19 +00:00
|
|
|
UNUSED(src);
|
|
|
|
UNUSED(stride);
|
|
|
|
UNUSED(w);
|
|
|
|
UNUSED(h);
|
|
|
|
UNUSED(x);
|
|
|
|
UNUSED(y);
|
2004-06-14 04:53:03 +00:00
|
|
|
mp_msg(MSGT_VO, MSGL_FATAL,
|
|
|
|
"[xvidix] error: didn't used vidix draw_slice!\n");
|
2008-05-16 08:33:27 +00:00
|
|
|
return -1;
|
2002-01-12 23:28:22 +00:00
|
|
|
}
|
|
|
|
|
2005-08-05 01:24:37 +00:00
|
|
|
static int draw_frame(uint8_t * src[])
|
2002-01-12 23:28:22 +00:00
|
|
|
{
|
2002-01-19 22:43:19 +00:00
|
|
|
UNUSED(src);
|
2004-06-14 04:53:03 +00:00
|
|
|
mp_msg(MSGT_VO, MSGL_FATAL,
|
|
|
|
"[xvidix] error: didn't used vidix draw_frame!\n");
|
2008-05-16 08:33:27 +00:00
|
|
|
return -1;
|
2002-01-12 23:28:22 +00:00
|
|
|
}
|
|
|
|
|
2005-08-05 01:24:37 +00:00
|
|
|
static int query_format(uint32_t format)
|
2002-01-12 23:28:22 +00:00
|
|
|
{
|
2008-05-16 08:33:27 +00:00
|
|
|
return vidix_query_fourcc(format);
|
2002-01-12 23:28:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void uninit(void)
|
|
|
|
{
|
2004-06-14 04:53:03 +00:00
|
|
|
if (!vo_config_count)
|
|
|
|
return;
|
2002-01-18 18:15:43 +00:00
|
|
|
vidix_term();
|
2004-06-14 04:53:03 +00:00
|
|
|
|
2002-12-27 16:42:11 +00:00
|
|
|
if (vidix_name)
|
|
|
|
{
|
2004-06-14 04:53:03 +00:00
|
|
|
free(vidix_name);
|
|
|
|
vidix_name = NULL;
|
2002-12-27 16:42:11 +00:00
|
|
|
}
|
2002-01-19 22:43:19 +00:00
|
|
|
|
2002-05-14 23:44:35 +00:00
|
|
|
vo_x11_uninit();
|
2002-01-19 22:43:19 +00:00
|
|
|
}
|
2002-01-26 16:01:26 +00:00
|
|
|
|
2005-08-05 01:24:37 +00:00
|
|
|
static int preinit(const char *arg)
|
2002-01-26 16:01:26 +00:00
|
|
|
{
|
2002-05-08 20:24:35 +00:00
|
|
|
|
2002-01-26 19:42:21 +00:00
|
|
|
if (arg)
|
|
|
|
vidix_name = strdup(arg);
|
|
|
|
else
|
|
|
|
{
|
2004-06-14 04:53:03 +00:00
|
|
|
mp_msg(MSGT_VO, MSGL_INFO,
|
|
|
|
"No vidix driver name provided, probing available ones (-v option for details)!\n");
|
|
|
|
vidix_name = NULL;
|
2002-01-26 19:42:21 +00:00
|
|
|
}
|
|
|
|
|
2004-06-14 04:53:03 +00:00
|
|
|
if (!vo_init())
|
2008-05-16 08:33:27 +00:00
|
|
|
return -1;
|
2002-10-17 09:49:25 +00:00
|
|
|
|
2008-04-03 03:25:41 +00:00
|
|
|
if (vidix_preinit(vidix_name, video_out_xvidix.old_functions) != 0)
|
2008-05-16 08:33:27 +00:00
|
|
|
return 1;
|
2002-01-26 19:42:21 +00:00
|
|
|
|
2008-05-16 08:33:27 +00:00
|
|
|
return 0;
|
2002-01-26 16:01:26 +00:00
|
|
|
}
|
|
|
|
|
2008-04-02 16:38:34 +00:00
|
|
|
static int control(uint32_t request, void *data)
|
2002-01-26 16:01:26 +00:00
|
|
|
{
|
2004-06-14 04:53:03 +00:00
|
|
|
switch (request)
|
|
|
|
{
|
|
|
|
case VOCTRL_QUERY_FORMAT:
|
|
|
|
return query_format(*((uint32_t *) data));
|
|
|
|
case VOCTRL_GET_PANSCAN:
|
|
|
|
if (!vo_config_count || !vo_fs)
|
|
|
|
return VO_FALSE;
|
|
|
|
return VO_TRUE;
|
|
|
|
case VOCTRL_ONTOP:
|
|
|
|
vo_x11_ontop();
|
|
|
|
return VO_TRUE;
|
|
|
|
case VOCTRL_FULLSCREEN:
|
|
|
|
vo_x11_fullscreen();
|
|
|
|
case VOCTRL_SET_PANSCAN:
|
|
|
|
if (vo_fs && (vo_panscan != vo_panscan_amount))
|
|
|
|
{
|
|
|
|
panscan_calc();
|
|
|
|
set_window(0);
|
|
|
|
}
|
|
|
|
return VO_TRUE;
|
2007-02-17 20:58:55 +00:00
|
|
|
case VOCTRL_UPDATE_SCREENINFO:
|
|
|
|
aspect_save_screenres(vo_screenwidth, vo_screenheight);
|
|
|
|
return VO_TRUE;
|
|
|
|
|
2004-06-14 04:53:03 +00:00
|
|
|
}
|
|
|
|
return vidix_control(request, data);
|
2002-06-23 18:00:42 +00:00
|
|
|
// return VO_NOTIMPL;
|
2002-01-26 16:01:26 +00:00
|
|
|
}
|