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
8eeb2a30
Commit
8eeb2a30
authored
Sep 01, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Load and unload the vout module in the vout thread.
parent
4fbca131
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
31 deletions
+36
-31
src/video_output/video_output.c
src/video_output/video_output.c
+32
-31
src/video_output/vout_internal.h
src/video_output/vout_internal.h
+4
-0
No files found.
src/video_output/video_output.c
View file @
8eeb2a30
...
...
@@ -494,31 +494,21 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
/* */
DeinterlaceEnable
(
p_vout
);
vlc_object_set_destructor
(
p_vout
,
vout_Destructor
);
if
(
p_vout
->
p
->
psz_filter_chain
&&
*
p_vout
->
p
->
psz_filter_chain
)
p_vout
->
p
->
psz_module_type
=
"video filter"
;
else
p_vout
->
p
->
psz_module_type
=
"video output"
;
p_vout
->
p
->
psz_module_name
=
psz_name
;
p_vout
->
p_module
=
NULL
;
/* */
p_vout
->
p_module
=
module_need
(
p_vout
,
(
p_vout
->
p
->
psz_filter_chain
&&
*
p_vout
->
p
->
psz_filter_chain
)
?
"video filter"
:
"video output"
,
psz_name
,
p_vout
->
p
->
psz_filter_chain
&&
*
p_vout
->
p
->
psz_filter_chain
);
free
(
psz_name
);
if
(
p_vout
->
p_module
==
NULL
)
{
msg_Err
(
p_vout
,
"no suitable vout module"
);
spu_Attach
(
p_vout
->
p_spu
,
VLC_OBJECT
(
p_vout
),
false
);
spu_Destroy
(
p_vout
->
p_spu
);
p_vout
->
p_spu
=
NULL
;
vlc_object_release
(
p_vout
);
return
NULL
;
}
vlc_object_set_destructor
(
p_vout
,
vout_Destructor
);
/* */
vlc_cond_init
(
&
p_vout
->
p
->
change_wait
);
if
(
vlc_clone
(
&
p_vout
->
p
->
thread
,
RunThread
,
p_vout
,
VLC_THREAD_PRIORITY_OUTPUT
)
)
{
module_unneed
(
p_vout
,
p_vout
->
p_module
);
p_vout
->
p_module
=
NULL
;
spu_Attach
(
p_vout
->
p_spu
,
VLC_OBJECT
(
p_vout
),
false
);
spu_Destroy
(
p_vout
->
p_spu
);
p_vout
->
p_spu
=
NULL
;
...
...
@@ -565,8 +555,6 @@ void vout_Close( vout_thread_t *p_vout )
vout_snapshot_End
(
&
p_vout
->
p
->
snapshot
);
vlc_join
(
p_vout
->
p
->
thread
,
NULL
);
module_unneed
(
p_vout
,
p_vout
->
p_module
);
p_vout
->
p_module
=
NULL
;
}
/* */
...
...
@@ -577,6 +565,8 @@ static void vout_Destructor( vlc_object_t * p_this )
/* Make sure the vout was stopped first */
assert
(
!
p_vout
->
p_module
);
free
(
p_vout
->
p
->
psz_module_name
);
/* */
if
(
p_vout
->
p_spu
)
spu_Destroy
(
p_vout
->
p_spu
);
...
...
@@ -985,26 +975,30 @@ static void* RunThread( void *p_this )
int
i_idle_loops
=
0
;
/* loops without displaying a picture */
int
i_picture_qtype_last
=
QTYPE_NONE
;
bool
b_drop_late
;
vlc_mutex_lock
(
&
p_vout
->
change_lock
);
/*
* Initialize thread
*/
vlc_mutex_lock
(
&
p_vout
->
change_lock
);
p_vout
->
b_error
=
InitThread
(
p_vout
);
b_drop_late
=
var_CreateGetBool
(
p_vout
,
"drop-late-frames"
);
p_vout
->
p_module
=
module_need
(
p_vout
,
p_vout
->
p
->
psz_module_type
,
p_vout
->
p
->
psz_module_name
,
!
strcmp
(
p_vout
->
p
->
psz_module_type
,
"video filter"
)
);
if
(
p_vout
->
p_module
)
p_vout
->
b_error
=
InitThread
(
p_vout
);
else
p_vout
->
b_error
=
true
;
/* signal the creation of the vout */
p_vout
->
p
->
b_ready
=
true
;
vlc_cond_signal
(
&
p_vout
->
p
->
change_wait
);
if
(
p_vout
->
b_error
)
{
EndThread
(
p_vout
);
vlc_mutex_unlock
(
&
p_vout
->
change_lock
);
return
NULL
;
}
goto
exit_thread
;
/* */
const
bool
b_drop_late
=
var_CreateGetBool
(
p_vout
,
"drop-late-frames"
);
/*
* Main loop - it is not executed if an error occurred during
...
...
@@ -1311,7 +1305,7 @@ static void* RunThread( void *p_this )
if
(
p_vout
->
pf_init
(
p_vout
)
)
{
msg_Err
(
p_vout
,
"cannot resize display"
);
/* FIXME: pf_end will be called again in
EndThread()
*/
/* FIXME: pf_end will be called again in
CleanThread()?
*/
p_vout
->
b_error
=
1
;
}
...
...
@@ -1396,11 +1390,18 @@ static void* RunThread( void *p_this )
if
(
p_vout
->
b_error
)
ErrorThread
(
p_vout
);
/*
End of
thread */
/*
Clean
thread */
CleanThread
(
p_vout
);
exit_thread:
/* End of thread */
EndThread
(
p_vout
);
vlc_mutex_unlock
(
&
p_vout
->
change_lock
);
if
(
p_vout
->
p_module
)
module_unneed
(
p_vout
,
p_vout
->
p_module
);
p_vout
->
p_module
=
NULL
;
return
NULL
;
}
...
...
src/video_output/vout_internal.h
View file @
8eeb2a30
...
...
@@ -40,6 +40,10 @@
/* */
struct
vout_thread_sys_t
{
/* module */
const
char
*
psz_module_type
;
char
*
psz_module_name
;
/* Thread & synchronization */
vlc_thread_t
thread
;
vlc_cond_t
change_wait
;
...
...
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