[Mplayer-cvslog] CVS: main/libvo vo_dxr2.c,1.11,1.12
Alban Bedel CVS
albeu at mplayerhq.hu
Wed Oct 30 18:54:10 CET 2002
Update of /cvsroot/mplayer/main/libvo
In directory mail:/var/tmp.root/cvs-serv15948/libvo
Modified Files:
vo_dxr2.c
Log Message:
Some little bugfixs
New options to control the colorkey stuff
Fix the osd to be less time consuming
Index: vo_dxr2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_dxr2.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- vo_dxr2.c 29 Oct 2002 23:40:07 -0000 1.11
+++ vo_dxr2.c 30 Oct 2002 17:54:07 -0000 1.12
@@ -64,6 +64,15 @@
static int update_cache = 0;
static int olw_cor = 0, olh_cor = 0,olx_cor = 0, oly_cor = 0;
static int ol_osd = 0;
+static int ck_rmin = 0x40;
+static int ck_rmax = 0xFF;
+static int ck_r = 0xFF;
+static int ck_gmin = 0x00;
+static int ck_gmax = 0x20;
+static int ck_g = 0;
+static int ck_bmin = 0x40;
+static int ck_bmax = 0xFF;
+static int ck_b = 0xFF;
config_t dxr2_opts[] = {
@@ -106,6 +115,17 @@
{ "ol-osd", &ol_osd, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{ "nool-osd", &ol_osd, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+
+ { "ck-rmin", &ck_rmin, CONF_TYPE_INT, CONF_RANGE, 0, 0xFF, NULL},
+ { "ck-rmax", &ck_rmax, CONF_TYPE_INT, CONF_RANGE, 0, 0xFF, NULL},
+ { "ck-r", &ck_r, CONF_TYPE_INT, CONF_RANGE, 0, 0xFF, NULL},
+ { "ck-gmin", &ck_gmin, CONF_TYPE_INT, CONF_RANGE, 0, 0xFF, NULL},
+ { "ck-gmax", &ck_gmax, CONF_TYPE_INT, CONF_RANGE, 0, 0xFF, NULL},
+ { "ck-g", &ck_g, CONF_TYPE_INT, CONF_RANGE, 0, 0xFF, NULL},
+ { "ck-bmin", &ck_bmin, CONF_TYPE_INT, CONF_RANGE, 0, 0xFF, NULL},
+ { "ck-bmax", &ck_bmax, CONF_TYPE_INT, CONF_RANGE, 0, 0xFF, NULL},
+ { "ck-b", &ck_b, CONF_TYPE_INT, CONF_RANGE, 0, 0xFF, NULL},
+
{ NULL,NULL, 0, 0, 0, 0, NULL}
};
@@ -419,7 +439,7 @@
win.arg2 = vo_screenheight;
ioctl(dxr2_fd, DXR2_IOC_SET_OVERLAY_DIMENSION,&win);
- om.arg = 3;
+ om.arg = 0;
ioctl(dxr2_fd, DXR2_IOC_SET_OVERLAY_IN_DELAY,&om);
if(detect) {
@@ -747,7 +767,7 @@
movie_w = width;
movie_h = height;
- vo_fs = flags & VOFLAG_FULLSCREEN ? 1 : 0;
+ //vo_fs = flags & VOFLAG_FULLSCREEN ? 1 : 0;
// Overlay
while(use_ol) {
dxr2_twoArg_t win;
@@ -787,21 +807,21 @@
sub_config_count++;
// Feel free to try some other other color and report your results
- oc.arg1 = 0x40;
- oc.arg2 = 0xff;
- oc.arg3 = 0x00;
- oc.arg4 = 0x20;
- oc.arg5 = 0x40;
- oc.arg6 = 0xff;
+ oc.arg1 = ck_rmin;
+ oc.arg2 = ck_rmax;
+ oc.arg3 = ck_gmin;
+ oc.arg4 = ck_gmax;
+ oc.arg5 = ck_bmin;
+ oc.arg6 = ck_bmax;
ioctl(dxr2_fd, DXR2_IOC_SET_OVERLAY_COLOUR, &oc);
om.arg = DXR2_OVERLAY_WINDOW_COLOUR_KEY;
ioctl(dxr2_fd, DXR2_IOC_SET_OVERLAY_MODE,&om);
sub_img = malloc(width*height*3);
for(i = 0 ; i < width*height*3 ; i += 3) {
- sub_img[i] = 255;
- sub_img[i+1] = 0;
- sub_img[i+2] = 255;
+ sub_img[i] = ck_b;
+ sub_img[i+1] = ck_g;
+ sub_img[i+2] = ck_r;
}
aspect = ((1<<16)*width + height/2)/height;
sub_w = sub_h = 0;
@@ -810,6 +830,7 @@
}
vo_config_count = cc;
if(!sub_vo) { // Fallback on non windowed overlay
+ vo_fs = flags & VOFLAG_FULLSCREEN ? 1 : 0;
om.arg = DXR2_OVERLAY_WINDOW_KEY;
ioctl(dxr2_fd, DXR2_IOC_SET_OVERLAY_MODE,&om);
win.arg1 = flags & VOFLAG_FULLSCREEN ? vo_screenwidth : width;
@@ -862,7 +883,7 @@
static void flip_page (void)
{
- if(sub_vo && ol_osd)
+ if(sub_vo && ol_osd && vo_osd_changed_flag)
sub_vo->flip_page();
}
@@ -956,8 +977,16 @@
mp_msg(MSGT_VO,MSGL_WARN,"VO: [dxr2] Sub vo %s preinit failed => no overlay\n",arg);
sub_vo = NULL;
use_ol = 0;
- } else
+ } else {
+ uint32_t fmt = IMGFMT_BGR24;
mp_msg(MSGT_VO,MSGL_V,"VO: [dxr2] Sub vo %s inited\n",arg);
+ if(sub_vo->control(VOCTRL_QUERY_FORMAT,&fmt) <= 0) {
+ mp_msg(MSGT_VO,MSGL_WARN,"VO: [dxr2] Sub vo %s doesn't support BGR24 => no overlay\n",arg);
+ sub_vo->uninit();
+ sub_vo = NULL;
+ use_ol = 0;
+ }
+ }
}
dxr2_fd = open( "/dev/dxr2", O_WRONLY);
More information about the MPlayer-cvslog
mailing list