Commit 893c3bb7 authored by Thomas Guillem's avatar Thomas Guillem

transcode/video: test video conversion

No need to encode if no conversion is possible.
parent 67e99316
...@@ -375,8 +375,8 @@ static void transcode_video_filter_init( sout_stream_t *p_stream, ...@@ -375,8 +375,8 @@ static void transcode_video_filter_init( sout_stream_t *p_stream,
} }
/* Take care of the scaling and chroma conversions. */ /* Take care of the scaling and chroma conversions. */
static void conversion_video_filter_append( sout_stream_id_sys_t *id, static int conversion_video_filter_append( sout_stream_id_sys_t *id,
picture_t *p_pic ) picture_t *p_pic )
{ {
const video_format_t *p_vid_out = video_output_format( id, 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, ...@@ -387,9 +387,10 @@ static void conversion_video_filter_append( sout_stream_id_sys_t *id,
es_format_t fmt_out; es_format_t fmt_out;
es_format_Init( &fmt_out, VIDEO_ES, p_vid_out->i_chroma ); es_format_Init( &fmt_out, VIDEO_ES, p_vid_out->i_chroma );
fmt_out.video = *p_vid_out; fmt_out.video = *p_vid_out;
filter_chain_AppendConverter( id->p_uf_chain ? id->p_uf_chain : id->p_f_chain, return filter_chain_AppendConverter( id->p_uf_chain ? id->p_uf_chain : id->p_f_chain,
&fmt_out, &id->p_encoder->fmt_in ); &fmt_out, &id->p_encoder->fmt_in );
} }
return VLC_SUCCESS;
} }
static void transcode_video_framerate_init( sout_stream_t *p_stream, 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, ...@@ -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_encoder_init( p_stream, id, p_pic );
transcode_video_filter_init( p_stream, id ); 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)); 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, ...@@ -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_encoder_init( p_stream, id, p_pic );
transcode_video_filter_init( p_stream, id ); 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)); memcpy( &id->fmt_input_video, &p_pic->format, sizeof(video_format_t));
if( transcode_video_encoder_open( p_stream, id ) != VLC_SUCCESS ) if( transcode_video_encoder_open( p_stream, id ) != VLC_SUCCESS )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment