Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
eebb0e83
Commit
eebb0e83
authored
Aug 19, 2014
by
Rémi Denis-Courmont
Browse files
vdpau: switch hue to float
parent
94ca70d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/hw/vdpau/adjust.c
View file @
eebb0e83
...
...
@@ -84,19 +84,22 @@ static int SaturationCallback(vlc_object_t *obj, const char *varname,
return
VLC_SUCCESS
;
}
static
float
vlc_to_vdp_hue
(
in
t
hue
)
static
float
vlc_to_vdp_hue
(
floa
t
hue
)
{
hue
%=
360
;
if
(
hue
>
180
)
hue
-=
360
;
return
(
float
)
hue
*
(
float
)(
M_PI
/
180
.);
float
dummy
;
hue
/=
360
.
f
;
hue
=
modff
(
hue
,
&
dummy
);
if
(
hue
>
.
5
f
)
hue
-=
1
.
f
;
return
hue
*
(
float
)(
2
.
*
M_PI
);
}
static
int
HueCallback
(
vlc_object_t
*
obj
,
const
char
*
varname
,
vlc_value_t
prev
,
vlc_value_t
cur
,
void
*
data
)
{
vlc_atomic_store_float
(
data
,
vlc_to_vdp_hue
(
cur
.
i_in
t
));
vlc_atomic_store_float
(
data
,
vlc_to_vdp_hue
(
cur
.
f_floa
t
));
(
void
)
obj
;
(
void
)
varname
;
(
void
)
prev
;
return
VLC_SUCCESS
;
}
...
...
@@ -158,7 +161,7 @@ static int Open(vlc_object_t *obj)
&
sys
->
saturation
);
vlc_atomic_init_float
(
&
sys
->
saturation
,
vlc_to_vdp_saturation
(
f
));
i
=
var_CreateGet
Integer
Command
(
filter
,
"hue"
);
i
=
var_CreateGet
Float
Command
(
filter
,
"hue"
);
var_AddCallback
(
filter
,
"hue"
,
HueCallback
,
&
sys
->
hue
);
vlc_atomic_init_float
(
&
sys
->
hue
,
vlc_to_vdp_hue
(
i
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment