summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-07-19 20:51:48 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-07-19 20:51:48 +0000
commitd05326c4bc7d26fbcf1c52a94f900a704026fc2a (patch)
tree90b1b5ee08f6805f7c6487c2ccc66db7ad92dbb9 /libvo
parentbcba526d135c6fcab681212569f440877f4c50ec (diff)
downloadmpv-d05326c4bc7d26fbcf1c52a94f900a704026fc2a.tar.bz2
mpv-d05326c4bc7d26fbcf1c52a94f900a704026fc2a.tar.xz
- fix audio equalizer
- rewrite video equalizer handling (i teszted with mga g400 [x]mga,xv,xvidix and radeon xv,xvidix ) - fix some small gtk bug - i dunno, i don't remember ... :) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6756 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/mga_common.c18
-rw-r--r--libvo/video_out.c8
-rw-r--r--libvo/video_out.h8
-rw-r--r--libvo/vo_xmga.c14
-rw-r--r--libvo/vo_xv.c11
-rw-r--r--libvo/vo_xvidix.c10
-rw-r--r--libvo/vosub_vidix.c8
7 files changed, 45 insertions, 32 deletions
diff --git a/libvo/mga_common.c b/libvo/mga_common.c
index 7f656bd769..d96eee233c 100644
--- a/libvo/mga_common.c
+++ b/libvo/mga_common.c
@@ -37,9 +37,21 @@ static int mga_set_video_eq( const vidix_video_eq_t *info)
uint32_t luma;
float factor = 256.0 / 2000;
-
- luma = ((int)(info->brightness * factor) << 16) +
- ((int)(info->contrast * factor) & 0xFFFF);
+ static int prev_br = 0;
+ static int prev_c = 0;
+
+ if ( info->cap & VEQ_CAP_BRIGHTNESS )
+ {
+ prev_br=info->brightness;
+ if ( prev_br == 1000 ) prev_br=999; // i dunno why needed this line -- Pontscho
+ }
+ if ( info->cap & VEQ_CAP_CONTRAST )
+ {
+ prev_c=info->contrast;
+ if ( prev_c == 1000 ) prev_c=999; // i dunno why needed this line -- Pontscho
+ }
+
+ luma = ((int)(prev_br * factor) << 16) + ((int)(prev_c * factor) & 0xFFFF);
if (ioctl(f,MGA_VID_SET_LUMA,luma)) {
perror("Error in mga_vid_config ioctl()");
printf("Could not set luma values in the kernel module!\n");
diff --git a/libvo/video_out.c b/libvo/video_out.c
index d1d0ae0c92..2ffe1659e6 100644
--- a/libvo/video_out.c
+++ b/libvo/video_out.c
@@ -66,10 +66,10 @@ int vo_directrendering=0;
/****************************************
* GAMMA CORRECTION *
****************************************/
-int vo_gamma_brightness=0;
-int vo_gamma_saturation=0;
-int vo_gamma_contrast=0;
-int vo_gamma_hue=0;
+int vo_gamma_brightness=-101;
+int vo_gamma_saturation=-101;
+int vo_gamma_contrast=-101;
+int vo_gamma_hue=-101;
int vo_gamma_red_intensity=0;
int vo_gamma_green_intensity=0;
int vo_gamma_blue_intensity=0;
diff --git a/libvo/video_out.h b/libvo/video_out.h
index 5656de7ca0..2914aa4bf7 100644
--- a/libvo/video_out.h
+++ b/libvo/video_out.h
@@ -220,6 +220,14 @@ extern int vo_fs;
extern int vo_fsmode;
extern float vo_panscan;
+extern int vo_gamma_brightness;
+extern int vo_gamma_saturation;
+extern int vo_gamma_contrast;
+extern int vo_gamma_hue;
+extern int vo_gamma_red_intensity;
+extern int vo_gamma_green_intensity;
+extern int vo_gamma_blue_intensity;
+
extern int vo_mouse_timer_const;
extern int vo_pts;
diff --git a/libvo/vo_xmga.c b/libvo/vo_xmga.c
index 3a90ed233a..bb55b88063 100644
--- a/libvo/vo_xmga.c
+++ b/libvo/vo_xmga.c
@@ -328,6 +328,11 @@ static uint32_t config( uint32_t width, uint32_t height, uint32_t d_width, uint3
set_window();
+ saver_off(mDisplay);
+
+ XFlush( mDisplay );
+ XSync( mDisplay,False );
+
mga_vid_config.src_width=width;
mga_vid_config.src_height=height;
@@ -335,15 +340,10 @@ static uint32_t config( uint32_t width, uint32_t height, uint32_t d_width, uint3
mga_vid_config.colkey_red=255;
mga_vid_config.colkey_green=0;
mga_vid_config.colkey_blue=255;
-
- if(mga_init()) return -1;
- XFlush( mDisplay );
- XSync( mDisplay,False );
+ mga_vid_config.version=MGA_VID_VERSION;
- saver_off(mDisplay);
-
- return 0;
+ return mga_init();
}
static const vo_info_t* get_info( void )
diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c
index 8330a7f2f9..9d6b2a7909 100644
--- a/libvo/vo_xv.c
+++ b/libvo/vo_xv.c
@@ -138,8 +138,7 @@ static int __xv_set_video_eq( const vidix_video_eq_t *info,int use_reset)
{
for (i = 0; i < howmany && attributes; i++)
{
- if (attributes[i].flags & XvSettable && !strcmp(attributes[i].name,"XV_SET_DEFAULTS"
-))
+ if (attributes[i].flags & XvSettable && !strcmp(attributes[i].name,"XV_SET_DEFAULTS"))
{
was_reset = 1;
mp_msg(MSGT_VO,MSGL_V,"vo_xv: reset gamma correction\n");
@@ -290,14 +289,6 @@ static int xv_get_video_eq( vidix_video_eq_t *info)
return 0;
}
-extern int vo_gamma_brightness;
-extern int vo_gamma_saturation;
-extern int vo_gamma_contrast;
-extern int vo_gamma_hue;
-extern int vo_gamma_red_intensity;
-extern int vo_gamma_green_intensity;
-extern int vo_gamma_blue_intensity;
-
static void set_gamma_correction( void )
{
vidix_video_eq_t info;
diff --git a/libvo/vo_xvidix.c b/libvo/vo_xvidix.c
index 0ca814ba56..0127a78a76 100644
--- a/libvo/vo_xvidix.c
+++ b/libvo/vo_xvidix.c
@@ -73,6 +73,8 @@ static uint32_t window_width, window_height;
static uint32_t drwX, drwY, drwWidth, drwHeight, drwBorderWidth,
drwDepth, drwcX, drwcY, dwidth, dheight;
+extern void set_video_eq( int cap );
+
static void set_window(int force_update,const vo_tune_info_t *info)
{
Window mRoot;
@@ -172,6 +174,13 @@ static void set_window(int force_update,const vo_tune_info_t *info)
mp_msg(MSGT_VO, MSGL_V, "[xvidix] window properties: pos: %dx%d, size: %dx%d\n",
vo_dx, vo_dy, window_width, window_height);
+
+ { // á.c.s. technologies (C) Pontscho
+ vidix_video_eq_t eq;
+ vo_vaa_t vo_vaa;
+ if ( vidix_control( VOCTRL_QUERY_VAA,&vo_vaa) != VO_NOTIMPL )
+ if ( vo_vaa.get_video_eq && vo_vaa.get_video_eq( &eq ) == 0 ) set_video_eq( eq.cap );
+ }
/* mDrawColorKey: */
@@ -332,6 +341,7 @@ else
}
set_window(1,info);
+
if(info) memcpy(&vtune,info,sizeof(vo_tune_info_t));
else memset(&vtune,0,sizeof(vo_tune_info_t));
XFlush(mDisplay);
diff --git a/libvo/vosub_vidix.c b/libvo/vosub_vidix.c
index 1fd7105930..7b3f30a224 100644
--- a/libvo/vosub_vidix.c
+++ b/libvo/vosub_vidix.c
@@ -71,14 +71,6 @@ static void vidix_query_vaa(vo_vaa_t *vaa)
vaa->set_deint=vidix_set_deint;
}
-extern int vo_gamma_brightness;
-extern int vo_gamma_saturation;
-extern int vo_gamma_contrast;
-extern int vo_gamma_hue;
-extern int vo_gamma_red_intensity;
-extern int vo_gamma_green_intensity;
-extern int vo_gamma_blue_intensity;
-
static vidix_video_eq_t vid_eq;
int vidix_start(void)