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
e4b0862f
Commit
e4b0862f
authored
Jul 21, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert mosaic to global mutex
Signed-off-by:
Rémi Denis-Courmont
<
remi@remlab.net
>
parent
5938da78
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
20 deletions
+12
-20
include/vlc_threads.h
include/vlc_threads.h
+1
-0
modules/stream_out/mosaic_bridge.c
modules/stream_out/mosaic_bridge.c
+6
-11
modules/video_filter/mosaic.c
modules/video_filter/mosaic.c
+4
-9
src/misc/threads.c
src/misc/threads.c
+1
-0
No files found.
include/vlc_threads.h
View file @
e4b0862f
...
...
@@ -480,6 +480,7 @@ enum {
VLC_AVCODEC_MUTEX
=
0
,
VLC_GCRYPT_MUTEX
,
VLC_XLIB_MUTEX
,
VLC_MOSAIC_MUTEX
,
/* Insert new entry HERE */
VLC_MAX_MUTEX
};
...
...
modules/stream_out/mosaic_bridge.c
View file @
e4b0862f
...
...
@@ -49,7 +49,6 @@
struct
sout_stream_sys_t
{
bridged_es_t
*
p_es
;
vlc_mutex_t
*
p_lock
;
decoder_t
*
p_decoder
;
image_handler_t
*
p_image
;
/* filter for resizing */
...
...
@@ -192,10 +191,6 @@ static int Open( vlc_object_t *p_this )
p_stream
->
p_sys
=
p_sys
;
p_sys
->
b_inited
=
false
;
var_Create
(
p_libvlc
,
"mosaic-lock"
,
VLC_VAR_MUTEX
);
var_Get
(
p_libvlc
,
"mosaic-lock"
,
&
val
);
p_sys
->
p_lock
=
val
.
p_address
;
p_sys
->
psz_id
=
var_CreateGetString
(
p_stream
,
CFG_PREFIX
"id"
);
p_sys
->
i_height
=
...
...
@@ -347,7 +342,7 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
}
p_sys
->
b_inited
=
true
;
vlc_
mutex_lock
(
p_sys
->
p_lock
);
vlc_
global_lock
(
VLC_MOSAIC_MUTEX
);
p_bridge
=
GetBridge
(
p_stream
);
if
(
p_bridge
==
NULL
)
...
...
@@ -391,7 +386,7 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
p_es
->
pp_last
=
&
p_es
->
p_picture
;
p_es
->
b_empty
=
false
;
vlc_
mutex_unlock
(
p_sys
->
p_lock
);
vlc_
global_unlock
(
VLC_MOSAIC_MUTEX
);
if
(
p_sys
->
i_height
||
p_sys
->
i_width
)
{
...
...
@@ -458,7 +453,7 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
if
(
p_sys
->
p_vf2
)
filter_chain_Delete
(
p_sys
->
p_vf2
);
vlc_
mutex_lock
(
p_sys
->
p_lock
);
vlc_
global_lock
(
VLC_MOSAIC_MUTEX
);
p_bridge
=
GetBridge
(
p_stream
);
p_es
=
p_sys
->
p_es
;
...
...
@@ -490,7 +485,7 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
var_Destroy
(
p_libvlc
,
"mosaic-struct"
);
}
vlc_
mutex_unlock
(
p_sys
->
p_lock
);
vlc_
global_unlock
(
VLC_MOSAIC_MUTEX
);
if
(
p_sys
->
p_image
)
{
...
...
@@ -510,13 +505,13 @@ static void PushPicture( sout_stream_t *p_stream, picture_t *p_picture )
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
bridged_es_t
*
p_es
=
p_sys
->
p_es
;
vlc_
mutex_lock
(
p_sys
->
p_lock
);
vlc_
global_lock
(
VLC_MOSAIC_MUTEX
);
*
p_es
->
pp_last
=
p_picture
;
p_picture
->
p_next
=
NULL
;
p_es
->
pp_last
=
&
p_picture
->
p_next
;
vlc_
mutex_unlock
(
p_sys
->
p_lock
);
vlc_
global_unlock
(
VLC_MOSAIC_MUTEX
);
}
static
int
Send
(
sout_stream_t
*
p_stream
,
sout_stream_id_t
*
id
,
...
...
modules/video_filter/mosaic.c
View file @
e4b0862f
...
...
@@ -58,7 +58,6 @@ static int MosaicCallback ( vlc_object_t *, char const *, vlc_value_t,
struct
filter_sys_t
{
vlc_mutex_t
lock
;
/* Internal filter lock */
vlc_mutex_t
*
p_lock
;
/* Pointer to mosaic bridge lock */
image_handler_t
*
p_image
;
...
...
@@ -299,10 +298,6 @@ static int CreateFilter( vlc_object_t *p_this )
vlc_mutex_init
(
&
p_sys
->
lock
);
vlc_mutex_lock
(
&
p_sys
->
lock
);
var_Create
(
p_libvlc
,
"mosaic-lock"
,
VLC_VAR_MUTEX
);
var_Get
(
p_libvlc
,
"mosaic-lock"
,
&
val
);
p_sys
->
p_lock
=
val
.
p_address
;
config_ChainParse
(
p_filter
,
CFG_PREFIX
,
ppsz_filter_options
,
p_filter
->
p_cfg
);
...
...
@@ -466,12 +461,12 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
p_spu
->
b_absolute
=
false
;
vlc_mutex_lock
(
&
p_sys
->
lock
);
vlc_
mutex_lock
(
p_sys
->
p_lock
);
vlc_
global_lock
(
VLC_MOSAIC_MUTEX
);
p_bridge
=
GetBridge
(
p_filter
);
if
(
p_bridge
==
NULL
)
{
vlc_
mutex_unlock
(
p_sys
->
p_lock
);
vlc_
global_unlock
(
VLC_MOSAIC_MUTEX
);
vlc_mutex_unlock
(
&
p_sys
->
lock
);
return
p_spu
;
}
...
...
@@ -657,7 +652,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
{
msg_Err
(
p_filter
,
"cannot allocate SPU region"
);
p_filter
->
pf_sub_buffer_del
(
p_filter
,
p_spu
);
vlc_
mutex_unlock
(
p_sys
->
p_lock
);
vlc_
global_unlock
(
VLC_MOSAIC_MUTEX
);
vlc_mutex_unlock
(
&
p_sys
->
lock
);
return
p_spu
;
}
...
...
@@ -725,7 +720,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
p_region_prev
=
p_region
;
}
vlc_
mutex_unlock
(
p_sys
->
p_lock
);
vlc_
global_unlock
(
VLC_MOSAIC_MUTEX
);
vlc_mutex_unlock
(
&
p_sys
->
lock
);
return
p_spu
;
...
...
src/misc/threads.c
View file @
e4b0862f
...
...
@@ -40,6 +40,7 @@ void vlc_global_mutex (unsigned n, bool acquire)
VLC_STATIC_MUTEX
,
VLC_STATIC_MUTEX
,
VLC_STATIC_MUTEX
,
VLC_STATIC_MUTEX
,
};
assert
(
n
<
(
sizeof
(
locks
)
/
sizeof
(
locks
[
0
])));
vlc_mutex_t
*
lock
=
locks
+
n
;
...
...
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