2002-01-12 23:28:22 +00:00
|
|
|
/*
|
|
|
|
VIDIX accelerated overlay in a X window
|
|
|
|
|
2002-01-18 18:15:43 +00:00
|
|
|
(C) Alex Beregszaszi & Zoltan Ponekker & Nick Kurshev
|
2002-01-12 23:28:22 +00:00
|
|
|
|
|
|
|
WS window manager by Pontscho/Fresh!
|
|
|
|
|
2002-01-18 18:15:43 +00:00
|
|
|
Based on vo_gl.c and vo_vesa.c and vo_xmga.c (.so mastah! ;))
|
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>
|
|
|
|
|
2002-01-18 18:15:43 +00:00
|
|
|
#ifdef HAVE_XINERAMA
|
|
|
|
#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"
|
2002-01-18 18:15:43 +00:00
|
|
|
#include "../vidix/vidixlib.h"
|
2002-01-12 23:28:22 +00:00
|
|
|
|
|
|
|
LIBVO_EXTERN(xvidix)
|
|
|
|
|
|
|
|
static vo_info_t vo_info =
|
|
|
|
{
|
|
|
|
"X11 (VIDIX)",
|
|
|
|
"xvidix",
|
|
|
|
"Alex Beregszaszi",
|
|
|
|
""
|
|
|
|
};
|
|
|
|
|
2002-01-19 22:43:19 +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-18 18:15:43 +00:00
|
|
|
static Window mWindow;
|
2002-01-12 23:28:22 +00:00
|
|
|
static int X_already_started = 0;
|
|
|
|
|
2002-01-18 18:15:43 +00:00
|
|
|
static GC mGC;
|
|
|
|
static XGCValues mGCV;
|
|
|
|
static uint32_t fgColor;
|
|
|
|
|
2002-01-12 23:28:22 +00:00
|
|
|
/* VIDIX related stuff */
|
2002-01-13 00:23:47 +00:00
|
|
|
static const char *vidix_name = (char *)(-1);
|
2002-01-13 10:30:10 +00:00
|
|
|
static int pre_init_err = 0;
|
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;
|
|
|
|
static uint32_t image_depth;
|
|
|
|
|
|
|
|
/* Window parameters */
|
|
|
|
static uint32_t window_x, window_y;
|
|
|
|
static uint32_t window_width, window_height;
|
|
|
|
|
|
|
|
/* used by XGetGeometry & XTranslateCoordinates */
|
|
|
|
static Window mRoot;
|
|
|
|
static uint32_t drwX, drwY, drwWidth, drwHeight, drwBorderWidth,
|
|
|
|
drwDepth, drwcX, drwcY, dwidth, dheight, mFullscreen;
|
|
|
|
|
2002-01-18 18:15:43 +00:00
|
|
|
static vidix_grkey_t gr_key;
|
|
|
|
|
|
|
|
static void set_window(int force_update)
|
2002-01-12 23:28:22 +00:00
|
|
|
{
|
2002-01-18 18:15:43 +00:00
|
|
|
#ifdef HAVE_NEW_GUI
|
|
|
|
if (vo_window != None)
|
|
|
|
{
|
|
|
|
if ((vo_dwidth == vo_screenwidth) && (vo_dheight == vo_screenheight))
|
|
|
|
{
|
|
|
|
mFullscreen = 1;
|
|
|
|
dwidth = vo_screenwidth;
|
2002-01-19 22:43:19 +00:00
|
|
|
dheight = vo_screenwidth * vo_dheight / vo_dwidth;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mFullscreen = 0;
|
|
|
|
dwidth = vo_dwidth;
|
|
|
|
dheight = vo_dheight;
|
2002-01-18 18:15:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
XGetGeometry(mDisplay, mWindow, &mRoot, &drwX, &drwY, &drwWidth,
|
2002-01-12 23:28:22 +00:00
|
|
|
&drwHeight, &drwBorderWidth, &drwDepth);
|
|
|
|
drwX = drwY = 0;
|
2002-01-18 18:15:43 +00:00
|
|
|
XTranslateCoordinates(mDisplay, mWindow, mRoot, 0, 0,
|
|
|
|
&drwcX, &drwcY, &mRoot);
|
2002-01-12 23:28:22 +00:00
|
|
|
|
2002-01-19 22:43:19 +00:00
|
|
|
if (!mFullscreen)
|
|
|
|
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);
|
2002-01-12 23:28:22 +00:00
|
|
|
|
2002-01-18 18:15:43 +00:00
|
|
|
/* following stuff copied from vo_xmga.c */
|
|
|
|
aspect(&dwidth, &dheight, A_NOZOOM);
|
|
|
|
#if X11_FULLSCREEN
|
|
|
|
if (mFullscreen)
|
|
|
|
{
|
|
|
|
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);
|
2002-01-19 22:43:19 +00:00
|
|
|
mp_msg(MSGT_VO, MSGL_V, "[xvidix-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",
|
2002-01-18 18:15:43 +00:00
|
|
|
drwcX, drwcY, drwX, drwY, drwWidth, drwHeight);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_XINERAMA
|
|
|
|
if (XineramaIsActive(mDisplay))
|
|
|
|
{
|
|
|
|
XineramaScreenInfo *screens;
|
|
|
|
int num_screens;
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
screens = XineramaQueryScreens(mDisplay, &num_screens);
|
|
|
|
|
|
|
|
/* find the screen we are on */
|
|
|
|
while ((screens[i].x_org <= drwcX) || (screens[i].y_org <= drwcY) ||
|
|
|
|
(screens[i].x_org + screens[i].width >= drwcX) ||
|
|
|
|
(screens[i].y_org + screens[i].height >= drwcY))
|
|
|
|
i++;
|
|
|
|
|
|
|
|
/* set drwcX and drwcY to the right values */
|
|
|
|
drwcX = drwcX - screens[i].x_org;
|
|
|
|
drwcY = drwcY - screens[i].y_org;
|
|
|
|
XFree(screens);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* set new values in VIDIX */
|
2002-01-19 22:43:19 +00:00
|
|
|
if (force_update || (window_x != drwcX) || (window_y != drwcY) ||
|
|
|
|
(window_width != drwWidth) || (window_height != drwHeight))
|
2002-01-12 23:28:22 +00:00
|
|
|
{
|
2002-01-16 09:18:43 +00:00
|
|
|
window_x = drwcX;
|
|
|
|
window_y = drwcY;
|
|
|
|
window_width = drwWidth;
|
|
|
|
window_height = drwHeight;
|
2002-01-16 15:22:45 +00:00
|
|
|
|
2002-01-12 23:28:22 +00:00
|
|
|
/* FIXME: implement runtime resize/move if possible, this way is very ugly! */
|
2002-01-16 15:22:45 +00:00
|
|
|
vidix_stop();
|
2002-01-12 23:28:22 +00:00
|
|
|
if (vidix_init(image_width, image_height, window_x, window_y,
|
2002-01-13 10:40:17 +00:00
|
|
|
window_width, window_height, image_format, vo_depthonscreen, vo_screenwidth, vo_screenheight) != 0)
|
2002-01-12 23:28:22 +00:00
|
|
|
{
|
|
|
|
mp_msg(MSGT_VO, MSGL_FATAL, "Can't initialize VIDIX driver: %s: %s\n",
|
|
|
|
vidix_name, strerror(errno));
|
|
|
|
vidix_term();
|
|
|
|
uninit();
|
|
|
|
exit(1); /* !!! */
|
|
|
|
}
|
2002-01-16 15:22:45 +00:00
|
|
|
vidix_start();
|
2002-01-12 23:28:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
mp_msg(MSGT_VO, MSGL_INFO, "[xvidix] window properties: pos: %dx%d, size: %dx%d\n",
|
|
|
|
window_x, window_y, window_width, window_height);
|
|
|
|
|
2002-01-19 22:43:19 +00:00
|
|
|
|
|
|
|
/* mDrawColorKey: */
|
|
|
|
|
|
|
|
/* fill drawable with specified color */
|
|
|
|
XSetForeground(mDisplay, mGC, fgColor);
|
|
|
|
XFillRectangle(mDisplay, mWindow, mGC, drwX, drwY, drwWidth,
|
|
|
|
(mFullscreen ? drwHeight - 1 : drwHeight));
|
|
|
|
/* 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
|
|
|
|
*/
|
|
|
|
static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width,
|
|
|
|
uint32_t d_height, uint32_t flags, char *title, uint32_t format)
|
|
|
|
{
|
|
|
|
XVisualInfo vinfo;
|
|
|
|
XSizeHints hint;
|
|
|
|
XSetWindowAttributes xswa;
|
|
|
|
unsigned long xswamask;
|
|
|
|
XWindowAttributes attribs;
|
|
|
|
int window_depth;
|
2002-01-13 00:23:47 +00:00
|
|
|
|
2002-01-13 10:30:10 +00:00
|
|
|
if(pre_init_err)
|
|
|
|
{
|
|
|
|
mp_msg(MSGT_VO, MSGL_INFO, "[xvidix] Quiting due preinit error\n");
|
|
|
|
return -1;
|
|
|
|
}
|
2002-01-13 00:23:47 +00:00
|
|
|
// if (title)
|
|
|
|
// free(title);
|
|
|
|
title = strdup("MPlayer VIDIX X11 Overlay");
|
2002-01-12 23:28:22 +00:00
|
|
|
|
|
|
|
image_height = height;
|
|
|
|
image_width = width;
|
|
|
|
image_format = format;
|
|
|
|
|
|
|
|
if (IMGFMT_IS_RGB(format))
|
|
|
|
{
|
|
|
|
image_depth = IMGFMT_RGB_DEPTH(format);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
if (IMGFMT_IS_BGR(format))
|
|
|
|
{
|
|
|
|
image_depth = IMGFMT_BGR_DEPTH(format);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
switch(format)
|
|
|
|
{
|
|
|
|
case IMGFMT_IYUV:
|
|
|
|
case IMGFMT_I420:
|
|
|
|
case IMGFMT_YV12:
|
|
|
|
image_depth = 12;
|
|
|
|
break;
|
|
|
|
case IMGFMT_YUY2:
|
|
|
|
image_depth = 16;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
mp_msg(MSGT_VO, MSGL_FATAL, "Unknown image format: %s",
|
|
|
|
vo_format_name(format));
|
|
|
|
return(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (X_already_started)
|
|
|
|
return(-1);
|
|
|
|
if (!vo_init())
|
|
|
|
return(-1);
|
|
|
|
|
2002-01-18 18:15:43 +00:00
|
|
|
aspect_save_orig(width, height);
|
|
|
|
aspect_save_prescale(d_width, d_height);
|
|
|
|
aspect_save_screenres(vo_screenwidth, vo_screenheight);
|
|
|
|
|
|
|
|
window_x = 0;
|
|
|
|
window_y = 0;
|
|
|
|
window_width = d_width;
|
|
|
|
window_height = d_height;
|
|
|
|
|
|
|
|
mFullscreen = flags&0x01;
|
2002-01-12 23:28:22 +00:00
|
|
|
|
|
|
|
X_already_started++;
|
2002-01-18 18:15:43 +00:00
|
|
|
|
|
|
|
/* from xmga.c */
|
|
|
|
switch(vo_depthonscreen)
|
|
|
|
{
|
|
|
|
case 32:
|
|
|
|
case 24:
|
|
|
|
fgColor = 0x00ff00ffL;
|
|
|
|
break;
|
|
|
|
case 16:
|
|
|
|
fgColor = 0xf81fL;
|
|
|
|
break;
|
|
|
|
case 15:
|
|
|
|
fgColor = 0x7c1fL;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
mp_msg(MSGT_VO, MSGL_ERR, "Sorry, this (%d) color depth is not supported\n",
|
|
|
|
vo_depthonscreen);
|
|
|
|
}
|
2002-01-12 23:28:22 +00:00
|
|
|
|
|
|
|
aspect(&d_width, &d_height, A_NOZOOM);
|
|
|
|
|
2002-01-18 18:15:43 +00:00
|
|
|
#ifdef HAVE_NEW_GUI
|
|
|
|
if (vo_window == None)
|
|
|
|
{
|
|
|
|
#endif
|
2002-01-12 23:28:22 +00:00
|
|
|
|
2002-01-18 18:15:43 +00:00
|
|
|
#ifdef X11_FULLSCREEN
|
|
|
|
if (mFullscreen) /* fullscreen */
|
2002-01-19 22:43:19 +00:00
|
|
|
{
|
2002-01-18 18:15:43 +00:00
|
|
|
if (flags & 0x04)
|
|
|
|
{
|
|
|
|
aspect(&d_width, &d_height, A_ZOOM);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
d_width = vo_screenwidth;
|
|
|
|
d_height = vo_screenheight;
|
|
|
|
}
|
2002-01-19 22:43:19 +00:00
|
|
|
}
|
2002-01-18 18:15:43 +00:00
|
|
|
#endif
|
2002-01-12 23:28:22 +00:00
|
|
|
|
|
|
|
/* 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);
|
|
|
|
|
2002-01-18 18:15:43 +00:00
|
|
|
xswa.background_pixel = BlackPixel(mDisplay, mScreen);
|
|
|
|
xswa.border_pixel = 0;
|
2002-01-12 23:28:22 +00:00
|
|
|
xswa.colormap = XCreateColormap(mDisplay, RootWindow(mDisplay, mScreen),
|
|
|
|
vinfo.visual, AllocNone);
|
2002-01-18 18:15:43 +00:00
|
|
|
xswa.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
|
|
|
|
xswamask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
|
2002-01-12 23:28:22 +00:00
|
|
|
|
|
|
|
if (WinID >= 0)
|
|
|
|
{
|
2002-01-18 18:15:43 +00:00
|
|
|
mWindow = WinID ? ((Window)WinID) : RootWindow(mDisplay, mScreen);
|
|
|
|
XUnmapWindow(mDisplay, mWindow);
|
|
|
|
XChangeWindowAttributes(mDisplay, mWindow, xswamask, &xswa);
|
2002-01-12 23:28:22 +00:00
|
|
|
}
|
|
|
|
else
|
2002-01-18 18:15:43 +00:00
|
|
|
mWindow = XCreateWindow(mDisplay, RootWindow(mDisplay, mScreen),
|
2002-01-19 22:43:19 +00:00
|
|
|
window_x, window_y, window_width, window_height, xswa.border_pixel,
|
2002-01-18 18:15:43 +00:00
|
|
|
vinfo.depth, InputOutput, vinfo.visual, xswamask, &xswa);
|
2002-01-12 23:28:22 +00:00
|
|
|
|
2002-01-18 18:15:43 +00:00
|
|
|
vo_x11_classhint(mDisplay, mWindow, "xvidix");
|
|
|
|
vo_hidecursor(mDisplay, mWindow);
|
2002-01-12 23:28:22 +00:00
|
|
|
|
2002-01-18 18:15:43 +00:00
|
|
|
#ifdef X11_FULLSCREEN
|
|
|
|
if (mFullscreen) /* fullscreen */
|
|
|
|
vo_x11_decoration(mDisplay, mWindow, 0);
|
|
|
|
#endif
|
2002-01-12 23:28:22 +00:00
|
|
|
|
2002-01-18 18:15:43 +00:00
|
|
|
XGetNormalHints(mDisplay, mWindow, &hint);
|
|
|
|
hint.x = window_x;
|
|
|
|
hint.y = window_y;
|
|
|
|
hint.base_width = hint.width = window_width;
|
|
|
|
hint.base_height = hint.height = window_height;
|
|
|
|
hint.flags = USPosition | USSize;
|
|
|
|
XSetNormalHints(mDisplay, mWindow, &hint);
|
|
|
|
|
|
|
|
XStoreName(mDisplay, mWindow, title);
|
2002-01-12 23:28:22 +00:00
|
|
|
/* Map window. */
|
2002-01-18 18:15:43 +00:00
|
|
|
|
|
|
|
XMapWindow(mDisplay, mWindow);
|
2002-01-12 23:28:22 +00:00
|
|
|
#ifdef HAVE_XINERAMA
|
2002-01-18 18:15:43 +00:00
|
|
|
vo_x11_xinerama_move(mDisplay, mWindow);
|
2002-01-13 00:23:47 +00:00
|
|
|
#endif
|
2002-01-18 18:15:43 +00:00
|
|
|
|
|
|
|
mGC = XCreateGC(mDisplay, mWindow, GCForeground, &mGCV);
|
|
|
|
|
|
|
|
#ifdef HAVE_NEW_GUI
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-01-19 22:43:19 +00:00
|
|
|
/* window was created by GUI */
|
2002-01-18 18:15:43 +00:00
|
|
|
mWindow = vo_window;
|
|
|
|
mGC = vo_gc;
|
|
|
|
}
|
2002-01-12 23:28:22 +00:00
|
|
|
#endif
|
|
|
|
|
2002-01-19 22:43:19 +00:00
|
|
|
mp_msg(MSGT_VO, MSGL_INFO, "[xvidix] image properties: %dx%d depth: %d\n",
|
|
|
|
image_width, image_height, image_depth);
|
|
|
|
|
2002-01-19 16:58:33 +00:00
|
|
|
if (vidix_grkey_support())
|
|
|
|
{
|
|
|
|
vidix_grkey_get(&gr_key);
|
|
|
|
gr_key.key_op = KEYS_PUT;
|
|
|
|
gr_key.ckey.op = CKEY_TRUE;
|
|
|
|
gr_key.ckey.red = 255;
|
|
|
|
gr_key.ckey.green = 0;
|
|
|
|
gr_key.ckey.blue = 255;
|
|
|
|
vidix_grkey_set(&gr_key);
|
|
|
|
}
|
2002-01-12 23:28:22 +00:00
|
|
|
|
2002-01-18 18:15:43 +00:00
|
|
|
set_window(1);
|
2002-01-12 23:28:22 +00:00
|
|
|
|
2002-01-19 22:43:19 +00:00
|
|
|
#ifdef HAVE_NEW_GUI
|
|
|
|
if (vo_window == None)
|
2002-01-18 18:15:43 +00:00
|
|
|
#endif
|
2002-01-12 23:28:22 +00:00
|
|
|
{
|
2002-01-19 22:43:19 +00:00
|
|
|
XFlush(mDisplay);
|
|
|
|
XSync(mDisplay, False);
|
2002-01-12 23:28:22 +00:00
|
|
|
}
|
|
|
|
|
2002-01-18 18:15:43 +00:00
|
|
|
#ifdef HAVE_NEW_GUI
|
2002-01-19 22:43:19 +00:00
|
|
|
if (vo_window == None)
|
2002-01-18 18:15:43 +00:00
|
|
|
#endif
|
2002-01-12 23:28:22 +00:00
|
|
|
saver_off(mDisplay); /* turning off screen saver */
|
|
|
|
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const vo_info_t *get_info(void)
|
|
|
|
{
|
|
|
|
return(&vo_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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))
|
2002-01-18 18:15:43 +00:00
|
|
|
set_window(0);
|
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
mp_msg(MSGT_VO, MSGL_FATAL, "[xvidix] error: didn't used vidix draw_osd!\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void flip_page(void)
|
|
|
|
{
|
|
|
|
mp_msg(MSGT_VO, MSGL_FATAL, "[xvidix] error: didn't used vidix flip_page!\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static uint32_t draw_slice(uint8_t *src[], int stride[],
|
|
|
|
int w, int h, int x, int y)
|
|
|
|
{
|
2002-01-19 22:43:19 +00:00
|
|
|
UNUSED(src);
|
|
|
|
UNUSED(stride);
|
|
|
|
UNUSED(w);
|
|
|
|
UNUSED(h);
|
|
|
|
UNUSED(x);
|
|
|
|
UNUSED(y);
|
2002-01-12 23:28:22 +00:00
|
|
|
mp_msg(MSGT_VO, MSGL_FATAL, "[xvidix] error: didn't used vidix draw_slice!\n");
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static uint32_t draw_frame(uint8_t *src[])
|
|
|
|
{
|
2002-01-19 22:43:19 +00:00
|
|
|
UNUSED(src);
|
2002-01-12 23:28:22 +00:00
|
|
|
mp_msg(MSGT_VO, MSGL_FATAL, "[xvidix] error: didn't used vidix draw_frame!\n");
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static uint32_t query_format(uint32_t format)
|
|
|
|
{
|
2002-01-13 10:30:10 +00:00
|
|
|
static int first = 1;
|
|
|
|
if(first)
|
|
|
|
{
|
|
|
|
first = 0;
|
2002-01-13 00:23:47 +00:00
|
|
|
if (vidix_name == (char *)(-1))
|
|
|
|
{
|
|
|
|
if (vo_subdevice)
|
|
|
|
vidix_name = strdup(vo_subdevice);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mp_msg(MSGT_VO, MSGL_INFO, "No vidix driver name provided, probing available drivers!\n");
|
|
|
|
vidix_name = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (vidix_preinit(vidix_name, &video_out_xvidix) != 0)
|
2002-01-13 10:30:10 +00:00
|
|
|
{
|
|
|
|
pre_init_err = 1;
|
2002-01-13 00:23:47 +00:00
|
|
|
return(0);
|
2002-01-13 10:30:10 +00:00
|
|
|
}
|
|
|
|
}
|
2002-01-18 18:15:43 +00:00
|
|
|
return(pre_init_err ? 0 : vidix_query_fourcc(format));
|
2002-01-12 23:28:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void uninit(void)
|
|
|
|
{
|
2002-01-18 18:15:43 +00:00
|
|
|
vidix_term();
|
2002-01-12 23:28:22 +00:00
|
|
|
#ifdef HAVE_NEW_GUI
|
2002-01-19 22:43:19 +00:00
|
|
|
/* destroy window only if it's not controlled by GUI */
|
2002-01-12 23:28:22 +00:00
|
|
|
if (vo_window == None)
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
saver_on(mDisplay); /* screen saver back on */
|
2002-01-18 18:15:43 +00:00
|
|
|
if (!(WinID > 0)) /* don't destory window if -wid specified */
|
2002-01-19 22:43:19 +00:00
|
|
|
{
|
2002-01-18 18:15:43 +00:00
|
|
|
XDestroyWindow(mDisplay, mWindow);
|
2002-01-19 22:43:19 +00:00
|
|
|
XCloseDisplay(mDisplay);
|
|
|
|
}
|
2002-01-12 23:28:22 +00:00
|
|
|
}
|
|
|
|
}
|
2002-01-19 22:43:19 +00:00
|
|
|
|
|
|
|
/* i think this is obsoleted.... -- alex */
|
|
|
|
static void Terminate_Display_Process(void)
|
|
|
|
{
|
|
|
|
getchar(); /* wait for enter to remove window */
|
|
|
|
vidix_term();
|
|
|
|
XDestroyWindow(mDisplay, mWindow);
|
|
|
|
XCloseDisplay(mDisplay);
|
|
|
|
X_already_started = 0;
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|