[vlc-commits] sout: transcode: call suppicture update for text spu
Francois Cartegnie
git at videolan.org
Wed Jan 17 18:32:00 CET 2018
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jan 9 11:33:37 2018 +0100| [d161752d626562a657a41f449d47bc6fef26cc19] | committer: Francois Cartegnie
sout: transcode: call suppicture update for text spu
as regions content is not created until updated once
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d161752d626562a657a41f449d47bc6fef26cc19
---
modules/stream_out/transcode/spu.c | 14 ++++++++++++++
modules/stream_out/transcode/transcode.c | 3 +++
modules/stream_out/transcode/transcode.h | 2 ++
modules/stream_out/transcode/video.c | 6 ++++++
4 files changed, 25 insertions(+)
diff --git a/modules/stream_out/transcode/spu.c b/modules/stream_out/transcode/spu.c
index 913272624d..51f86b4fa0 100644
--- a/modules/stream_out/transcode/spu.c
+++ b/modules/stream_out/transcode/spu.c
@@ -176,6 +176,20 @@ int transcode_spu_process( sout_stream_t *p_stream,
{
block_t *p_block;
+ es_format_t fmt;
+ es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_TEXT );
+
+ fmt.video.i_sar_num =
+ fmt.video.i_visible_width =
+ fmt.video.i_width = p_sys->i_spu_width;
+
+ fmt.video.i_sar_den =
+ fmt.video.i_visible_height =
+ fmt.video.i_height = p_sys->i_spu_height;
+
+ subpicture_Update( p_subpic, &fmt.video, &fmt.video, p_subpic->i_start );
+ es_format_Clean( &fmt );
+
p_block = id->p_encoder->pf_encode_sub( id->p_encoder, p_subpic );
subpicture_Delete( p_subpic );
if( p_block )
diff --git a/modules/stream_out/transcode/transcode.c b/modules/stream_out/transcode/transcode.c
index 99784a3f99..f96c6e61e6 100644
--- a/modules/stream_out/transcode/transcode.c
+++ b/modules/stream_out/transcode/transcode.c
@@ -409,6 +409,9 @@ static int Open( vlc_object_t *p_this )
}
p_sys->b_soverlay = var_GetBool( p_stream, SOUT_CFG_PREFIX "soverlay" );
+ /* Set default size for TEXT spu non overlay conversion / updater */
+ p_sys->i_spu_width = (p_sys->i_width) ? p_sys->i_width : 1280;
+ p_sys->i_spu_height = (p_sys->i_height) ? p_sys->i_height : 720;
psz_string = var_GetString( p_stream, SOUT_CFG_PREFIX "sfilter" );
if( psz_string && *psz_string )
diff --git a/modules/stream_out/transcode/transcode.h b/modules/stream_out/transcode/transcode.h
index 8ab9b2111d..144502a9c2 100644
--- a/modules/stream_out/transcode/transcode.h
+++ b/modules/stream_out/transcode/transcode.h
@@ -61,6 +61,8 @@ struct sout_stream_sys_t
config_chain_t *p_spu_cfg;
spu_t *p_spu;
filter_t *p_spu_blend;
+ unsigned int i_spu_width; /* render width */
+ unsigned int i_spu_height;
/* Sync */
bool b_master_sync;
diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index 68fc445866..a3b15792f9 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -364,6 +364,12 @@ static void transcode_video_filter_init( sout_stream_t *p_stream,
id->p_encoder->fmt_in.video.i_sar_den;
}
+ if( p_fmt_out )
+ {
+ p_stream->p_sys->i_spu_width = p_fmt_out->video.i_visible_width;
+ p_stream->p_sys->i_spu_height = p_fmt_out->video.i_visible_height;
+ }
+
/* Keep colorspace etc info along */
id->p_encoder->fmt_in.video.space = id->p_decoder->fmt_out.video.space;
id->p_encoder->fmt_in.video.transfer = id->p_decoder->fmt_out.video.transfer;
More information about the vlc-commits
mailing list