Support for HW equalizing

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4389 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
nick 2002-01-27 18:39:53 +00:00
parent fc476c1b70
commit bffd400795
3 changed files with 104 additions and 9 deletions

View File

@ -38,6 +38,12 @@ extern int verbose; // defined in mplayer.c
extern double video_time_usage; extern double video_time_usage;
extern double vout_time_usage; extern double vout_time_usage;
extern vo_vaa_t vo_vaa;
extern int v_hw_equ_cap;
extern int v_bright;
extern int v_cont;
extern int v_hue;
extern int v_saturation;
extern int frameratecode2framerate[16]; extern int frameratecode2framerate[16];
@ -89,7 +95,6 @@ static DS_VideoDecoder* ds_vdec=NULL;
#ifdef USE_TV #ifdef USE_TV
#include "libmpdemux/tv.h" #include "libmpdemux/tv.h"
extern int tv_param_on; extern int tv_param_on;
extern tvi_handle_t *tv_handler; extern tvi_handle_t *tv_handler;
#endif #endif
@ -277,6 +282,21 @@ void set_video_quality(sh_video_t *sh_video,int quality){
} }
int set_video_colors(sh_video_t *sh_video,char *item,int value){ int set_video_colors(sh_video_t *sh_video,char *item,int value){
if(v_hw_equ_cap != 0)
{
if(vo_vaa.set_video_eq)
{
vidix_video_eq_t veq;
veq.cap = VEQ_CAP_BRIGHTNESS | VEQ_CAP_CONTRAST | VEQ_CAP_SATURATION | VEQ_CAP_HUE;
veq.brightness = v_bright*10;
veq.contrast = v_cont*10;
veq.saturation = v_saturation*10;
veq.hue = v_hue;
veq.flags = VEQ_FLG_ITU_R_BT_601; /* Fixme please !!! */
vo_vaa.set_video_eq(&veq);
}
return 1;
}
#ifdef USE_DIRECTSHOW #ifdef USE_DIRECTSHOW
if(sh_video->codec->driver==VFM_DSHOW){ if(sh_video->codec->driver==VFM_DSHOW){
DS_VideoDecoder_SetValue(ds_vdec,item,value); DS_VideoDecoder_SetValue(ds_vdec,item,value);

View File

@ -84,6 +84,17 @@ int lavc_param_keyint = -1;
#include "fastmemcpy.h" #include "fastmemcpy.h"
/**************************************************************************
Video accelerated architecture
**************************************************************************/
vo_vaa_t vo_vaa;
int v_hw_equ_cap=0;
int v_bright=50;
int v_cont=50;
int v_hue=50;
int v_saturation=50;
//-------------------------- //--------------------------
// cache2: // cache2:

View File

@ -114,6 +114,12 @@ m_config_t* mconfig;
Video accelerated architecture Video accelerated architecture
**************************************************************************/ **************************************************************************/
vo_vaa_t vo_vaa; vo_vaa_t vo_vaa;
int v_hw_equ_cap=0;
int v_bright=50;
int v_cont=50;
int v_hue=50;
int v_saturation=50;
//**************************************************************************// //**************************************************************************//
// Config file // Config file
//**************************************************************************// //**************************************************************************//
@ -440,10 +446,12 @@ int osd_last_pts=-303;
int osd_show_av_delay = 0; int osd_show_av_delay = 0;
int osd_show_sub_delay = 0; int osd_show_sub_delay = 0;
int v_bright=50; /*
int v_cont=50; For future:
int v_hue=50; int v_red_intensity=0;
int v_saturation=50; int v_green_intensity=0;
int v_blue_intensity=0;
*/
int vo_flags=0; int vo_flags=0;
@ -1310,6 +1318,26 @@ current_module="init_libvo";
inited_flags|=INITED_VO; inited_flags|=INITED_VO;
mp_msg(MSGT_CPLAYER,MSGL_V,"INFO: Video OUT driver init OK!\n"); mp_msg(MSGT_CPLAYER,MSGL_V,"INFO: Video OUT driver init OK!\n");
video_out->query_vaa(&vo_vaa); video_out->query_vaa(&vo_vaa);
/*
get_hw_eq
*/
if(vo_vaa.get_video_eq)
{
vidix_video_eq_t veq;
if(vo_vaa.get_video_eq(&veq) == 0)
{
v_hw_equ_cap = veq.cap;
v_bright = veq.brightness/10;
v_cont = veq.contrast/10;
v_hue = veq.hue/10;
v_saturation=veq.saturation/10;
/*
v_red_intensity=veq.red_intensity/10;
v_green_intensity=veq.green_intensity/10;
v_blue_intensity=veq.blue_intensity/10;
*/
}
}
fflush(stdout); fflush(stdout);
//================== MAIN: ========================== //================== MAIN: ==========================
@ -2068,7 +2096,15 @@ if(step_sec>0) {
if(c=='2'){ if(c=='2'){
if ( ++v_cont > 100 ) v_cont = 100; if ( ++v_cont > 100 ) v_cont = 100;
} else { } else {
if ( --v_cont < 0 ) v_cont = 0; --v_cont;
if(v_hw_equ_cap)
{
if(v_cont < -100) v_cont = -100;
}
else
{
if ( v_cont < 0 ) v_cont = 0;
}
} }
if(set_video_colors(sh_video,"Contrast",v_cont)){ if(set_video_colors(sh_video,"Contrast",v_cont)){
#ifdef USE_OSD #ifdef USE_OSD
@ -2076,6 +2112,7 @@ if(step_sec>0) {
osd_visible=sh_video->fps; // 1 sec osd_visible=sh_video->fps; // 1 sec
vo_osd_progbar_type=OSD_CONTRAST; vo_osd_progbar_type=OSD_CONTRAST;
vo_osd_progbar_value=((v_cont)<<8)/100; vo_osd_progbar_value=((v_cont)<<8)/100;
if(v_hw_equ_cap) vo_osd_progbar_value = ((v_cont+100)<<8)/200;
} }
#endif #endif
} }
@ -2087,7 +2124,15 @@ if(step_sec>0) {
if(c=='4'){ if(c=='4'){
if ( ++v_bright > 100 ) v_bright = 100; if ( ++v_bright > 100 ) v_bright = 100;
} else { } else {
if ( --v_bright < 0 ) v_bright = 0; --v_bright;
if(v_hw_equ_cap)
{
if(v_bright < -100) v_bright = -100;
}
else
{
if ( v_bright < 0 ) v_bright = 0;
}
} }
if(set_video_colors(sh_video,"Brightness",v_bright)){ if(set_video_colors(sh_video,"Brightness",v_bright)){
#ifdef USE_OSD #ifdef USE_OSD
@ -2095,6 +2140,7 @@ if(step_sec>0) {
osd_visible=sh_video->fps; // 1 sec osd_visible=sh_video->fps; // 1 sec
vo_osd_progbar_type=OSD_BRIGHTNESS; vo_osd_progbar_type=OSD_BRIGHTNESS;
vo_osd_progbar_value=((v_bright)<<8)/100; vo_osd_progbar_value=((v_bright)<<8)/100;
if(v_hw_equ_cap) vo_osd_progbar_value = ((v_bright+100)<<8)/200;
} }
#endif #endif
} }
@ -2106,7 +2152,15 @@ if(step_sec>0) {
if(c=='6'){ if(c=='6'){
if ( ++v_hue > 100 ) v_hue = 100; if ( ++v_hue > 100 ) v_hue = 100;
} else { } else {
if ( --v_hue < 0 ) v_hue = 0; --v_hue;
if(v_hw_equ_cap)
{
if(v_hue < -100) v_hue = -100;
}
else
{
if ( v_hue < 0 ) v_hue = 0;
}
} }
if(set_video_colors(sh_video,"Hue",v_hue)){ if(set_video_colors(sh_video,"Hue",v_hue)){
#ifdef USE_OSD #ifdef USE_OSD
@ -2114,6 +2168,7 @@ if(step_sec>0) {
osd_visible=sh_video->fps; // 1 sec osd_visible=sh_video->fps; // 1 sec
vo_osd_progbar_type=OSD_HUE; vo_osd_progbar_type=OSD_HUE;
vo_osd_progbar_value=((v_hue)<<8)/100; vo_osd_progbar_value=((v_hue)<<8)/100;
if(v_hw_equ_cap) vo_osd_progbar_value = ((v_hue+100)<<8)/200;
} }
#endif #endif
} }
@ -2125,7 +2180,15 @@ if(step_sec>0) {
if(c=='8'){ if(c=='8'){
if ( ++v_saturation > 100 ) v_saturation = 100; if ( ++v_saturation > 100 ) v_saturation = 100;
} else { } else {
if ( --v_saturation < 0 ) v_saturation = 0; --v_saturation;
if(v_hw_equ_cap)
{
if(v_saturation < -100) v_saturation = -100;
}
else
{
if ( v_saturation < 0 ) v_saturation = 0;
}
} }
if(set_video_colors(sh_video,"Saturation",v_saturation)){ if(set_video_colors(sh_video,"Saturation",v_saturation)){
#ifdef USE_OSD #ifdef USE_OSD
@ -2133,6 +2196,7 @@ if(step_sec>0) {
osd_visible=sh_video->fps; // 1 sec osd_visible=sh_video->fps; // 1 sec
vo_osd_progbar_type=OSD_SATURATION; vo_osd_progbar_type=OSD_SATURATION;
vo_osd_progbar_value=((v_saturation)<<8)/100; vo_osd_progbar_value=((v_saturation)<<8)/100;
if(v_hw_equ_cap) vo_osd_progbar_value = ((v_saturation+100)<<8)/200;
} }
#endif #endif
} }