Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
4cd5c5d3
Commit
4cd5c5d3
authored
Feb 05, 2012
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
video_filters: use spin locks whenever possible
parent
d7df1123
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
modules/video_filter/colorthres.c
modules/video_filter/colorthres.c
+13
-13
No files found.
modules/video_filter/colorthres.c
View file @
4cd5c5d3
...
...
@@ -101,7 +101,7 @@ struct filter_sys_t
int
i_simthres
;
int
i_satthres
;
int
i_color
;
vlc_
mutex
_t
lock
;
vlc_
spinlock
_t
lock
;
};
/*****************************************************************************
...
...
@@ -149,7 +149,7 @@ static int Create( vlc_object_t *p_this )
p_sys
->
i_satthres
=
var_CreateGetIntegerCommand
(
p_filter
,
CFG_PREFIX
"saturationthres"
);
vlc_
mutex
_init
(
&
p_sys
->
lock
);
vlc_
spin
_init
(
&
p_sys
->
lock
);
var_AddCallback
(
p_filter
,
CFG_PREFIX
"color"
,
FilterCallback
,
NULL
);
var_AddCallback
(
p_filter
,
CFG_PREFIX
"similaritythres"
,
FilterCallback
,
NULL
);
...
...
@@ -171,7 +171,7 @@ static void Destroy( vlc_object_t *p_this )
var_DelCallback
(
p_filter
,
CFG_PREFIX
"similaritythres"
,
FilterCallback
,
NULL
);
var_DelCallback
(
p_filter
,
CFG_PREFIX
"saturationthres"
,
FilterCallback
,
NULL
);
vlc_
mutex
_destroy
(
&
p_filter
->
p_sys
->
lock
);
vlc_
spin
_destroy
(
&
p_filter
->
p_sys
->
lock
);
free
(
p_filter
->
p_sys
);
}
...
...
@@ -213,11 +213,11 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
picture_t
*
p_outpic
;
filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
vlc_
mutex
_lock
(
&
p_sys
->
lock
);
vlc_
spin
_lock
(
&
p_sys
->
lock
);
int
i_simthres
=
p_sys
->
i_simthres
;
int
i_satthres
=
p_sys
->
i_satthres
;
int
i_color
=
p_sys
->
i_color
;
vlc_
mutex
_unlock
(
&
p_sys
->
lock
);
vlc_
spin
_unlock
(
&
p_sys
->
lock
);
if
(
!
p_pic
)
return
NULL
;
...
...
@@ -272,11 +272,11 @@ static picture_t *FilterPacked( filter_t *p_filter, picture_t *p_pic )
picture_t
*
p_outpic
;
filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
vlc_
mutex
_lock
(
&
p_sys
->
lock
);
vlc_
spin
_lock
(
&
p_sys
->
lock
);
int
i_simthres
=
p_sys
->
i_simthres
;
int
i_satthres
=
p_sys
->
i_satthres
;
int
i_color
=
p_sys
->
i_color
;
vlc_
mutex
_unlock
(
&
p_sys
->
lock
);
vlc_
spin
_unlock
(
&
p_sys
->
lock
);
if
(
!
p_pic
)
return
NULL
;
...
...
@@ -342,21 +342,21 @@ static int FilterCallback ( vlc_object_t *p_this, char const *psz_var,
if
(
!
strcmp
(
psz_var
,
CFG_PREFIX
"color"
)
)
{
vlc_
mutex
_lock
(
&
p_sys
->
lock
);
vlc_
spin
_lock
(
&
p_sys
->
lock
);
p_sys
->
i_color
=
newval
.
i_int
;
vlc_
mutex
_unlock
(
&
p_sys
->
lock
);
vlc_
spin
_unlock
(
&
p_sys
->
lock
);
}
else
if
(
!
strcmp
(
psz_var
,
CFG_PREFIX
"similaritythres"
)
)
{
vlc_
mutex
_lock
(
&
p_sys
->
lock
);
vlc_
spin
_lock
(
&
p_sys
->
lock
);
p_sys
->
i_simthres
=
newval
.
i_int
;
vlc_
mutex
_unlock
(
&
p_sys
->
lock
);
vlc_
spin
_unlock
(
&
p_sys
->
lock
);
}
else
/* CFG_PREFIX "saturationthres" */
{
vlc_
mutex
_lock
(
&
p_sys
->
lock
);
vlc_
spin
_lock
(
&
p_sys
->
lock
);
p_sys
->
i_satthres
=
newval
.
i_int
;
vlc_
mutex
_unlock
(
&
p_sys
->
lock
);
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