Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
688be5d2
Commit
688be5d2
authored
Oct 19, 2020
by
Steve Lhomme
Browse files
transcode: fully drain the video filters as normal outputs on EOS/flush
parent
5318004e
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/stream_out/transcode/video.c
View file @
688be5d2
...
...
@@ -433,6 +433,40 @@ static void tag_last_block_with_flag( block_t **out, int i_flag )
}
}
static
void
DrainFilters
(
sout_stream_id_sys_t
*
id
,
block_t
**
out
)
{
filter_chain_t
*
chains
[]
=
{
id
->
p_f_chain
,
id
->
p_uf_chain
,
id
->
p_final_conv_static
};
picture_t
*
p_in
=
NULL
;
do
{
for
(
size_t
i
=
0
;
i
<
ARRAY_SIZE
(
chains
);
i
++
)
{
if
(
!
chains
[
i
]
)
continue
;
if
(
p_in
)
p_in
=
filter_chain_VideoFilter
(
chains
[
i
],
p_in
);
else
p_in
=
filter_chain_VideoDrain
(
chains
[
i
],
true
);
}
if
(
!
p_in
)
break
;
/* Blend subpictures */
p_in
=
RenderSubpictures
(
id
,
p_in
);
if
(
p_in
)
{
block_t
*
p_encoded
=
transcode_encoder_encode
(
id
->
encoder
,
p_in
);
if
(
p_encoded
)
block_ChainAppend
(
out
,
p_encoded
);
picture_Release
(
p_in
);
}
}
while
(
p_in
!=
NULL
);
}
int
transcode_video_process
(
sout_stream_t
*
p_stream
,
sout_stream_id_sys_t
*
id
,
block_t
*
in
,
block_t
**
out
)
{
...
...
@@ -476,6 +510,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
id
->
decoder_out
.
video
.
i_sar_num
,
p_pic
->
format
.
i_sar_num
,
id
->
decoder_out
.
video
.
i_sar_den
,
p_pic
->
format
.
i_sar_den
);
DrainFilters
(
id
,
out
);
/* Close filters, encoder format input can't change */
transcode_remove_filters
(
&
id
->
p_f_chain
);
transcode_remove_filters
(
&
id
->
p_uf_chain
);
...
...
@@ -606,6 +641,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
if
(
b_eos
)
{
msg_Info
(
p_stream
,
"Drain/restart on EOS"
);
DrainFilters
(
id
,
out
);
if
(
transcode_encoder_drain
(
id
->
encoder
,
out
)
!=
VLC_SUCCESS
)
goto
error
;
transcode_encoder_close
(
id
->
encoder
);
...
...
@@ -634,6 +670,7 @@ error:
if
(
unlikely
(
!
id
->
b_error
&&
in
==
NULL
)
&&
transcode_encoder_opened
(
id
->
encoder
)
)
{
msg_Dbg
(
p_stream
,
"Flushing thread and waiting that"
);
DrainFilters
(
id
,
out
);
if
(
transcode_encoder_drain
(
id
->
encoder
,
out
)
==
VLC_SUCCESS
)
msg_Dbg
(
p_stream
,
"Flushing done"
);
else
...
...
Write
Preview
Supports
Markdown
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