comparison mplayer.c @ 4388:b6b429d10296

Support for HW equalizing
author nick
date Sun, 27 Jan 2002 18:39:53 +0000
parents 9768db9a360a
children 817530449706
comparison
equal deleted inserted replaced
4387:df705351885a 4388:b6b429d10296
112 112
113 /************************************************************************** 113 /**************************************************************************
114 Video accelerated architecture 114 Video accelerated architecture
115 **************************************************************************/ 115 **************************************************************************/
116 vo_vaa_t vo_vaa; 116 vo_vaa_t vo_vaa;
117 int v_hw_equ_cap=0;
118 int v_bright=50;
119 int v_cont=50;
120 int v_hue=50;
121 int v_saturation=50;
122
117 //**************************************************************************// 123 //**************************************************************************//
118 // Config file 124 // Config file
119 //**************************************************************************// 125 //**************************************************************************//
120 126
121 static int cfg_inc_verbose(struct config *conf){ ++verbose; return 0;} 127 static int cfg_inc_verbose(struct config *conf){ ++verbose; return 0;}
438 int osd_function=OSD_PLAY; 444 int osd_function=OSD_PLAY;
439 int osd_last_pts=-303; 445 int osd_last_pts=-303;
440 int osd_show_av_delay = 0; 446 int osd_show_av_delay = 0;
441 int osd_show_sub_delay = 0; 447 int osd_show_sub_delay = 0;
442 448
443 int v_bright=50; 449 /*
444 int v_cont=50; 450 For future:
445 int v_hue=50; 451 int v_red_intensity=0;
446 int v_saturation=50; 452 int v_green_intensity=0;
453 int v_blue_intensity=0;
454 */
447 455
448 int vo_flags=0; 456 int vo_flags=0;
449 457
450 int rtc_fd=-1; 458 int rtc_fd=-1;
451 459
1308 goto goto_next_file; // exit_player(MSGTR_Exit_error); 1316 goto goto_next_file; // exit_player(MSGTR_Exit_error);
1309 } 1317 }
1310 inited_flags|=INITED_VO; 1318 inited_flags|=INITED_VO;
1311 mp_msg(MSGT_CPLAYER,MSGL_V,"INFO: Video OUT driver init OK!\n"); 1319 mp_msg(MSGT_CPLAYER,MSGL_V,"INFO: Video OUT driver init OK!\n");
1312 video_out->query_vaa(&vo_vaa); 1320 video_out->query_vaa(&vo_vaa);
1321 /*
1322 get_hw_eq
1323 */
1324 if(vo_vaa.get_video_eq)
1325 {
1326 vidix_video_eq_t veq;
1327 if(vo_vaa.get_video_eq(&veq) == 0)
1328 {
1329 v_hw_equ_cap = veq.cap;
1330 v_bright = veq.brightness/10;
1331 v_cont = veq.contrast/10;
1332 v_hue = veq.hue/10;
1333 v_saturation=veq.saturation/10;
1334 /*
1335 v_red_intensity=veq.red_intensity/10;
1336 v_green_intensity=veq.green_intensity/10;
1337 v_blue_intensity=veq.blue_intensity/10;
1338 */
1339 }
1340 }
1313 fflush(stdout); 1341 fflush(stdout);
1314 1342
1315 //================== MAIN: ========================== 1343 //================== MAIN: ==========================
1316 { 1344 {
1317 1345
2066 case '1': 2094 case '1':
2067 case '2': 2095 case '2':
2068 if(c=='2'){ 2096 if(c=='2'){
2069 if ( ++v_cont > 100 ) v_cont = 100; 2097 if ( ++v_cont > 100 ) v_cont = 100;
2070 } else { 2098 } else {
2071 if ( --v_cont < 0 ) v_cont = 0; 2099 --v_cont;
2100 if(v_hw_equ_cap)
2101 {
2102 if(v_cont < -100) v_cont = -100;
2103 }
2104 else
2105 {
2106 if ( v_cont < 0 ) v_cont = 0;
2107 }
2072 } 2108 }
2073 if(set_video_colors(sh_video,"Contrast",v_cont)){ 2109 if(set_video_colors(sh_video,"Contrast",v_cont)){
2074 #ifdef USE_OSD 2110 #ifdef USE_OSD
2075 if(osd_level){ 2111 if(osd_level){
2076 osd_visible=sh_video->fps; // 1 sec 2112 osd_visible=sh_video->fps; // 1 sec
2077 vo_osd_progbar_type=OSD_CONTRAST; 2113 vo_osd_progbar_type=OSD_CONTRAST;
2078 vo_osd_progbar_value=((v_cont)<<8)/100; 2114 vo_osd_progbar_value=((v_cont)<<8)/100;
2115 if(v_hw_equ_cap) vo_osd_progbar_value = ((v_cont+100)<<8)/200;
2079 } 2116 }
2080 #endif 2117 #endif
2081 } 2118 }
2082 break; 2119 break;
2083 2120
2085 case '3': 2122 case '3':
2086 case '4': 2123 case '4':
2087 if(c=='4'){ 2124 if(c=='4'){
2088 if ( ++v_bright > 100 ) v_bright = 100; 2125 if ( ++v_bright > 100 ) v_bright = 100;
2089 } else { 2126 } else {
2090 if ( --v_bright < 0 ) v_bright = 0; 2127 --v_bright;
2128 if(v_hw_equ_cap)
2129 {
2130 if(v_bright < -100) v_bright = -100;
2131 }
2132 else
2133 {
2134 if ( v_bright < 0 ) v_bright = 0;
2135 }
2091 } 2136 }
2092 if(set_video_colors(sh_video,"Brightness",v_bright)){ 2137 if(set_video_colors(sh_video,"Brightness",v_bright)){
2093 #ifdef USE_OSD 2138 #ifdef USE_OSD
2094 if(osd_level){ 2139 if(osd_level){
2095 osd_visible=sh_video->fps; // 1 sec 2140 osd_visible=sh_video->fps; // 1 sec
2096 vo_osd_progbar_type=OSD_BRIGHTNESS; 2141 vo_osd_progbar_type=OSD_BRIGHTNESS;
2097 vo_osd_progbar_value=((v_bright)<<8)/100; 2142 vo_osd_progbar_value=((v_bright)<<8)/100;
2143 if(v_hw_equ_cap) vo_osd_progbar_value = ((v_bright+100)<<8)/200;
2098 } 2144 }
2099 #endif 2145 #endif
2100 } 2146 }
2101 break; 2147 break;
2102 2148
2104 case '5': 2150 case '5':
2105 case '6': 2151 case '6':
2106 if(c=='6'){ 2152 if(c=='6'){
2107 if ( ++v_hue > 100 ) v_hue = 100; 2153 if ( ++v_hue > 100 ) v_hue = 100;
2108 } else { 2154 } else {
2109 if ( --v_hue < 0 ) v_hue = 0; 2155 --v_hue;
2156 if(v_hw_equ_cap)
2157 {
2158 if(v_hue < -100) v_hue = -100;
2159 }
2160 else
2161 {
2162 if ( v_hue < 0 ) v_hue = 0;
2163 }
2110 } 2164 }
2111 if(set_video_colors(sh_video,"Hue",v_hue)){ 2165 if(set_video_colors(sh_video,"Hue",v_hue)){
2112 #ifdef USE_OSD 2166 #ifdef USE_OSD
2113 if(osd_level){ 2167 if(osd_level){
2114 osd_visible=sh_video->fps; // 1 sec 2168 osd_visible=sh_video->fps; // 1 sec
2115 vo_osd_progbar_type=OSD_HUE; 2169 vo_osd_progbar_type=OSD_HUE;
2116 vo_osd_progbar_value=((v_hue)<<8)/100; 2170 vo_osd_progbar_value=((v_hue)<<8)/100;
2171 if(v_hw_equ_cap) vo_osd_progbar_value = ((v_hue+100)<<8)/200;
2117 } 2172 }
2118 #endif 2173 #endif
2119 } 2174 }
2120 break; 2175 break;
2121 2176
2123 case '7': 2178 case '7':
2124 case '8': 2179 case '8':
2125 if(c=='8'){ 2180 if(c=='8'){
2126 if ( ++v_saturation > 100 ) v_saturation = 100; 2181 if ( ++v_saturation > 100 ) v_saturation = 100;
2127 } else { 2182 } else {
2128 if ( --v_saturation < 0 ) v_saturation = 0; 2183 --v_saturation;
2184 if(v_hw_equ_cap)
2185 {
2186 if(v_saturation < -100) v_saturation = -100;
2187 }
2188 else
2189 {
2190 if ( v_saturation < 0 ) v_saturation = 0;
2191 }
2129 } 2192 }
2130 if(set_video_colors(sh_video,"Saturation",v_saturation)){ 2193 if(set_video_colors(sh_video,"Saturation",v_saturation)){
2131 #ifdef USE_OSD 2194 #ifdef USE_OSD
2132 if(osd_level){ 2195 if(osd_level){
2133 osd_visible=sh_video->fps; // 1 sec 2196 osd_visible=sh_video->fps; // 1 sec
2134 vo_osd_progbar_type=OSD_SATURATION; 2197 vo_osd_progbar_type=OSD_SATURATION;
2135 vo_osd_progbar_value=((v_saturation)<<8)/100; 2198 vo_osd_progbar_value=((v_saturation)<<8)/100;
2199 if(v_hw_equ_cap) vo_osd_progbar_value = ((v_saturation+100)<<8)/200;
2136 } 2200 }
2137 #endif 2201 #endif
2138 } 2202 }
2139 break; 2203 break;
2140 #endif 2204 #endif