aboutsummaryrefslogtreecommitdiffhomepage
path: root/libvo
diff options
context:
space:
mode:
authorGravatar Uoti Urpala <uau@glyph.nonexistent.invalid>2011-01-31 03:44:50 +0200
committerGravatar Uoti Urpala <uau@glyph.nonexistent.invalid>2011-01-31 16:03:10 +0200
commit6d534cd3cb5ca12d41f53345e92b9ab594971406 (patch)
treeb1c80430a490877234dd6226e5e635823b913b4c /libvo
parent902289f2b3754b43e474cf5b5d3b0a4dbb7e7069 (diff)
vidix: drop VIDIX support
By now VIDIX is too obscure to justify the amount of code and complexity it requires in the sources. Although there is no pressing need to drop it just now from a code point of view, I'll rather remove it before release than release with VIDIX support and then drop it later. Some of the manpage mentions of VIDIX were in "this option supported for these VOs" lists that looked outdated and failed to mention vdpau for example. Replace such incorrect lists with a generic "not supported for all VOs" mention.
Diffstat (limited to 'libvo')
-rw-r--r--libvo/video_out.c12
-rw-r--r--libvo/vo_cvidix.c178
-rw-r--r--libvo/vo_fbdev.c83
-rw-r--r--libvo/vo_svga.c52
-rw-r--r--libvo/vo_vesa.c74
-rw-r--r--libvo/vo_winvidix.c345
-rw-r--r--libvo/vo_xvidix.c421
-rw-r--r--libvo/vosub_vidix.c702
-rw-r--r--libvo/vosub_vidix.h47
9 files changed, 0 insertions, 1914 deletions
diff --git a/libvo/video_out.c b/libvo/video_out.c
index 3e2e108d4b..6bfc22575e 100644
--- a/libvo/video_out.c
+++ b/libvo/video_out.c
@@ -118,9 +118,6 @@ extern struct vo_driver video_out_gif89a;
extern struct vo_driver video_out_vesa;
extern struct vo_driver video_out_directfb;
extern struct vo_driver video_out_dfbmga;
-extern struct vo_driver video_out_xvidix;
-extern struct vo_driver video_out_winvidix;
-extern struct vo_driver video_out_cvidix;
extern struct vo_driver video_out_tdfx_vid;
extern struct vo_driver video_out_xvr100;
extern struct vo_driver video_out_tga;
@@ -237,15 +234,6 @@ const struct vo_driver *video_out_drivers[] =
#ifdef CONFIG_DIRECTFB
&video_out_dfbmga,
#endif
-#ifdef CONFIG_VIDIX
-#ifdef CONFIG_X11
- &video_out_xvidix,
-#endif
-#if defined(__MINGW32__) || defined(__CYGWIN__)
- &video_out_winvidix,
-#endif
- &video_out_cvidix,
-#endif
&video_out_null,
// should not be auto-selected
#ifdef CONFIG_DIRECTFB
diff --git a/libvo/vo_cvidix.c b/libvo/vo_cvidix.c
deleted file mode 100644
index d0e6860c65..0000000000
--- a/libvo/vo_cvidix.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * VIDIX-accelerated overlay on (black) background
- *
- * should work on any OS
- *
- * copyright (C) 2003 Sascha Sommer
- *
- * 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.
- */
-
-#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 "aspect.h"
-#include "geometry.h"
-
-#include "mp_msg.h"
-
-#include "vosub_vidix.h"
-#include "vidix/vidix.h"
-
-
-static const vo_info_t info = {
- "console VIDIX",
- "cvidix",
- "Sascha Sommer",
- ""
-};
-
-LIBVO_EXTERN(cvidix)
-
-/* VIDIX related */
-static char *vidix_name;
-static uint32_t swidth,sheight,sformat;
-/// center video only when screenw & height are set
-static uint32_t center=0;
-static vidix_grkey_t gr_key;
-
-
-static uint32_t setup_vidix(void){
- int x=vo_dx,y=vo_dy;
- aspect(&vo_dwidth,&vo_dheight,vo_fs ? A_ZOOM : A_NOZOOM);
- if(vo_fs || center){
- if(vo_dwidth <= vo_screenwidth)x = (vo_screenwidth - vo_dwidth)/2;
- else x=0;
- if(vo_dheight <= vo_screenheight)y = (vo_screenheight - vo_dheight)/2;
- else y=0;
- }
- if(vo_config_count)vidix_stop();
- if(vidix_init(swidth, sheight, x, y, vo_dwidth, vo_dheight, sformat, 32, vo_screenwidth,vo_screenheight)){
- mp_msg(MSGT_VO, MSGL_FATAL, "Can't setup VIDIX driver: %s\n", strerror(errno));
- return 1;
- }
- vidix_start();
- if(vidix_grkey_support()){
- vidix_grkey_get(&gr_key);
- gr_key.key_op = KEYS_PUT;
- if (!vo_fs && !(vo_colorkey & 0xff000000)){
- gr_key.ckey.op = CKEY_TRUE;
- gr_key.ckey.red = (vo_colorkey & 0x00FF0000) >> 16;
- gr_key.ckey.green = (vo_colorkey & 0x0000FF00) >> 8;
- gr_key.ckey.blue = vo_colorkey & 0x000000FF;
- }
- else gr_key.ckey.op = CKEY_FALSE;
- vidix_grkey_set(&gr_key);
- }
- return 0;
-}
-
-static int config(uint32_t width, uint32_t height, uint32_t d_width,uint32_t d_height, uint32_t flags, char *title, uint32_t format){
- vo_fs = flags & VOFLAG_FULLSCREEN;
- if(!vo_config_count){
- if(vo_screenwidth && vo_screenheight){
- if(!vo_geometry)center=1;
- }
- }
- if(!vo_screenwidth){
- mp_msg(MSGT_VO, MSGL_WARN, "vo_cvidix: Screen width not set (see -screenw), assuming 640 pixels.\n");
- vo_screenwidth = 640;
- }
- if(!vo_screenheight){
- mp_msg(MSGT_VO, MSGL_WARN, "vo_cvidix: Screen height not set (see -screenh), assuming 480 pixels.\n");
- vo_screenheight = 480;
- }
- swidth = width;
- sheight = height;
- sformat = format;
- vo_dwidth=d_width;
- vo_dheight=d_height;
- aspect_save_orig(width,height);
- aspect_save_prescale(d_width,d_height);
- aspect_save_screenres(vo_screenwidth,vo_screenheight);
- if(!vo_geometry){
- vo_dx=0;
- vo_dy=0;
- }
- else geometry(&vo_dx, &vo_dy, &vo_dwidth, &vo_dheight,vo_screenwidth,vo_screenheight);
- return setup_vidix();
-}
-
-static void check_events(void){
-}
-
-/* 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, "vo_cvidix: error: didn't use vidix draw_osd!\n");
- return;
-}
-
-static void flip_page(void){
- mp_msg(MSGT_VO, MSGL_FATAL, "vo_cvidix: error: didn't use vidix flip_page!\n");
- return;
-}
-
-static int draw_slice(uint8_t *src[], int stride[],int w, int h, int x, int y){
- mp_msg(MSGT_VO, MSGL_FATAL, "vo_cvidix: error: didn't use vidix draw_slice!\n");
- return -1;
-}
-
-static int draw_frame(uint8_t *src[]){
- mp_msg(MSGT_VO, MSGL_FATAL, "vo_cvidix: error: didn't use vidix draw_frame!\n");
- return -1;
-}
-
-static int query_format(uint32_t format){
- return vidix_query_fourcc(format);
-}
-
-static void uninit(void){
- if(!vo_config_count) return;
- vidix_term();
- free(vidix_name);
- vidix_name = NULL;
-}
-
-static int preinit(const char *arg){
- if(arg)vidix_name = strdup(arg);
- else {
- mp_msg(MSGT_VO, MSGL_INFO, "vo_cvidix: No vidix driver name provided, probing available ones (-v option for details)!\n");
- vidix_name = NULL;
- }
- if (vidix_preinit(vidix_name, video_out_cvidix.old_functions))return 1;
- return 0;
-}
-
-static int control(uint32_t request, void *data){
- switch (request) {
- case VOCTRL_QUERY_FORMAT:
- return query_format(*((uint32_t*)data));
- case VOCTRL_FULLSCREEN:
- if(vo_fs)vo_fs=0;
- else vo_fs=1;
- setup_vidix();
- return VO_TRUE;
- }
- return vidix_control(request, data);
-}
diff --git a/libvo/vo_fbdev.c b/libvo/vo_fbdev.c
index 2d422af269..0937c00312 100644
--- a/libvo/vo_fbdev.c
+++ b/libvo/vo_fbdev.c
@@ -41,9 +41,6 @@
#include "fastmemcpy.h"
#include "sub/sub.h"
#include "geometry.h"
-#ifdef CONFIG_VIDIX
-#include "vosub_vidix.h"
-#endif
#include "aspect.h"
#include "mp_msg.h"
#include "libavutil/common.h"
@@ -57,11 +54,6 @@ static const vo_info_t info = {
LIBVO_EXTERN(fbdev)
-#ifdef CONFIG_VIDIX
-/* Name of VIDIX driver */
-static const char *vidix_name = NULL;
-static vidix_grkey_t gr_key;
-#endif
static signed int pre_init_err = -2;
/******************************
* fb.modes support *
@@ -926,51 +918,6 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
fb_page = 0;
}
-#ifdef CONFIG_VIDIX
- if (vidix_name) {
- unsigned image_width, image_height, x_offset, y_offset;
- if (zoom || fs) {
- aspect_save_orig(width, height);
- aspect_save_prescale(d_width, d_height);
- aspect_save_screenres(fb_xres, fb_yres);
- aspect(&image_width, &image_height, fs ? A_ZOOM : A_NOZOOM);
- } else {
- image_width = width;
- image_height = height;
- }
-
- if (fb_xres > image_width)
- x_offset = (fb_xres - image_width) / 2;
- else
- x_offset = 0;
- if (fb_yres > image_height)
- y_offset = (fb_yres - image_height) / 2;
- else
- y_offset = 0;
-
- if (vidix_init(width, height, x_offset, y_offset, image_width,
- image_height, format, fb_bpp, fb_xres, fb_yres) != 0) {
- mp_msg(MSGT_VO, MSGL_ERR, "Can't initialize VIDIX driver\n");
- vidix_name = NULL;
- vidix_term();
- return -1;
- } else
- mp_msg(MSGT_VO, MSGL_V, "Using VIDIX\n");
- vidix_start();
- if (vidix_grkey_support()) {
- 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 = (vo_colorkey & 0x00ff0000) >> 16;
- gr_key.ckey.green = (vo_colorkey & 0x0000ff00) >> 8;
- gr_key.ckey.blue = vo_colorkey & 0x000000ff;
- } else
- gr_key.ckey.op = CKEY_FALSE;
- vidix_grkey_set(&gr_key);
- }
- } else
-#endif
{
int x_offset = 0, y_offset = 0;
geometry(&x_offset, &y_offset, &out_width, &out_height, fb_xres, fb_yres);
@@ -1009,10 +956,6 @@ static int query_format(uint32_t format)
{
if (!fb_preinit(0))
return 0;
-#ifdef CONFIG_VIDIX
- if (vidix_name)
- return vidix_query_fourcc(format);
-#endif
if ((format & IMGFMT_BGR_MASK) == IMGFMT_BGR) {
int bpp = format & 0xff;
@@ -1056,10 +999,6 @@ static void flip_page(void)
{
int next_page = !fb_page;
int page_delta = next_page - fb_page;
-#ifdef CONFIG_VIDIX
- if (vidix_name)
- return;
-#endif
if (!vo_doublebuffering)
return;
@@ -1098,10 +1037,6 @@ static void uninit(void)
if (frame_buffer)
munmap(frame_buffer, fb_size);
frame_buffer = NULL;
-#ifdef CONFIG_VIDIX
- if (vidix_name)
- vidix_term();
-#endif
fb_preinit(1);
}
@@ -1110,14 +1045,6 @@ static int preinit(const char *vo_subdevice)
pre_init_err = 0;
if (vo_subdevice) {
-#ifdef CONFIG_VIDIX
- if (memcmp(vo_subdevice, "vidix", 5) == 0)
- vidix_name = &vo_subdevice[5];
- if (vidix_name)
- pre_init_err = vidix_preinit(vidix_name,
- video_out_fbdev.old_functions);
- else
-#endif
{
free(fb_dev_name);
fb_dev_name = strdup(vo_subdevice);
@@ -1155,15 +1082,5 @@ static int control(uint32_t request, void *data)
return query_format(*(uint32_t*)data);
}
-#ifdef CONFIG_VIDIX
- if (vidix_name) {
- switch (request) {
- case VOCTRL_SET_EQUALIZER:
- case VOCTRL_GET_EQUALIZER:
- return vidix_control(request, data);
- }
- }
-#endif
-
return VO_NOTIMPL;
}
diff --git a/libvo/vo_svga.c b/libvo/vo_svga.c
index d44821df05..3afb8e36a2 100644
--- a/libvo/vo_svga.c
+++ b/libvo/vo_svga.c
@@ -55,9 +55,6 @@ TODO:
#include "video_out_internal.h"
#include "fastmemcpy.h"
#include "osdep/getch2.h"
-#ifdef CONFIG_VIDIX
-#include "vosub_vidix.h"
-#endif
#include "sub/sub.h"
@@ -112,11 +109,6 @@ static const vo_info_t info = {
""
};
-#ifdef CONFIG_VIDIX
-static char vidix_name[32] = "";
-static vidix_grkey_t gr_key;
-#endif
-
LIBVO_EXTERN(svga)
@@ -140,17 +132,6 @@ static int preinit(const char *arg)
blackbar_osd=0;
if(arg)while(*arg) {
-#ifdef CONFIG_VIDIX
- if(memcmp(arg,"vidix",5)==0) {
- i=6;
- while(arg[i] && arg[i]!=':') i++;
- strncpy(vidix_name, arg+6, i-6);
- vidix_name[i-5]=0;
- if(arg[i]==':')i++;
- arg+=i;
- vidix_preinit(vidix_name, video_out_svga.old_functions);
- }
-#endif
if(!strncmp(arg,"sq",2)) {
squarepix=1;
arg+=2;
@@ -365,11 +346,6 @@ static int control(uint32_t request, void *data)
return get_image(data);
}
-#ifdef CONFIG_VIDIX
- if (vidix_name[0])
- return vidix_control(request, data);
-#endif
-
return VO_NOTIMPL;
}
@@ -525,30 +501,6 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
x_pos &= ~(15); //align x offset position to 16 pixels
mp_tmsg(MSGT_VO,MSGL_INFO, "[VO_SVGA] Centering image. Starting at (%d,%d)\n",x_pos,y_pos);
-#ifdef CONFIG_VIDIX
-
- if(vidix_name[0]){
- vidix_init(width, height, x_pos, y_pos, modeinfo->width, modeinfo->height,
- format, mode_bpp, modeinfo->width,modeinfo->height);
- mp_tmsg(MSGT_VO,MSGL_INFO, "[VO_SVGA] Using VIDIX. w=%i h=%i mw=%i mh=%i\n",width,height,
- modeinfo->width,modeinfo->height);
- vidix_start();
- /*set colorkey*/
- if(vidix_grkey_support()){
- 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 = (vo_colorkey & 0x00FF0000) >> 16;
- gr_key.ckey.green = (vo_colorkey & 0x0000FF00) >> 8;
- gr_key.ckey.blue = vo_colorkey & 0x000000FF;
- } else
- gr_key.ckey.op = CKEY_FALSE;
- vidix_grkey_set(&gr_key);
- }
- }
-#endif
-
vga_setdisplaystart(0);
return 0;
}
@@ -608,10 +560,6 @@ static void check_events(void) {
}
static void uninit(void) {
-
-#ifdef CONFIG_VIDIX
- if(vidix_name[0])vidix_term();
-#endif
vga_setmode(TEXT);
}
diff --git a/libvo/vo_vesa.c b/libvo/vo_vesa.c
index 698b9f033a..b9cb60a625 100644
--- a/libvo/vo_vesa.c
+++ b/libvo/vo_vesa.c
@@ -53,9 +53,6 @@
#include "mpbswap.h"
#include "aspect.h"
#include "vesa_lvo.h"
-#ifdef CONFIG_VIDIX
-#include "vosub_vidix.h"
-#endif
#include "mp_msg.h"
#include "libswscale/swscale.h"
@@ -112,11 +109,6 @@ uint8_t multi_idx=0; /* active buffer */
/* Linux Video Overlay */
static const char *lvo_name = NULL;
static int lvo_opened = 0;
-#ifdef CONFIG_VIDIX
-static const char *vidix_name = NULL;
-static int vidix_opened = 0;
-static vidix_grkey_t gr_key;
-#endif
/* Neomagic TV out */
static int neomagic_tvout = 0;
@@ -154,9 +146,6 @@ static void vesa_term( void )
{
int err;
if(lvo_opened) { vlvo_term(); lvo_opened = 0; }
-#ifdef CONFIG_VIDIX
- else if(vidix_opened) { vidix_term(); vidix_opened = 0; }
-#endif
if(init_state) if((err=vbeRestoreState(init_state)) != VBE_OK) PRINT_VBE_ERR("vbeRestoreState",err);
init_state=NULL;
if(init_mode) if((err=vbeSetMode(init_mode,NULL)) != VBE_OK) PRINT_VBE_ERR("vbeSetMode",err);
@@ -441,10 +430,6 @@ static uint32_t parseSubDevice(const char *sd)
if(strcmp(sd,"neotv_ntsc") == 0) { neomagic_tvout = 1; neomagic_tvnorm = NEO_NTSC; }
else
if(memcmp(sd,"lvo:",4) == 0) lvo_name = &sd[4]; /* lvo_name will be valid within init() */
-#ifdef CONFIG_VIDIX
- else
- if(memcmp(sd,"vidix",5) == 0) vidix_name = &sd[5]; /* vidix_name will be valid within init() */
-#endif
else { mp_tmsg(MSGT_VO,MSGL_WARN, "[VO_VESA] unknown subdevice: '%s'.\n", sd); return 0xFFFFFFFFUL; }
return flags;
}
@@ -453,9 +438,6 @@ static int query_format(uint32_t format)
{
if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
mp_msg(MSGT_VO,MSGL_DBG3, "vo_vesa: query_format was called: %x (%s)\n",format,vo_format_name(format));
-#ifdef CONFIG_VIDIX
- if(vidix_name) return vidix_query_fourcc(format);
-#endif
if (format == IMGFMT_MPEGPES)
return 0;
// FIXME: this is just broken...
@@ -788,9 +770,6 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
{
/* software scale */
if(use_scaler > 1
-#ifdef CONFIG_VIDIX
- || vidix_name
-#endif
)
{
aspect_save_orig(width,height);
@@ -807,9 +786,6 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
use_scaler = 1;
}
if(!lvo_name
-#ifdef CONFIG_VIDIX
- && !vidix_name
-#endif
)
{
sws = sws_getContextFromCmdLine(srcW,srcH,srcFourcc,dstW,dstH,dstFourcc);
@@ -897,9 +873,6 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
{
cpy_blk_fnc = vbeCopyBlock;
if(!lvo_name
-#ifdef CONFIG_VIDIX
- && !vidix_name
-#endif
)
{
if(!(dga_buffer = memalign(64,video_mode_info.XResolution*video_mode_info.YResolution*dstBpp)))
@@ -964,41 +937,6 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
else mp_tmsg(MSGT_VO,MSGL_INFO, "[VO_VESA] Using video overlay: %s.\n",lvo_name);
lvo_opened = 1;
}
-#ifdef CONFIG_VIDIX
- else
- if(vidix_name)
- {
- if(vidix_init(width,height,x_offset,y_offset,dstW,
- dstH,format,dstBpp,
- video_mode_info.XResolution,video_mode_info.YResolution) != 0)
- {
- mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_VESA] Can't initialize VIDIX driver.\n");
- vesa_term();
- return -1;
- }
- else mp_tmsg(MSGT_VO,MSGL_INFO, "[VO_VESA] Using VIDIX.\n");
- vidix_start();
-
- /* set colorkey */
- if (vidix_grkey_support())
- {
- vidix_grkey_get(&gr_key);
- gr_key.key_op = KEYS_PUT;
-#if 0
- if (!(vo_colorkey & 0xFF000000))
- {
- gr_key.ckey.op = CKEY_TRUE;
- gr_key.ckey.red = (vo_colorkey & 0x00FF0000) >> 16;
- gr_key.ckey.green = (vo_colorkey & 0x0000FF00) >> 8;
- gr_key.ckey.blue = vo_colorkey & 0x000000FF;
- } else
-#endif
- gr_key.ckey.op = CKEY_FALSE;
- vidix_grkey_set(&gr_key);
- }
- vidix_opened = 1;
- }
-#endif
}
else
{
@@ -1066,15 +1004,8 @@ static int preinit(const char *arg)
mp_msg(MSGT_VO,MSGL_DBG3, "vo_vesa: subdevice %s is being initialized\n",arg);
subdev_flags = 0;
lvo_name = NULL;
-#ifdef CONFIG_VIDIX
- vidix_name = NULL;
-#endif
if(arg) subdev_flags = parseSubDevice(arg);
if(lvo_name) pre_init_err = vlvo_preinit(lvo_name);
-#ifdef CONFIG_VIDIX
- else if(vidix_name) pre_init_err = vidix_preinit(vidix_name,
- video_out_vesa.old_functions);
-#endif
// check if we can open /dev/mem (it will be opened later in config(), but if we
// detect now that we can't we can exit cleanly)
fd = open("/dev/mem", O_RDWR);
@@ -1094,10 +1025,5 @@ static int control(uint32_t request, void *data)
return query_format(*((uint32_t*)data));
}
-#ifdef CONFIG_VIDIX
- if (vidix_name)
- return vidix_control(request, data);
-#endif
-
return VO_NOTIMPL;
}
diff --git a/libvo/vo_winvidix.c b/libvo/vo_winvidix.c
deleted file mode 100644
index 9655d95b4b..0000000000
--- a/libvo/vo_winvidix.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * VIDIX-accelerated overlay in a Win32 window
- *
- * copyright (C) 2003 Sascha Sommer
- *
- * 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.
- */
-
-#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 <windows.h>
-#include "osdep/keycodes.h"
-#include "input/input.h"
-
-#include "aspect.h"
-#include "mp_msg.h"
-#include "mp_fifo.h"
-
-#include "vosub_vidix.h"
-#include "vidix/vidix.h"
-
-
-static const vo_info_t info =
-{
- "WIN32 (VIDIX)",
- "winvidix",
- "Sascha Sommer",
- ""
-};
-
-LIBVO_EXTERN(winvidix)
-
-/* VIDIX related */
-static char *vidix_name;
-
-static int depthonscreen;
-/* Image parameters */
-static uint32_t image_width;
-static uint32_t image_height;
-static uint32_t image_format;
-/* Window parameters */
-static HWND hWnd=NULL,hWndFS=NULL;
-static float window_aspect;
-
-static vidix_grkey_t gr_key;
-
-
-void set_video_eq(int cap);
-
-
-static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- switch (message){
- case WM_DESTROY:
- PostQuitMessage(0);
- return 0;
- case WM_CLOSE:
- mplayer_put_key(KEY_CLOSE_WIN);
- break;
- case WM_WINDOWPOSCHANGED:
- {
- int tmpheight=0;
- /*calculate new window rect*/
- if(!vo_fs){
- RECT rd;
- POINT point_window;
- if(!hWnd)hWnd=hwnd;
- ShowCursor(TRUE);
- point_window.x = 0;
- point_window.y = 0;
- ClientToScreen(hWnd,&point_window);
- GetClientRect(hWnd,&rd);
-
- vo_dwidth=rd.right - rd.left;
- vo_dheight=rd.bottom - rd.top;
- vo_dx =point_window.x;
- vo_dy =point_window.y;
- // aspect(&vo_dwidth, &vo_dheight, A_NOZOOM);
-
- /* keep aspect on resize, borrowed from vo_directx.c */
- tmpheight = ((float)vo_dwidth/window_aspect);
- tmpheight += tmpheight % 2;
- if(tmpheight > vo_dheight)
- {
- vo_dwidth = ((float)vo_dheight*window_aspect);
- vo_dwidth += vo_dwidth % 2;
- }
- else vo_dheight = tmpheight;
- rd.right = rd.left + vo_dwidth;
- rd.bottom = rd.top + vo_dheight;
-
- if(rd.left < 0) rd.left = 0;
- if(rd.right > vo_screenwidth) rd.right = vo_screenwidth;
- if(rd.top < 0) rd.top = 0;
- if(rd.bottom > vo_screenheight) rd.bottom = vo_screenheight;
-
- AdjustWindowRect(&rd, WS_OVERLAPPEDWINDOW | WS_SIZEBOX, 0);
- SetWindowPos(hWnd, HWND_TOPMOST, vo_dx+rd.left, vo_dy+rd.top, rd.right-rd.left, rd.bottom-rd.top, SWP_NOOWNERZORDER);
- }
- else {
- if(ShowCursor(FALSE)>=0)while(ShowCursor(FALSE)>=0){}
- aspect(&vo_dwidth, &vo_dheight, A_ZOOM);
- vo_dx = (vo_screenwidth - vo_dwidth)/2;
- vo_dy = (vo_screenheight - vo_dheight)/2;
- }
- /*update vidix*/
- /* 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, vo_dwidth, vo_dheight, image_format, depthonscreen, vo_screenwidth, vo_screenheight) != 0)
- mp_msg(MSGT_VO, MSGL_FATAL, "Can't initialize VIDIX driver: %s\n", strerror(errno));
- /*set colorkey*/
- vidix_start();
- mp_msg(MSGT_VO, MSGL_V, "[winvidix] window properties: pos: %dx%d, size: %dx%d\n",vo_dx, vo_dy, vo_dwidth, vo_dheight);
- if(vidix_grkey_support()){
- vidix_grkey_get(&gr_key);
- gr_key.key_op = KEYS_PUT;
- gr_key.ckey.op = CKEY_TRUE;
- if(vo_fs)gr_key.ckey.red = gr_key.ckey.green = gr_key.ckey.blue = 0;
- else {
- gr_key.ckey.red = gr_key.ckey.blue = 255;
- gr_key.ckey.green = 0;
- }
- vidix_grkey_set(&gr_key);
- }
-
- }
- break;
- case WM_SYSCOMMAND:
- switch (wParam){
- case SC_SCREENSAVE:
- case SC_MONITORPOWER:
- return 0;
- }
- break;
- case WM_KEYDOWN:
- switch (wParam){
- case VK_LEFT:
- {mplayer_put_key(KEY_LEFT);break;}
- case VK_UP:
- {mplayer_put_key(KEY_UP);break;}
- case VK_RIGHT:
- {mplayer_put_key(KEY_RIGHT);break;}
- case VK_DOWN:
- {mplayer_put_key(KEY_DOWN);break;}
- case VK_TAB:
- {mplayer_put_key(KEY_TAB);break;}
- case VK_CONTROL:
- {mplayer_put_key(KEY_CTRL);break;}
- case VK_DELETE:
- {mplayer_put_key(KEY_DELETE);break;}
- case VK_INSERT:
- {mplayer_put_key(KEY_INSERT);break;}
- case VK_HOME:
- {mplayer_put_key(KEY_HOME);break;}
- case VK_END:
- {mplayer_put_key(KEY_END);break;}
- case VK_PRIOR:
- {mplayer_put_key(KEY_PAGE_UP);break;}
- case VK_NEXT:
- {mplayer_put_key(KEY_PAGE_DOWN);break;}
- case VK_ESCAPE:
- {mplayer_put_key(KEY_ESC);break;}
- }
- break;
- case WM_CHAR:
- mplayer_put_key(wParam);
- break;
- }
- return DefWindowProc(hwnd, message, wParam, lParam);
-}
-
-
-static int config(uint32_t width, uint32_t height, uint32_t d_width,uint32_t d_height, uint32_t flags, char *title, uint32_t format){
- title = "MPlayer VIDIX WIN32 Overlay";
-
- panscan_init();
-
- image_height = height;
- image_width = width;
- image_format = format;
- vo_screenwidth = GetSystemMetrics(SM_CXSCREEN);
- vo_screenheight = GetSystemMetrics(SM_CYSCREEN);
- depthonscreen = GetDeviceCaps(GetDC(GetDesktopWindow()),BITSPIXEL);
-
-
- aspect_save_orig(width, height);
- aspect_save_prescale(d_width, d_height);
- aspect_save_screenres(vo_screenwidth, vo_screenheight);
-
- vo_dx = 0;
- vo_dy = 0;
-
- vo_dx=( vo_screenwidth - d_width ) / 2; vo_dy=( vo_screenheight - d_height ) / 2;
- geometry(&vo_dx, &vo_dy, &d_width, &d_height, vo_screenwidth, vo_screenheight);
-
- vo_fs = flags&VOFLAG_FULLSCREEN;
-
-
- aspect(&d_width, &d_height, A_NOZOOM);
- vo_dwidth=d_width; vo_dheight=d_height;
- window_aspect = (float)d_width / (float)d_height;
-
-
- if(!vo_config_count){
- HINSTANCE hInstance = GetModuleHandle(NULL);
- WNDCLASS wc;
- RECT rd;
- rd.left = vo_dx;
- rd.top = vo_dy;
- rd.right = rd.left + vo_dwidth;
- rd.bottom = rd.top + vo_dheight;
- AdjustWindowRect(&rd,WS_OVERLAPPEDWINDOW| WS_SIZEBOX,0);
- wc.style = CS_HREDRAW | CS_VREDRAW;
- wc.lpfnWndProc = WndProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = hInstance;
- wc.hCursor = LoadCursor(NULL,IDC_ARROW);
- wc.hIcon =ExtractIcon(hInstance,"mplayer.exe",0);
-//LoadIcon(NULL,IDI_APPLICATION);
- wc.hbrBackground = CreateSolidBrush(RGB(255,0,255));
- wc.lpszClassName = "MPlayer - The Movie Player";
- wc.lpszMenuName = NULL;
- RegisterClass(&wc);
- hWnd = CreateWindow("MPlayer - The Movie Player",
- title,
- WS_OVERLAPPEDWINDOW| WS_SIZEBOX,
- rd.left,
- rd.top,
- rd.right - rd.left,
- rd.bottom - rd.top,
- NULL,
- NULL,
- hInstance,
- NULL);
- wc.hbrBackground = CreateSolidBrush(RGB(0,0,0));
- wc.lpszClassName = "MPlayer - Fullscreen";
- RegisterClass(&wc);
- hWndFS = CreateWindow("MPlayer - Fullscreen","MPlayer VIDIX Fullscreen",WS_POPUP,0,0,vo_screenwidth,vo_screenheight,hWnd,NULL,hInstance,NULL);
-
-
-
-
-
- }
- ShowWindow(hWnd,SW_SHOW);
- if(vo_fs)ShowWindow(hWndFS,SW_SHOW);
-
- return 0;
-}
-
-static void check_events(void){
- MSG msg;
- while (PeekMessage(&msg, NULL, 0, 0,PM_REMOVE))
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
-}
-
-/* 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, "[winvidix] error: didn't use vidix draw_osd!\n");
- return;
-}
-
-static void flip_page(void){
- mp_msg(MSGT_VO, MSGL_FATAL, "[winvidix] error: didn't use vidix flip_page!\n");
- return;
-}
-
-static int draw_slice(uint8_t *src[], int stride[],int w, int h, int x, int y){
- mp_msg(MSGT_VO, MSGL_FATAL, "[winvidix] error: didn't use vidix draw_slice!\n");
- return -1;
-}
-
-static int draw_frame(uint8_t *src[]){
- mp_msg(MSGT_VO, MSGL_FATAL, "[winvidix] error: didn't use vidix draw_frame!\n");
- return -1;
-}
-
-static int query_format(uint32_t format){
- return vidix_query_fourcc(format);
-}
-
-static void uninit(void){
- DestroyWindow(hWndFS);
- DestroyWindow(hWnd);
- if ( !vo_config_count ) return;
- vidix_term();
-
- free(vidix_name);
- vidix_name = NULL;
-}
-
-static int preinit(const char *arg){
- if (arg)
- vidix_name = strdup(arg);
- else
- {
- mp_msg(MSGT_VO, MSGL_INFO, "No vidix driver name provided, probing available ones (-v option for details)!\n");
- vidix_name = NULL;
- }
-
- if (vidix_preinit(vidix_name, video_out_winvidix.old_functions) != 0)
- return 1;
-
- return 0;
-}
-
-static int control(uint32_t request, void *data){
- switch (request) {
- case VOCTRL_FULLSCREEN:
- if(!vo_fs){vo_fs=1;ShowWindow(hWndFS,SW_SHOW);SetForegroundWindow(hWndFS);}
- else {vo_fs=0; ShowWindow(hWndFS,SW_HIDE);}
- break;
- case VOCTRL_QUERY_FORMAT:
- return query_format(*((uint32_t*)data));
- }
- return vidix_control(request, data);
-// return VO_NOTIMPL;
-}
diff --git a/libvo/vo_xvidix.c b/libvo/vo_xvidix.c
deleted file mode 100644
index 7741b9b6ff..0000000000
--- a/libvo/vo_xvidix.c
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- * 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.
- */
-
-#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>
-
-#ifdef CONFIG_XINERAMA
-#include <X11/extensions/Xinerama.h>
-#endif
-
-#include "x11_common.h"
-#include "aspect.h"
-#include "mp_msg.h"
-
-#include "vosub_vidix.h"
-#include "vidix/vidix.h"
-
-static const vo_info_t info = {
- "X11 (VIDIX)",
- "xvidix",
- "Alex Beregszaszi",
- ""
-};
-
-LIBVO_EXTERN(xvidix)
-
-/* X11 related variables */
-/* Colorkey handling */
-static int colorkey;
-static vidix_grkey_t gr_key;
-
-/* VIDIX related */
-static char *vidix_name;
-
-/* Image parameters */
-static uint32_t image_width;
-static uint32_t image_height;
-static uint32_t image_format;
-
-/* Window parameters */
-static uint32_t window_x, window_y;
-static uint32_t window_width, window_height;
-
-/* used by XGetGeometry & XTranslateCoordinates for moving/resizing window */
-static uint32_t drwX, drwY, drwWidth, drwHeight, drwBorderWidth,
- drwDepth, drwcX, drwcY, dwidth, dheight;
-
-void set_video_eq(int cap);
-
-
-static void set_window(int force_update)
-{
- Window mRoot;
-
- 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;
- }
-
-#if X11_FULLSCREEN
- if (vo_fs)
- {
- 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);
- }
-#endif
-
- vo_dwidth = drwWidth;
- vo_dheight = drwHeight;
-
- update_xinerama_info();
- drwcX -= xinerama_x;
- drwcY -= xinerama_y;
-
- 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;
- }
-
- /* set new values in VIDIX */
- if (force_update || (window_x != drwcX) || (window_y != drwcY) ||
- (window_width != drwWidth) || (window_height != drwHeight))
- {
- // 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)
- {
- mp_msg(MSGT_VO, MSGL_FATAL,
- "Can't initialize VIDIX driver: %s\n", strerror(errno));
- abort();
- }
- vidix_start();
- }
-
- mp_msg(MSGT_VO, MSGL_V,
- "[xvidix] window properties: pos: %dx%d, size: %dx%d\n", vo_dx,
- vo_dy, window_width, window_height);
-
- /* mDrawColorKey: */
-
- /* fill drawable with specified color */
- if (!(vo_colorkey & 0xff000000))
- {
- 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));
- }
- /* flush, update drawable */
- XFlush(mDisplay);
-
- return;
-}
-
-/* connect to server, create and map window,
- * allocate colors and (shared) memory
- */
-static int config(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, r, g, b;
-
- title = "MPlayer VIDIX X11 Overlay";
-
- image_height = height;
- image_width = width;
- image_format = format;
-
- window_width = d_width;
- window_height = d_height;
-
-// vo_fs = flags&0x01;
-// if (vo_fs)
-// { vo_old_width=d_width; vo_old_height=d_height; }
-
- r = (vo_colorkey & 0x00ff0000) >> 16;
- g = (vo_colorkey & 0x0000ff00) >> 8;
- b = vo_colorkey & 0x000000ff;
- switch (vo_depthonscreen)
- {
- 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);
- }
- mp_msg(MSGT_VO, MSGL_V, "Using colorkey: %x\n", colorkey);
-
-#ifdef X11_FULLSCREEN
- if ((flags & VOFLAG_FULLSCREEN) || (flags & VOFLAG_SWSCALE))
- aspect(&d_width, &d_height, A_ZOOM);
-#endif
- 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);
- xswamask = CWBackPixel | CWBorderPixel | CWColormap;
-
- vo_x11_create_vo_window(&vinfo, vo_dx, vo_dy,
- window_width, window_height, flags,
- CopyFromParent, "xvidix", title);
- XChangeWindowAttributes(mDisplay, vo_window, xswamask, &xswa);
-
- if ((!WinID) && (flags & VOFLAG_FULLSCREEN))
- {
- vo_dx = 0;
- vo_dy = 0;
- vo_dwidth = vo_screenwidth;
- vo_dheight = vo_screenheight;
- vo_fs = 1;
- }
-
- if (vidix_grkey_support())
- {
- 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);
- }
-
- set_window(1);
-
- XSync(mDisplay, False);
-
- panscan_calc();
-
- return 0;
-}
-
-static void check_events(void)
-{
- const int event = vo_x11_check_events(mDisplay);
-
- if (event & (VO_EVENT_RESIZE | VO_EVENT_MOVE | VO_EVENT_EXPOSE))
- set_window(0);
-
- return;
-}
-
-/* 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 int draw_slice(uint8_t * src[], int stride[],
- int w, int h, int x, int y)
-{
- mp_msg(MSGT_VO, MSGL_FATAL,
- "[xvidix] error: didn't used vidix draw_slice!\n");
- return -1;
-}
-
-static int draw_frame(uint8_t * src[])
-{
- mp_msg(MSGT_VO, MSGL_FATAL,
- "[xvidix] error: didn't used vidix draw_frame!\n");
- return -1;
-}
-
-static int query_format(uint32_t format)
-{
- return vidix_query_fourcc(format);
-}
-
-static void uninit(void)
-{
- if (!vo_config_count)
- return;
- vidix_term();
-
- free(vidix_name);
- vidix_name = NULL;
-
- vo_x11_uninit();
-}
-
-static int preinit(const char *arg)
-{
-
- if (arg)
- vidix_name = strdup(arg);
- else
- {
- mp_msg(MSGT_VO, MSGL_INFO,
- "No vidix driver name provided, probing available ones (-v option for details)!\n");
- vidix_name = NULL;
- }
-
- if (!vo_init())
- return -1;
-
- if (vidix_preinit(vidix_name, video_out_xvidix.old_functions) != 0)
- return 1;
-
- return 0;
-}
-
-static int control(uint32_t request, void *data)
-{
- 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;
- case VOCTRL_UPDATE_SCREENINFO:
- aspect_save_screenres(vo_screenwidth, vo_screenheight);
- return VO_TRUE;
-
- }
- return vidix_control(request, data);
-// return VO_NOTIMPL;
-}
diff --git a/libvo/vosub_vidix.c b/libvo/vosub_vidix.c
deleted file mode 100644
index f4add7db4c..0000000000
--- a/libvo/vosub_vidix.c
+++ /dev/null
@@ -1,702 +0,0 @@
-/*
- * vidix interface to any mplayer vo driver
- * (partly based on vesa_lvo.c)
- *
- * copyright (C) 2002 Nick Kurshev <nickols_k@mail.ru>
- * copyright (C) Alex Beregszaszi
- *
- * 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.
- */
-
-#include <inttypes.h>
-#include <unistd.h>
-#include <fcntl.h>
-#ifndef __MINGW32__
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include "config.h"
-#include "mp_msg.h"
-
-#include "vidix/vidix.h"
-#include "fastmemcpy.h"
-#include "osd.h"
-#include "video_out.h"
-#include "sub/sub.h"
-#include "vosub_vidix.h"
-#include "old_vo_wrapper.h"
-
-#include "libmpcodecs/vfcap.h"
-#include "libmpcodecs/mp_image.h"
-
-#define NUM_FRAMES VID_PLAY_MAXFRAMES /* Temporary: driver will overwrite it */
-
-static VDXContext *vidix_handler = NULL;
-static uint8_t *vidix_mem = NULL;
-static uint8_t next_frame;
-static unsigned image_Bpp,image_height,image_width,src_format,forced_fourcc=0;
-static int video_on=0;
-
-static vidix_capability_t vidix_cap;
-static vidix_playback_t vidix_play;
-static vidix_fourcc_t vidix_fourcc;
-static struct vo_old_functions *vo_server;
-static vidix_yuv_t dstrides;
-/*static uint32_t (*server_control)(uint32_t request, void *data, ...);*/
-
-int vidix_start(void)
-{
- int err;
- if((err=vdlPlaybackOn(vidix_handler))!=0)
- {
- mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_SUB_VIDIX] Can't start playback: %s\n",strerror(err));
- return -1;
- }
- video_on=1;
- return 0;
-}
-
-int vidix_stop(void)
-{
- int err;
- if((err=vdlPlaybackOff(vidix_handler))!=0)
- {
- mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_SUB_VIDIX] Can't stop playback: %s\n",strerror(err));
- return -1;
- }
- video_on=0;
- return 0;
-}
-
-void vidix_term( void )
-{
- if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
- mp_msg(MSGT_VO,MSGL_DBG2, "vosub_vidix: vidix_term() was called\n"); }
- vidix_stop();
- vdlClose(vidix_handler);
-// vo_server->control=server_control;
-}
-
-static int vidix_draw_slice_420(uint8_t *image[], int stride[], int w,int h,int x,int y)
-{
- uint8_t *src;
- uint8_t *dest;
- int i;
-
- /* Plane Y */
- dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.y;
- dest += dstrides.y*y + x;
- src = image[0];
- for(i=0;i<h;i++){
- memcpy(dest,src,w);
- src+=stride[0];
- dest += dstrides.y;
- }
-
- if (vidix_play.flags & VID_PLAY_INTERLEAVED_UV)
- {
- int hi,wi;
- uint8_t *src2;
- dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.v;
- dest += dstrides.y*y/2 + x; // <- is this correct ?
- h/=2;
- w/=2;
- src = image[1];
- src2 = image[2];
- for(hi = 0; hi < h; hi++)
- {
- for(wi = 0; wi < w; wi++)
- {
- dest[2*wi+0] = src[wi];
- dest[2*wi+1] = src2[wi];
- }
- dest += dstrides.y;
- src += stride[1];
- src2+= stride[2];
- }
- }
- else
- {
- /* Plane V */
- dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.v;
- dest += dstrides.v*y/4 + x;
- src = image[1];
- for(i=0;i<h/2;i++){
- memcpy(dest,src,w/2);
- src+=stride[1];
- dest+=dstrides.v/2;
- }
-
- /* Plane U */
- dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.u;
- dest += dstrides.u*y/4 + x;
- src = image[2];
- for(i=0;i<h/2;i++){
- memcpy(dest,src,w/2);
- src+=stride[2];
- dest += dstrides.u/2;
- }
- return 0;
- }
- return -1;
-}
-
-static int vidix_draw_slice_410(uint8_t *image[], int stride[], int w,int h,int x,int y)
-{
- uint8_t *src;
- uint8_t *dest;
- int i;
-
- /* Plane Y */
- dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.y;
- dest += dstrides.y*y + x;
- src = image[0];
- for(i=0;i<h;i++){
- memcpy(dest,src,w);
- src+=stride[0];
- dest += dstrides.y;
- }
-
- if (vidix_play.flags & VID_PLAY_INTERLEAVED_UV)
- {
- mp_tmsg(MSGT_VO,MSGL_WARN, "[VO_SUB_VIDIX] Interleaved UV for YUV410P not supported.\n");
- }
- else
- {
- /* Plane V */
- dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.v;
- dest += dstrides.v*y/8 + x;
- src = image[1];
- for(i=0;i<h/4;i++){
- memcpy(dest,src,w/4);
- src+=stride[1];
- dest+=dstrides.v/4;
- }
-
- /* Plane U */
- dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.u;
- dest += dstrides.u*y/8 + x;
- src = image[2];
- for(i=0;i<h/4;i++){
- memcpy(dest,src,w/4);
- src+=stride[2];
- dest += dstrides.u/4;
- }
- return 0;
- }
- return -1;
-}
-
-static int vidix_draw_slice_packed(uint8_t *image[], int stride[], int w,int h,int x,int y)
-{
- uint8_t *src;
- uint8_t *dest;
- int i;
-
- dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.y;
- dest += dstrides.y*y + x;
- src = image[0];
- for(i=0;i<h;i++){
- memcpy(dest,src,w*image_Bpp);
- src+=stride[0];
- dest += dstrides.y;
- }
- return 0;
-}
-
-static int vidix_draw_slice_nv12(uint8_t *image[], int stride[], int w,int h,int x,int y)
-{
- uint8_t *src;
- uint8_t *dest;
- int i;
-
- /* Plane Y */
- dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.y;
- dest += dstrides.y*y + x;
- src = image[0];
- for(i=0;i<h;i++){
- memcpy(dest,src,w);
- src+=stride[0];
- dest += dstrides.y;
- }
-
- /* Plane UV */
- dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.u;
- dest += dstrides.u*y/2 + x;
- src = image[1];
- for(i=0;i<h/2;i++){
- memcpy(dest,src,w);
- src+=stride[1];
- dest+=dstrides.u;
- }
- return 0;
-}
-
-static int vidix_draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y)
-{
- mp_tmsg(MSGT_VO,MSGL_WARN, "[VO_SUB_VIDIX] Dummy vidix_draw_slice() was called.\n");
- return -1;
-}
-
-static uint32_t vidix_draw_image(mp_image_t *mpi){
- if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
- mp_msg(MSGT_VO,MSGL_DBG2, "vosub_vidix: vidix_draw_image() was called\n"); }
-
- // if -dr or -slices then do nothing:
- if(mpi->flags&(MP_IMGFLAG_DIRECT|MP_IMGFLAG_DRAW_CALLBACK)) return VO_TRUE;
-
- vo_server->draw_slice(mpi->planes,mpi->stride,
- vidix_play.src.w,vidix_play.src.h,vidix_play.src.x,vidix_play.src.y);
- return VO_TRUE;
-}
-
-static int vidix_draw_frame(uint8_t *image[])
-{
- mp_tmsg(MSGT_VO,MSGL_WARN, "[VO_SUB_VIDIX] Dummy vidix_draw_frame() was called.\n");
- return -1;
-}
-
-static void vidix_flip_page(void)
-{
- if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
- mp_msg(MSGT_VO,MSGL_DBG2, "vosub_vidix: vidix_flip_page() was called\n"); }
- if(vo_doublebuffering)
- {
- vdlPlaybackFrameSelect(vidix_handler,next_frame);
- next_frame=(next_frame+1)%vidix_play.num_frames;
- }
-}
-
-static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)
-{
- uint32_t apitch,bespitch;
- char *lvo_mem;
- lvo_mem = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.y;
- apitch = vidix_play.dest.pitch.y-1;
- switch(vidix_play.fourcc){
- case IMGFMT_NV12:
- case IMGFMT_YV12:
- case IMGFMT_IYUV:
- case IMGFMT_I420:
- case IMGFMT_YVU9:
- case IMGFMT_IF09:
- case IMGFMT_Y8:
- case IMGFMT_Y800:
- bespitch = (vidix_play.src.w + apitch) & (~apitch);
- vo_draw_alpha_yv12(w,h,src,srca,stride,lvo_mem+bespitch*y0+x0,bespitch);
- break;
- case IMGFMT_YUY2:
- bespitch = (vidix_play.src.w*2 + apitch) & (~apitch);
- vo_draw_alpha_yuy2(w,h,src,srca,stride,lvo_mem+bespitch*y0+2*x0,bespitch);
- break;
- case IMGFMT_UYVY:
- bespitch = (vidix_play.src.w*2 + apitch) & (~apitch);
- vo_draw_alpha_yuy2(w,h,src,srca,stride,lvo_mem+bespitch*y0+2*x0+1,bespitch);
- break;
- case IMGFMT_RGB32:
- case IMGFMT_BGR32:
- bespitch = (vidix_play.src.w*4 + apitch) & (~apitch);
- vo_draw_alpha_rgb32(w,h,src,srca,stride,lvo_mem+y0*bespitch+4*x0,bespitch);
- break;
- case IMGFMT_RGB24:
- case IMGFMT_BGR24:
- bespitch = (vidix_play.src.w*3 + apitch) & (~apitch);
- vo_draw_alpha_rgb24(w,h,src,srca,stride,lvo_mem+y0*bespitch+3*x0,bespitch);
- break;
- case IMGFMT_RGB16:
- case IMGFMT_BGR16:
- bespitch = (vidix_play.src.w*2 + apitch) & (~apitch);
- vo_draw_alpha_rgb16(w,h,src,srca,stride,lvo_mem+y0*bespitch+2*x0,bespitch);
- break;
- case IMGFMT_RGB15:
- case IMGFMT_BGR15:
- bespitch = (vidix_play.src.w*2 + apitch) & (~apitch);
- vo_draw_alpha_rgb15(w,h,src,srca,stride,lvo_mem+y0*bespitch+2*x0,bespitch);
- break;
- default:
- return;
- }
-}
-
-static void vidix_draw_osd(void)
-{
- if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
- mp_msg(MSGT_VO,MSGL_DBG2, "vosub_vidix: vidix_draw_osd() was called\n"); }
- /* TODO: hw support */
- vo_draw_text(vidix_play.src.w,vidix_play.src.h,draw_alpha);
-}
-
-uint32_t vidix_query_fourcc(uint32_t format)
-{
- if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
- mp_msg(MSGT_VO,MSGL_DBG2, "vosub_vidix: query_format was called: %x (%s)\n",format,vo_format_name(format)); }
- vidix_fourcc.fourcc = format;
- vdlQueryFourcc(vidix_handler,&vidix_fourcc);
- if (vidix_fourcc.depth == VID_DEPTH_NONE)
- return 0;
- return VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW|VFCAP_HWSCALE_UP|VFCAP_HWSCALE_DOWN|VFCAP_OSD|VFCAP_ACCEPT_STRIDE;
-}
-
-int vidix_grkey_support(void)
-{
- return vidix_fourcc.flags & VID_CAP_COLORKEY;
-}
-
-int vidix_grkey_get(vidix_grkey_t *gr_key)
-{
- return vdlGetGrKeys(vidix_handler, gr_key);
-}
-
-int vidix_grkey_set(const vidix_grkey_t *gr_key)
-{
- return vdlSetGrKeys(vidix_handler, gr_key);
-}
-
-
-static int is_422_planes_eq=0;
-int vidix_init(unsigned src_width,unsigned src_height,
- unsigned x_org,unsigned y_org,unsigned dst_width,
- unsigned dst_height,unsigned format,unsigned dest_bpp,
- unsigned vid_w,unsigned vid_h)
-{
- void *tmp, *tmpa;
- size_t i;
- int err;
- uint32_t sstride,apitch;
- if( mp_msg_test(MSGT_VO,MSGL_DBG2) )
- mp_msg(MSGT_VO,MSGL_DBG2, "vosub_vidix: vidix_init() was called\n"
- "src_w=%u src_h=%u dest_x_y_w_h = %u %u %u %u\n"
- "format=%s dest_bpp=%u vid_w=%u vid_h=%u\n"
- ,src_width,src_height,x_org,y_org,dst_width,dst_height
- ,vo_format_name(format),dest_bpp,vid_w,vid_h);
-
- if(vidix_query_fourcc(format) == 0)
- {
- mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_SUB_VIDIX] Unsupported FourCC for this VIDIX driver: %x (%s).\n",
- format,vo_format_name(format));
- return -1;
- }
-
- if(((vidix_cap.maxwidth != -1) && (vid_w > vidix_cap.maxwidth)) ||
- ((vidix_cap.minwidth != -1) && (vid_w < vidix_cap.minwidth)) ||
- ((vidix_cap.maxheight != -1) && (vid_h > vidix_cap.maxheight)) ||
- ((vidix_cap.minwidth != -1 ) && (vid_h < vidix_cap.minheight)))
- {
- mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_SUB_VIDIX] Video server has unsupported resolution (%dx%d), supported: %dx%d-%dx%d.\n",
- vid_w, vid_h, vidix_cap.minwidth, vidix_cap.minheight,
- vidix_cap.maxwidth, vidix_cap.maxheight);
- return -1;
- }
-
- err = 0;
- switch(dest_bpp)
- {
- case 1: err = ((vidix_fourcc.depth & VID_DEPTH_1BPP) != VID_DEPTH_1BPP); break;
- case 2: err = ((vidix_fourcc.depth & VID_DEPTH_2BPP) != VID_DEPTH_2BPP); break;
- case 4: err = ((vidix_fourcc.depth & VID_DEPTH_4BPP) != VID_DEPTH_4BPP); break;
- case 8: err = ((vidix_fourcc.depth & VID_DEPTH_8BPP) != VID_DEPTH_8BPP); break;
- case 12:err = ((vidix_fourcc.depth & VID_DEPTH_12BPP) != VID_DEPTH_12BPP); break;
- case 15:err = ((vidix_fourcc.depth & VID_DEPTH_15BPP) != VID_DEPTH_15BPP); break;
- case 16:err = ((vidix_fourcc.depth & VID_DEPTH_16BPP) != VID_DEPTH_16BPP); break;
- case 24:err = ((vidix_fourcc.depth & VID_DEPTH_24BPP) != VID_DEPTH_24BPP); break;
- case 32:err = ((vidix_fourcc.depth & VID_DEPTH_32BPP) != VID_DEPTH_32BPP); break;
- default: err=1; break;
- }
- if(err)
- {
- mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_SUB_VIDIX] Video server has unsupported color depth by vidix (%d).\n"
- ,vidix_fourcc.depth);
- return -1;
- }
- if((dst_width > src_width || dst_height > src_height) && (vidix_cap.flags & FLAG_UPSCALER) != FLAG_UPSCALER)
- {
- mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_SUB_VIDIX] VIDIX driver can't upscale image (%d%d -> %d%d).\n",
- src_width, src_height, dst_width, dst_height);
- return -1;
- }
- if((dst_width > src_width || dst_height > src_height) && (vidix_cap.flags & FLAG_DOWNSCALER) != FLAG_DOWNSCALER)
- {
- mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_SUB_VIDIX] VIDIX driver can't downscale image (%d%d -> %d%d).\n",
- src_width, src_height, dst_width, dst_height);
- return -1;
- }
- image_width = src_width;
- image_height = src_height;
- src_format = format;
- if(forced_fourcc) format = forced_fourcc;
- memset(&vidix_play,0,sizeof(vidix_playback_t));
- vidix_play.fourcc = format;
- vidix_play.capability = vidix_cap.flags; /* every ;) */
- vidix_play.blend_factor = 0; /* for now */
- /* display the full picture.
- Nick: we could implement here zooming to a specified area -- alex */
- vidix_play.src.x = vidix_play.src.y = 0;
- vidix_play.src.w = src_width;
- vidix_play.src.h = src_height;
- vidix_play.dest.x = x_org;
- vidix_play.dest.y = y_org;
- vidix_play.dest.w = dst_width;
- vidix_play.dest.h = dst_height;
-// vidix_play.num_frames=vo_doublebuffering?NUM_FRAMES-1:1;
- /* we aren't mad...3 buffers are more than enough */
- vidix_play.num_frames=vo_doublebuffering?3:1;
- vidix_play.src.pitch.y = vidix_play.src.pitch.u = vidix_play.src.pitch.v = 0;
-
- if((err=vdlConfigPlayback(vidix_handler,&vidix_play))!=0)
- {
- mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_SUB_VIDIX] Can't configure playback: %s.\n",strerror(err));
- return -1;
- }
- if ( mp_msg_test(MSGT_VO,MSGL_V) ) {
- mp_msg(MSGT_VO,MSGL_V, "vosub_vidix: using %d buffer(s)\n", vidix_play.num_frames); }
-
- vidix_mem = vidix_play.dga_addr;
-
- tmp = calloc(image_width, image_height);
- tmpa = malloc(image_width * image_height);
- memset(tmpa, 1, image_width * image_height);
- /* clear every frame with correct address and frame_size */
- /* HACK: use draw_alpha to clear Y component */
- for (i = 0; i < vidix_play.num_frames; i++) {
- next_frame = i;
- memset(vidix_mem + vidix_play.offsets[i], 0x80,
- vidix_play.frame_size);
- draw_alpha(0, 0, image_width, image_height, tmp, tmpa, image_width);
- }
- free(tmp);
- free(tmpa);
- /* show one of the "clear" frames */
- vidix_flip_page();
-
- switch(format)
- {
- case IMGFMT_NV12:
- case IMGFMT_YV12:
- case IMGFMT_I420:
- case IMGFMT_IYUV:
- case IMGFMT_YVU9:
- case IMGFMT_IF09:
- case IMGFMT_Y800:
- case IMGFMT_Y8:
- apitch = vidix_play.dest.pitch.y-1;
- dstrides.y = (image_width + apitch) & ~apitch;
- apitch = vidix_play.dest.pitch.v-1;
- dstrides.v = (image_width + apitch) & ~apitch;
- apitch = vidix_play.dest.pitch.u-1;
- dstrides.u = (image_width + apitch) & ~apitch;
- image_Bpp=1;
- break;
- case IMGFMT_RGB32:
- case IMGFMT_BGR32:
- apitch = vidix_play.dest.pitch.y-1;
- dstrides.y = (image_width*4 + apitch) & ~apitch;
- dstrides.u = dstrides.v = 0;
- image_Bpp=4;
- break;
- case IMGFMT_RGB24:
- case IMGFMT_BGR24:
- apitch = vidix_play.dest.pitch.y-1;
- dstrides.y = (image_width*3 + apitch) & ~apitch;
- dstrides.u = dstrides.v = 0;
- image_Bpp=3;
- break;
- default:
- apitch = vidix_play.dest.pitch.y-1;
- dstrides.y = (image_width*2 + apitch) & ~apitch;
- dstrides.u = dstrides.v = 0;
- image_Bpp=2;
- break;
- }
- /* tune some info here */
- sstride = src_width*image_Bpp;
- if(!forced_fourcc)
- {
- is_422_planes_eq = sstride == dstrides.y;
-
- if(src_format == IMGFMT_YV12 || src_format == IMGFMT_I420 || src_format == IMGFMT_IYUV)
- vo_server->draw_slice = vidix_draw_slice_420;
- else if (src_format == IMGFMT_YVU9 || src_format == IMGFMT_IF09)
- vo_server->draw_slice = vidix_draw_slice_410;
- else if (src_format == IMGFMT_NV12)
- vo_server->draw_slice = vidix_draw_slice_nv12;
- else vo_server->draw_slice = vidix_draw_slice_packed;
- }
- return 0;
-}
-
-static uint32_t vidix_get_image(mp_image_t *mpi)
-{
- if(mpi->type==MP_IMGTYPE_STATIC && vidix_play.num_frames>1) return VO_FALSE;
- if(mpi->flags&MP_IMGFLAG_READABLE) return VO_FALSE; /* slow video ram */
- if(( (mpi->stride[0]==dstrides.y && (!(mpi->flags&MP_IMGFLAG_PLANAR) ||
- (mpi->stride[1]==dstrides.u && mpi->stride[2]==dstrides.v)) )
- || (mpi->flags&(MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_ACCEPT_WIDTH))) &&
- (!forced_fourcc && !(vidix_play.flags & VID_PLAY_INTERLEAVED_UV)))
- {
- if(mpi->flags&MP_IMGFLAG_ACCEPT_WIDTH){
- // check if only width is enough to represent strides:
- if(mpi->flags&MP_IMGFLAG_PLANAR){
- if((dstrides.y>>1)!=dstrides.v || dstrides.v!=dstrides.u) return VO_FALSE;
- } else {
- if(dstrides.y % (mpi->bpp/8)) return VO_FALSE;
- }
- }
- mpi->planes[0]=vidix_mem+vidix_play.offsets[next_frame]+vidix_play.offset.y;
- mpi->width=mpi->stride[0]=dstrides.y;
- if(mpi->flags&MP_IMGFLAG_PLANAR)
- {
- mpi->planes[1]=vidix_mem+vidix_play.offsets[next_frame]+vidix_play.offset.v;
- mpi->stride[1]=dstrides.v >> mpi->chroma_x_shift;
- mpi->planes[2]=vidix_mem+vidix_play.offsets[next_frame]+vidix_play.offset.u;
- mpi->stride[2]=dstrides.u >> mpi->chroma_x_shift;
- } else
- mpi->width/=mpi->bpp/8;
- mpi->flags|=MP_IMGFLAG_DIRECT;
- return VO_TRUE;
- }
- return VO_FALSE;
-}
-
-uint32_t vidix_control(uint32_t request, void *data)
-{
- switch (request) {
- case VOCTRL_QUERY_FORMAT:
- return vidix_query_fourcc(*((uint32_t*)data));
- case VOCTRL_GET_IMAGE:
- return vidix_get_image(data);
- case VOCTRL_DRAW_IMAGE:
- return vidix_draw_image(data);
- case VOCTRL_GET_FRAME_NUM:
- *(uint32_t *)data = next_frame;
- return VO_TRUE;
- case VOCTRL_SET_FRAME_NUM:
- next_frame = *(uint32_t *)data;
- return VO_TRUE;
- case VOCTRL_GET_NUM_FRAMES:
- *(uint32_t *)data = vidix_play.num_frames;
- return VO_TRUE;
- case VOCTRL_SET_EQUALIZER:
- {
- vidix_video_eq_t info;
-
- if(!video_on) return VO_FALSE;
-
- struct voctrl_set_equalizer_args *args = data;
-
- /* vidix eq ranges are -1000..1000 */
- if (!strcasecmp(args->name, "brightness"))
- {
- info.brightness = args->value*10;
- info.cap = VEQ_CAP_BRIGHTNESS;
- }
- else if (!strcasecmp(args->name, "contrast"))
- {
- info.contrast = args->value*10;
- info.cap = VEQ_CAP_CONTRAST;
- }
- else if (!strcasecmp(args->name, "saturation"))
- {
- info.saturation = args->value*10;
- info.cap = VEQ_CAP_SATURATION;
- }
- else if (!strcasecmp(args->name, "hue"))
- {
- info.hue = args->value*10;
- info.cap = VEQ_CAP_HUE;
- }
-
- if (vdlPlaybackSetEq(vidix_handler, &info) == 0)
- return VO_TRUE;
- return VO_FALSE;
- }
- case VOCTRL_GET_EQUALIZER:
- {
- vidix_video_eq_t info;
-
- if(!video_on) return VO_FALSE;
- if (vdlPlaybackGetEq(vidix_handler, &info) != 0)
- return VO_FALSE;
-
- struct voctrl_get_equalizer_args *args = data;
-
- /* vidix eq ranges are -1000..1000 */
- if (!strcasecmp(args->name, "brightness"))
- {
- if (info.cap & VEQ_CAP_BRIGHTNESS)
- *args->valueptr = info.brightness/10;
- }
- else if (!strcasecmp(args->name, "contrast"))
- {
- if (info.cap & VEQ_CAP_CONTRAST)
- *args->valueptr = info.contrast/10;
- }
- else if (!strcasecmp(args->name, "saturation"))
- {
- if (info.cap & VEQ_CAP_SATURATION)
- *args->valueptr = info.saturation/10;
- }
- else if (!strcasecmp(args->name, "hue"))
- {
- if (info.cap & VEQ_CAP_HUE)
- *args->valueptr = info.hue/10;
- }
-
- return VO_TRUE;
- }
- }
- return VO_NOTIMPL;
- // WARNING: we drop extra parameters (...) here!
-// return server_control(request,data); //VO_NOTIMPL;
-}
-
-int vidix_preinit(const char *drvname, struct vo_old_functions *server)
-{
- int err;
- if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
- mp_msg(MSGT_VO,MSGL_DBG2, "vosub_vidix: vidix_preinit(%s) was called\n",drvname); }
-
- vidix_handler = vdlOpen(drvname ? drvname[0] == ':' ? &drvname[1] : drvname[0] ? drvname : NULL : NULL,
- TYPE_OUTPUT,
- verbose);
-
- if(vidix_handler == NULL)
- {
- mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_SUB_VIDIX] Couldn't find working VIDIX driver.\n");
- return -1;
- }
- if((err=vdlGetCapability(vidix_handler,&vidix_cap)) != 0)
- {
- mp_tmsg(MSGT_VO,MSGL_ERR, "[VO_SUB_VIDIX] Couldn't get capability: %s.\n",strerror(err));
- return -1;
- }
- mp_msg(MSGT_VO,MSGL_V, "[VO_SUB_VIDIX] Description: %s.\n", vidix_cap.name);
- mp_msg(MSGT_VO,MSGL_V, "[VO_SUB_VIDIX] Author: %s.\n", vidix_cap.author);
- /* we are able to tune up this stuff depend on fourcc format */
- server->draw_slice=vidix_draw_slice;
- server->draw_frame=vidix_draw_frame;
- server->flip_page=vidix_flip_page;
- server->draw_osd=vidix_draw_osd;
-// server_control = server->control;
-// server->control=vidix_control;
- vo_server = server;
- return 0;
-}
diff --git a/libvo/vosub_vidix.h b/libvo/vosub_vidix.h
deleted file mode 100644
index 7b05607de6..0000000000
--- a/libvo/vosub_vidix.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * vosub_vidix interface to any mplayer vo driver
- *
- * copyright (C) 2002 Nick Kurshev <nickols_k@mail.ru>
- *
- * 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.
- */
-
-#ifndef MPLAYER_VOSUB_VIDIX_H
-#define MPLAYER_VOSUB_VIDIX_H
-
-#include <stdint.h>
-#include "video_out.h"
-
- /* drvname can be NULL */
-int vidix_preinit(const char *drvname, struct vo_old_functions *server);
-int vidix_init(unsigned src_width,unsigned src_height,
- unsigned dest_x,unsigned dest_y,unsigned dst_width,
- unsigned dst_height,unsigned format,unsigned dest_bpp,
- unsigned vid_w,unsigned vid_h);
-int vidix_start(void);
-int vidix_stop(void);
-void vidix_term( void );
-uint32_t vidix_control(uint32_t request, void *data);
-uint32_t vidix_query_fourcc(uint32_t fourcc);
-
-#include "vidix/vidix.h"
-/* graphic keys */
-int vidix_grkey_support(void);
-int vidix_grkey_get(vidix_grkey_t *gr_key);
-int vidix_grkey_set(const vidix_grkey_t *gr_key);
-
-#endif /* MPLAYER_VOSUB_VIDIX_H */