summaryrefslogtreecommitdiffstats
path: root/libvo/vo_x11.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-10-29 20:27:47 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-10-29 20:27:47 +0000
commite5947d8b27b073c78ab3efa9fdde3cc3b0c04e86 (patch)
treeb701474234709c16b62f7a0403b6b5959aad9439 /libvo/vo_x11.c
parentde382c1b8c5b393963f9abc4c4f781f6f311c759 (diff)
downloadmpv-e5947d8b27b073c78ab3efa9fdde3cc3b0c04e86.tar.bz2
mpv-e5947d8b27b073c78ab3efa9fdde3cc3b0c04e86.tar.xz
here is a somewhat generic equalizer implementation for the X11 vo drivers
using the window's colormap (DirectColor). this method is using the video card's hardware gamma ramp so it involves no performance penalties at all. patch by lucho <lucho@haemimont.bg> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7965 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_x11.c')
-rw-r--r--libvo/vo_x11.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c
index c164c3067b..2ef8a871e7 100644
--- a/libvo/vo_x11.c
+++ b/libvo/vo_x11.c
@@ -260,7 +260,8 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t
Visual *visual;
depth = vo_find_depth_from_visuals(mDisplay, mScreen, &visual);
}
- XMatchVisualInfo( mDisplay,mScreen,depth,TrueColor,&vinfo );
+ if ( !XMatchVisualInfo( mDisplay,mScreen,depth,DirectColor,&vinfo ))
+ XMatchVisualInfo( mDisplay,mScreen,depth,TrueColor,&vinfo );
/* set image size (which is indeed neither the input nor output size),
if zoom is on it will be changed during draw_slice anyway so we dont dupplicate the aspect code here
@@ -292,7 +293,7 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t
bg=WhitePixel( mDisplay,mScreen );
fg=BlackPixel( mDisplay,mScreen );
- theCmap=XCreateColormap( mDisplay,mRootWin,vinfo.visual,AllocNone );
+ theCmap=vo_x11_create_colormap(&vinfo);
xswa.background_pixel=0;
xswa.border_pixel=0;
@@ -633,6 +634,24 @@ static uint32_t control(uint32_t request, void *data, ...)
return VO_TRUE;
case VOCTRL_GET_IMAGE:
return get_image(data);
+ case VOCTRL_SET_EQUALIZER:
+ {
+ va_list ap;
+ int value;
+ va_start(ap, data);
+ value = va_arg(ap, int);
+ va_end(ap);
+ return vo_x11_set_equalizer(data, value);
+ }
+ case VOCTRL_GET_EQUALIZER:
+ {
+ va_list ap;
+ int *value;
+ va_start(ap, data);
+ value = va_arg(ap, int *);
+ va_end(ap);
+ return vo_x11_get_equalizer(data, value);
+ }
case VOCTRL_FULLSCREEN:
vo_x11_fullscreen();
return VO_TRUE;