Page 1 of 1

ES from a custom module: demux to decoder

Posted: 20 Jun 2012 00:53
by ewong
Within the Open() method of a custom demux module, I assume that the
stream must be added, es_out_Add( ) before sending data to it using es_out_Send().
Is that true?

Is a decoder module invoked by specifying the codec type, i_codec = ?

As shown by the ??? in the code snippet, how do you specify a custom decoder, eg. MyDecoder?
There is an include file called vlc_fourcc.h, should this file be modified?

Code: Select all

struct demux_sys_t { es_format_t fmt; es_out_id_t *p_es; ... }; static int Open( vlc_object_t * p_this ) { demux_t *p_demux = (demux_t*)p_this; demux_sys_t *p_sys; .... p_demux->p_sys = p_sys; ... // Set the Elementary Stream Format es_format_Init( &p_sys->fmt, VIDEO_ES, 0 ); p_sys->fmt.i_codec = ???; p_sys->p_es = es_out_Add( p_demux->out, &p_sys->fmt ); }
How does a RGBA image get rendered from a decoder module?

As shown in the png.c module, if the DecodeBlock() returns with a picture_t variable,
does the image get immediately rendered in an output window?

Code: Select all

static int OpenDecoder( vlc_object_t *p_this ) { ... /* Set output properties */ p_dec->fmt_out.i_cat = VIDEO_ES; p_dec->fmt_out.i_codec = VLC_CODEC_RGBA; /* Set callbacks */ p_dec->pf_decode_video = DecodeBlock; return VLC_SUCCESS; }
Where is the window initially spawned from a file such as image.png.
Is it the Access or Demux module?

Re: ES from a custom module: demux to decoder

Posted: 23 Jun 2012 16:30
by Jean-Baptiste Kempf
Define the i_codec with the correct FOURCC (see vlc_fourcc.h and src/misc/fourcc.c)