[vlc-devel] [PATCH 09/13] sout: transcode: keep track of the decoder video context
Steve Lhomme
robux4 at ycbcr.xyz
Mon Dec 23 16:49:33 CET 2019
Just like we keep track of its ES output.
---
modules/stream_out/transcode/transcode.h | 6 +++++-
modules/stream_out/transcode/video.c | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/modules/stream_out/transcode/transcode.h b/modules/stream_out/transcode/transcode.h
index 8b48770c26f..3090bbb4f86 100644
--- a/modules/stream_out/transcode/transcode.h
+++ b/modules/stream_out/transcode/transcode.h
@@ -136,7 +136,11 @@ struct sout_stream_id_sys_t
audio_format_t fmt_input_audio;
};
};
- es_format_t decoder_out; /* only rw from pf_*_format_update() */
+
+ /* only rw from pf_*_format_update() */
+ es_format_t decoder_out;
+ vlc_video_context *decoder_vctx_out;
+
const sout_filters_config_t *p_filterscfg;
/* Encoder */
diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index 18b7ffda209..a1e0199a156 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -131,6 +131,7 @@ static int video_update_format_decoder( decoder_t *p_dec, vlc_video_context *vct
return 0;
}
+ id->decoder_vctx_out = vctx;
es_format_Clean( &id->decoder_out );
es_format_Copy( &id->decoder_out, &p_dec->fmt_out );
@@ -198,6 +199,7 @@ int transcode_video_init( sout_stream_t *p_stream, const es_format_t *p_fmt,
id->fifo.pic.last = &id->fifo.pic.first;
id->b_transcode = true;
es_format_Init( &id->decoder_out, VIDEO_ES, 0 );
+ id->decoder_vctx_out = NULL;
/* Open decoder
*/
@@ -229,6 +231,7 @@ int transcode_video_init( sout_stream_t *p_stream, const es_format_t *p_fmt,
{
es_format_Clean( &id->decoder_out );
es_format_Copy( &id->decoder_out, &id->p_decoder->fmt_out );
+ id->decoder_vctx_out = NULL /* TODO id->p_decoder->vctx_out*/;
}
/*
@@ -603,6 +606,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
}
video_format_Copy( &id->decoder_out.video, &p_pic->format );
+ id->decoder_vctx_out = picture_GetVideoContext(p_pic);
if( !transcode_video_filters_configured( id ) )
{
@@ -610,7 +614,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
id->p_filterscfg,
(id->p_enccfg->video.fps.num > 0),
&id->decoder_out,
- picture_GetVideoContext(p_pic),
+ id->decoder_vctx_out,
transcode_encoder_format_in( id->encoder ),
id ) != VLC_SUCCESS )
goto error;
--
2.17.1
More information about the vlc-devel
mailing list