Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
eebb0e83
Commit
eebb0e83
authored
Aug 19, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vdpau: switch hue to float
parent
94ca70d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
modules/hw/vdpau/adjust.c
modules/hw/vdpau/adjust.c
+10
-7
No files found.
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
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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