[vlc-commits] transcode/video: test video conversion
Thomas Guillem
git at videolan.org
Fri Jan 19 08:37:14 CET 2018
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Jan 18 18:48:30 2018 +0100| [893c3bb704e1b1ed0da99da65cbc6b69d3046c33] | committer: Thomas Guillem
transcode/video: test video conversion
No need to encode if no conversion is possible.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=893c3bb704e1b1ed0da99da65cbc6b69d3046c33
---
modules/stream_out/transcode/video.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index fbe7475d42..26cf38796a 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -375,8 +375,8 @@ static void transcode_video_filter_init( sout_stream_t *p_stream,
}
/* Take care of the scaling and chroma conversions. */
-static void conversion_video_filter_append( sout_stream_id_sys_t *id,
- picture_t *p_pic )
+static int conversion_video_filter_append( sout_stream_id_sys_t *id,
+ picture_t *p_pic )
{
const video_format_t *p_vid_out = video_output_format( id, p_pic );
@@ -387,9 +387,10 @@ static void conversion_video_filter_append( sout_stream_id_sys_t *id,
es_format_t fmt_out;
es_format_Init( &fmt_out, VIDEO_ES, p_vid_out->i_chroma );
fmt_out.video = *p_vid_out;
- filter_chain_AppendConverter( id->p_uf_chain ? id->p_uf_chain : id->p_f_chain,
- &fmt_out, &id->p_encoder->fmt_in );
+ return filter_chain_AppendConverter( id->p_uf_chain ? id->p_uf_chain : id->p_f_chain,
+ &fmt_out, &id->p_encoder->fmt_in );
}
+ return VLC_SUCCESS;
}
static void transcode_video_framerate_init( sout_stream_t *p_stream,
@@ -809,7 +810,8 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
transcode_video_encoder_init( p_stream, id, p_pic );
transcode_video_filter_init( p_stream, id );
- conversion_video_filter_append( id, p_pic );
+ if( conversion_video_filter_append( id, p_pic ) != VLC_SUCCESS )
+ goto error;
memcpy( &id->fmt_input_video, &p_pic->format, sizeof(video_format_t));
}
@@ -824,7 +826,8 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
transcode_video_encoder_init( p_stream, id, p_pic );
transcode_video_filter_init( p_stream, id );
- conversion_video_filter_append( id, p_pic );
+ if( conversion_video_filter_append( id, p_pic ) != VLC_SUCCESS )
+ goto error;
memcpy( &id->fmt_input_video, &p_pic->format, sizeof(video_format_t));
if( transcode_video_encoder_open( p_stream, id ) != VLC_SUCCESS )
More information about the vlc-commits
mailing list