Commit 0d646a30 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

sout_EncoderCreate: create an encoder module

Perhaps we should turn it into ...New() and do more than just allocate
the object.
parent ecd8f480
......@@ -238,6 +238,13 @@ static inline int sout_StreamIdSend( sout_stream_t *s, sout_stream_id_t *id, blo
return s->pf_send( s, id, b );
}
/****************************************************************************
* Encoder
****************************************************************************/
VLC_EXPORT( encoder_t *, sout_EncoderCreate, ( vlc_object_t *obj ) );
#define sout_EncoderCreate(o) sout_EncoderCreate(VLC_OBJECT(o))
/****************************************************************************
* Announce handler
****************************************************************************/
......
......@@ -711,7 +711,7 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
id->p_decoder->b_pace_control = true;
/* Create encoder object */
id->p_encoder = vlc_object_create( p_stream, VLC_OBJECT_ENCODER );
id->p_encoder = sout_EncoderCreate( p_stream );
if( !id->p_encoder )
goto error;
vlc_object_attach( id->p_encoder, p_stream );
......
......@@ -45,6 +45,7 @@
#include <vlc_image.h>
#include <vlc_stream.h>
#include <vlc_charset.h>
#include <vlc_sout.h>
#include <libvlc.h>
static picture_t *ImageRead( image_handler_t *, block_t *,
......@@ -656,7 +657,7 @@ static encoder_t *CreateEncoder( vlc_object_t *p_this, video_format_t *fmt_in,
{
encoder_t *p_enc;
p_enc = vlc_object_create( p_this, VLC_OBJECT_ENCODER );
p_enc = sout_EncoderCreate( p_this );
if( p_enc == NULL )
return NULL;
......
......@@ -43,6 +43,7 @@
#include <vlc_meta.h>
#include <vlc_block.h>
#include <vlc_codec.h>
#include "input/input_interface.h"
......@@ -874,3 +875,11 @@ rtp:
mrl_Clean( &mrl );
return psz_chain;
}
#undef sout_EncoderCreate
encoder_t *sout_EncoderCreate( vlc_object_t *p_this )
{
static const char type[] = "encoder";
return vlc_custom_create( p_this, sizeof( encoder_t ), VLC_OBJECT_GENERIC,
type );
}
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