Commit 48851707 authored by Steinar H. Gunderson's avatar Steinar H. Gunderson Committed by Rémi Denis-Courmont

Make the video transcoder support filter chains that output multiple frames

In the video transcoder, call the filters as many times as needed
(second and following time with NULL input) until they stop outputting
frames. This means that frame-doubling filters, such as the yadif2x
deinterlacer, get all their frames output.
Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent 73c9a34a
......@@ -803,19 +803,36 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_t *id,
}
}
/* Run filter chain */
if( id->p_f_chain )
p_pic = filter_chain_VideoFilter( id->p_f_chain, p_pic );
if( !p_pic )
continue;
/* Run user specified filter chain */
if( id->p_uf_chain )
p_pic = filter_chain_VideoFilter( id->p_uf_chain, p_pic );
if( !p_pic )
continue;
OutputFrame( p_sys, p_pic, b_need_duplicate, p_stream, id, out );
/* Run the filter and output chains; first with the picture,
* and then with NULL as many times as we need until they
* stop outputting frames.
*/
for ( ;; ) {
picture_t *p_filtered_pic = p_pic;
/* Run filter chain */
if( id->p_f_chain )
p_filtered_pic = filter_chain_VideoFilter( id->p_f_chain, p_filtered_pic );
if( !p_filtered_pic )
break;
for ( ;; ) {
picture_t *p_user_filtered_pic = p_filtered_pic;
/* Run user specified filter chain */
if( id->p_uf_chain )
p_user_filtered_pic = filter_chain_VideoFilter( id->p_uf_chain, p_user_filtered_pic );
if( !p_user_filtered_pic )
break;
OutputFrame( p_sys, p_user_filtered_pic, b_need_duplicate, p_stream, id, out );
b_need_duplicate = false;
p_filtered_pic = NULL;
}
p_pic = NULL;
}
}
if( p_sys->i_threads >= 1 )
......
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