Commit b0b5bd30 authored by Steve Lhomme's avatar Steve Lhomme

transcoder: create the video encoder early

Similar to how it's done with the vout. The decoder requests the output object
it needs (and it will provide the picture pool to the decoder)
parent 6cf877b9
......@@ -39,6 +39,8 @@
#define ENC_FRAMERATE (25 * 1000)
#define ENC_FRAMERATE_BASE 1000
static int create_encoder(sout_stream_t *, sout_stream_id_sys_t *);
static const es_format_t* video_output_format( sout_stream_id_sys_t *id )
{
if( id->p_uf_chain )
......@@ -83,6 +85,12 @@ static int video_update_format_decoder( decoder_t *p_dec )
static picture_t *video_new_buffer_decoder( decoder_t *p_dec )
{
sout_stream_t *stream = (sout_stream_t*) p_dec->p_owner;
sout_stream_id_sys_t *id = *DECODER_STREAM_ID(p_dec);
assert(id->p_decoder == p_dec);
if (unlikely(!id->p_encoder->p_module))
create_encoder(stream, id);
return picture_NewFromFormat( &p_dec->fmt_out.video );
}
......
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