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
867fbfa4
Commit
867fbfa4
authored
May 19, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Blue screen: thread-safety
parent
ddba7408
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
modules/video_filter/bluescreen.c
modules/video_filter/bluescreen.c
+7
-8
No files found.
modules/video_filter/bluescreen.c
View file @
867fbfa4
...
@@ -103,6 +103,7 @@ static const char *const ppsz_filter_options[] = {
...
@@ -103,6 +103,7 @@ static const char *const ppsz_filter_options[] = {
struct
filter_sys_t
struct
filter_sys_t
{
{
vlc_mutex_t
lock
;
int
i_u
,
i_v
,
i_ut
,
i_vt
;
int
i_u
,
i_v
,
i_ut
,
i_vt
;
uint8_t
*
p_at
;
uint8_t
*
p_at
;
};
};
...
@@ -131,6 +132,7 @@ static int Create( vlc_object_t *p_this )
...
@@ -131,6 +132,7 @@ static int Create( vlc_object_t *p_this )
p_filter
->
p_cfg
);
p_filter
->
p_cfg
);
int
val
;
int
val
;
vlc_mutex_init
(
&
p_sys
->
lock
);
#define GET_VAR( name, min, max ) \
#define GET_VAR( name, min, max ) \
val = var_CreateGetIntegerCommand( p_filter, CFG_PREFIX #name ); \
val = var_CreateGetIntegerCommand( p_filter, CFG_PREFIX #name ); \
p_sys->i_##name = __MIN( max, __MAX( min, val ) ); \
p_sys->i_##name = __MIN( max, __MAX( min, val ) ); \
...
@@ -159,6 +161,7 @@ static void Destroy( vlc_object_t *p_this )
...
@@ -159,6 +161,7 @@ static void Destroy( vlc_object_t *p_this )
var_DelCallback
(
p_filter
,
CFG_PREFIX
"vt"
,
BluescreenCallback
,
p_sys
);
var_DelCallback
(
p_filter
,
CFG_PREFIX
"vt"
,
BluescreenCallback
,
p_sys
);
free
(
p_sys
->
p_at
);
free
(
p_sys
->
p_at
);
vlc_mutex_destroy
(
&
p_sys
->
lock
);
free
(
p_sys
);
free
(
p_sys
);
}
}
...
@@ -187,10 +190,12 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
...
@@ -187,10 +190,12 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
p_sys
->
p_at
=
realloc
(
p_sys
->
p_at
,
i_lines
*
i_pitch
*
sizeof
(
uint8_t
)
);
p_sys
->
p_at
=
realloc
(
p_sys
->
p_at
,
i_lines
*
i_pitch
*
sizeof
(
uint8_t
)
);
p_at
=
p_sys
->
p_at
;
p_at
=
p_sys
->
p_at
;
vlc_mutex_lock
(
&
p_sys
->
lock
);
umin
=
p_sys
->
i_u
-
p_sys
->
i_ut
>=
0x00
?
p_sys
->
i_u
-
p_sys
->
i_ut
:
0x00
;
umin
=
p_sys
->
i_u
-
p_sys
->
i_ut
>=
0x00
?
p_sys
->
i_u
-
p_sys
->
i_ut
:
0x00
;
umax
=
p_sys
->
i_u
+
p_sys
->
i_ut
<=
0xff
?
p_sys
->
i_u
+
p_sys
->
i_ut
:
0xff
;
umax
=
p_sys
->
i_u
+
p_sys
->
i_ut
<=
0xff
?
p_sys
->
i_u
+
p_sys
->
i_ut
:
0xff
;
vmin
=
p_sys
->
i_v
-
p_sys
->
i_vt
>=
0x00
?
p_sys
->
i_v
-
p_sys
->
i_vt
:
0x00
;
vmin
=
p_sys
->
i_v
-
p_sys
->
i_vt
>=
0x00
?
p_sys
->
i_v
-
p_sys
->
i_vt
:
0x00
;
vmax
=
p_sys
->
i_v
+
p_sys
->
i_vt
<=
0xff
?
p_sys
->
i_v
+
p_sys
->
i_vt
:
0xff
;
vmax
=
p_sys
->
i_v
+
p_sys
->
i_vt
<=
0xff
?
p_sys
->
i_v
+
p_sys
->
i_vt
:
0xff
;
vlc_mutex_unlock
(
&
p_sys
->
lock
);
for
(
i
=
0
;
i
<
i_lines
*
i_pitch
;
i
++
)
for
(
i
=
0
;
i
<
i_lines
*
i_pitch
;
i
++
)
{
{
...
@@ -260,23 +265,17 @@ static int BluescreenCallback( vlc_object_t *p_this, char const *psz_var,
...
@@ -260,23 +265,17 @@ static int BluescreenCallback( vlc_object_t *p_this, char const *psz_var,
VLC_UNUSED
(
p_this
);
VLC_UNUSED
(
oldval
);
VLC_UNUSED
(
p_this
);
VLC_UNUSED
(
oldval
);
filter_sys_t
*
p_sys
=
(
filter_sys_t
*
)
p_data
;
filter_sys_t
*
p_sys
=
(
filter_sys_t
*
)
p_data
;
vlc_mutex_lock
(
&
p_sys
->
lock
);
#define VAR_IS( a ) !strcmp( psz_var, CFG_PREFIX a )
#define VAR_IS( a ) !strcmp( psz_var, CFG_PREFIX a )
if
(
VAR_IS
(
"u"
)
)
if
(
VAR_IS
(
"u"
)
)
{
p_sys
->
i_u
=
__MAX
(
0
,
__MIN
(
255
,
newval
.
i_int
)
);
p_sys
->
i_u
=
__MAX
(
0
,
__MIN
(
255
,
newval
.
i_int
)
);
}
else
if
(
VAR_IS
(
"v"
)
)
else
if
(
VAR_IS
(
"v"
)
)
{
p_sys
->
i_v
=
__MAX
(
0
,
__MIN
(
255
,
newval
.
i_int
)
);
p_sys
->
i_v
=
__MAX
(
0
,
__MIN
(
255
,
newval
.
i_int
)
);
}
else
if
(
VAR_IS
(
"ut"
)
)
else
if
(
VAR_IS
(
"ut"
)
)
{
p_sys
->
i_ut
=
__MAX
(
0
,
__MIN
(
255
,
newval
.
i_int
)
);
p_sys
->
i_ut
=
__MAX
(
0
,
__MIN
(
255
,
newval
.
i_int
)
);
}
else
if
(
VAR_IS
(
"vt"
)
)
else
if
(
VAR_IS
(
"vt"
)
)
{
p_sys
->
i_vt
=
__MAX
(
0
,
__MIN
(
255
,
newval
.
i_int
)
);
p_sys
->
i_vt
=
__MAX
(
0
,
__MIN
(
255
,
newval
.
i_int
)
);
}
vlc_mutex_unlock
(
&
p_sys
->
lock
);
return
VLC_SUCCESS
;
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