Mercurial > mplayer.hg
comparison libmpcodecs/dec_video.c @ 6780:5bf3ed8a17c4
equalizer reworked
author | alex |
---|---|
date | Wed, 24 Jul 2002 18:14:21 +0000 |
parents | a48ad140c3af |
children | 12dcd0f85262 |
comparison
equal
deleted
inserted
replaced
6779:c5e08b7c048c | 6780:5bf3ed8a17c4 |
---|---|
74 mpvdec->control(sh_video,VDCTRL_SET_PP_LEVEL, (void*)(&quality)); | 74 mpvdec->control(sh_video,VDCTRL_SET_PP_LEVEL, (void*)(&quality)); |
75 } | 75 } |
76 | 76 |
77 int set_video_colors(sh_video_t *sh_video,char *item,int value) | 77 int set_video_colors(sh_video_t *sh_video,char *item,int value) |
78 { | 78 { |
79 if(vo_vaa.get_video_eq) | 79 vf_instance_t* vf=sh_video->vfilter; |
80 { | 80 |
81 vidix_video_eq_t veq; | 81 if (vf->control(vf, VFCTRL_SET_EQUALIZER, item, (int *)value) == CONTROL_TRUE) |
82 if(vo_vaa.get_video_eq(&veq) == 0) | 82 return 1; |
83 { | 83 /* try software control */ |
84 int v_hw_equ_cap = veq.cap; | 84 if(mpvdec) return mpvdec->control(sh_video,VDCTRL_SET_EQUALIZER, item, (int *)value); |
85 if(v_hw_equ_cap != 0) | 85 return 0; |
86 { | 86 } |
87 if(vo_vaa.set_video_eq) | 87 |
88 { | 88 int get_video_colors(sh_video_t *sh_video,char *item,int *value) |
89 veq.flags = VEQ_FLG_ITU_R_BT_601; /* Fixme please !!! */ | 89 { |
90 if(strcmp(item,"Brightness") == 0) | 90 vf_instance_t* vf=sh_video->vfilter; |
91 { | 91 |
92 if(!(v_hw_equ_cap & VEQ_CAP_BRIGHTNESS)) goto try_sw_control; | 92 if (vf->control(vf, VFCTRL_GET_EQUALIZER, item, value) == CONTROL_TRUE) |
93 veq.brightness = value*10; | 93 return 1; |
94 veq.cap = VEQ_CAP_BRIGHTNESS; | 94 /* try software control */ |
95 } | 95 if(mpvdec) return mpvdec->control(sh_video,VDCTRL_GET_EQUALIZER, item, value); |
96 else | |
97 if(strcmp(item,"Contrast") == 0) | |
98 { | |
99 if(!(v_hw_equ_cap & VEQ_CAP_CONTRAST)) goto try_sw_control; | |
100 veq.contrast = value*10; | |
101 veq.cap = VEQ_CAP_CONTRAST; | |
102 } | |
103 else | |
104 if(strcmp(item,"Saturation") == 0) | |
105 { | |
106 if(!(v_hw_equ_cap & VEQ_CAP_SATURATION)) goto try_sw_control; | |
107 veq.saturation = value*10; | |
108 veq.cap = VEQ_CAP_SATURATION; | |
109 } | |
110 else | |
111 if(strcmp(item,"Hue") == 0) | |
112 { | |
113 if(!(v_hw_equ_cap & VEQ_CAP_HUE)) goto try_sw_control; | |
114 veq.hue = value*10; | |
115 veq.cap = VEQ_CAP_HUE; | |
116 } | |
117 else goto try_sw_control;; | |
118 vo_vaa.set_video_eq(&veq); | |
119 } | |
120 return 1; | |
121 } | |
122 } | |
123 } | |
124 try_sw_control: | |
125 if(mpvdec) return mpvdec->control(sh_video,VDCTRL_SET_EQUALIZER,item,(int)value); | |
126 return 0; | 96 return 0; |
127 } | 97 } |
128 | 98 |
129 void uninit_video(sh_video_t *sh_video){ | 99 void uninit_video(sh_video_t *sh_video){ |
130 if(!sh_video->inited) return; | 100 if(!sh_video->inited) return; |
199 mpi=mpvdec->decode(sh_video, start, in_size, drop_frame); | 169 mpi=mpvdec->decode(sh_video, start, in_size, drop_frame); |
200 | 170 |
201 //------------------------ frame decoded. -------------------- | 171 //------------------------ frame decoded. -------------------- |
202 | 172 |
203 #ifdef ARCH_X86 | 173 #ifdef ARCH_X86 |
204 // some codecs is broken, and doesn't restore MMX state :( | 174 // some codecs are broken, and doesn't restore MMX state :( |
205 // it happens usually with broken/damaged files. | 175 // it happens usually with broken/damaged files. |
206 if(gCpuCaps.has3DNow){ | 176 if(gCpuCaps.has3DNow){ |
207 __asm __volatile ("femms\n\t":::"memory"); | 177 __asm __volatile ("femms\n\t":::"memory"); |
208 } | 178 } |
209 else if(gCpuCaps.hasMMX){ | 179 else if(gCpuCaps.hasMMX){ |