Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
1e5e931c
Commit
1e5e931c
authored
May 19, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Motion blur: callback thread safety
parent
a8595578
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
modules/video_filter/motionblur.c
modules/video_filter/motionblur.c
+11
-0
No files found.
modules/video_filter/motionblur.c
View file @
1e5e931c
...
...
@@ -80,6 +80,7 @@ static const char *const ppsz_filter_options[] = {
*****************************************************************************/
struct
filter_sys_t
{
vlc_spinlock_t
lock
;
int
i_factor
;
uint8_t
**
pp_planes
;
...
...
@@ -105,6 +106,7 @@ static int Create( vlc_object_t *p_this )
p_filter
->
p_sys
->
i_factor
=
var_CreateGetIntegerCommand
(
p_filter
,
FILTER_PREFIX
"factor"
);
vlc_spin_init
(
&
p_filter
->
p_sys
->
lock
);
var_AddCallback
(
p_filter
,
FILTER_PREFIX
"factor"
,
MotionBlurCallback
,
p_filter
->
p_sys
);
...
...
@@ -121,6 +123,10 @@ static void Destroy( vlc_object_t *p_this )
{
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
var_DelCallback
(
p_filter
,
FILTER_PREFIX
"factor"
,
MotionBlurCallback
,
p_filter
->
p_sys
);
vlc_spin_destroy
(
&
p_filter
->
p_sys
->
lock
);
while
(
p_filter
->
p_sys
->
i_planes
--
)
free
(
p_filter
->
p_sys
->
pp_planes
[
p_filter
->
p_sys
->
i_planes
]
);
free
(
p_filter
->
p_sys
->
pp_planes
);
...
...
@@ -220,7 +226,12 @@ static int MotionBlurCallback( vlc_object_t *p_this, char const *psz_var,
{
VLC_UNUSED
(
p_this
);
VLC_UNUSED
(
oldval
);
filter_sys_t
*
p_sys
=
(
filter_sys_t
*
)
p_data
;
if
(
!
strcmp
(
psz_var
,
FILTER_PREFIX
"factor"
)
)
{
vlc_spin_lock
(
&
p_sys
->
lock
);
p_sys
->
i_factor
=
__MIN
(
127
,
__MAX
(
1
,
newval
.
i_int
)
);
vlc_spin_unlock
(
&
p_sys
->
lock
);
}
return
VLC_SUCCESS
;
}
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