How to develop a new unsupported fourcc decoder
Posted: 05 Sep 2013 17:00
Hi,
I'm discovering out of tree Vlc plugin development and it is great !
I have written a demux plugin which can split my proprietary AudioVideo (AV) ip stream.
This ip stream contains 2 elementary streams:
- One video MJPEG stream
- One text metatdata stream.
My demux creates these 2 objects with:
es_format_Init(&pSys_X->VideoFormat_X,VIDEO_ES,0);
pSys_X->VideoFormat_X.i_codec=VLC_CODEC_MJPG;
pSys_X->pEsVideo_X=es_out_Add(pDemux_X->out,&pSys_X->VideoFormat_X);
and:
CodecFourCC_X=VLC_FOURCC('k','t','c','1'); //In-house format, not supported by vlc
es_format_Init(&pSys_X->TcFormat_X,SPU_ES,CodecFourCC_X);
pSys_X->pEsTc_X=es_out_Add(pDemux_X->out,&pSys_X->TcFormat_X);
When the demux receive our proprietary AV ip stream it outputs blocks with the corresponding data with:
block_t *pBlock_X;
Video:
es_out_Control(_pDemux_X->out,ES_OUT_SET_PCR,pBlock_X->i_pts);
es_out_Send(_pDemux_X->out,pSys_X->pEsVideo_X,pBlock_X);
Text:
es_out_Send(_pDemux_X->out,pSys_X->pEsTc_X,pBlock_X);
All the different payload are correcty setuped in the pBlock_X structure
So far so good, everything seems ok.
My questions are:
- Which king of module do I need to create to consume the text stream which is produced by es_out_Send(_pDemux_X->out,pSys_X->pEsTc_X,pBlock_X) ? (I don't want to use standard Vlc module because I need to make extra work on the text payload)
- How Vlc makes the link between my new codec fourcc code and the module which can handle its processing ? (In my case CodecFourCC_X=VLC_FOURCC('k','t','c','1'); //In-house format, not supported by vlc)
- By looking in Vlc source it seems that the association between codec fourcc code and codec module is stored in a static array. Is that right ?
- Is there any documentation or examples of a module which produce a custom elementary stream and another module which consume it ? !! these modules should produce and process out of the shelf unsupported data type (no MJPEG or MP3 but a 'new' unsupported format)
- If I just want to display my text metadata stream as a "marquee", is it possible to consume the text stream using a standard vlc module (!!! text data can chand up to 60 times per seconds !!)
Thank you very much for your time and help
Best regards
I'm discovering out of tree Vlc plugin development and it is great !
I have written a demux plugin which can split my proprietary AudioVideo (AV) ip stream.
This ip stream contains 2 elementary streams:
- One video MJPEG stream
- One text metatdata stream.
My demux creates these 2 objects with:
es_format_Init(&pSys_X->VideoFormat_X,VIDEO_ES,0);
pSys_X->VideoFormat_X.i_codec=VLC_CODEC_MJPG;
pSys_X->pEsVideo_X=es_out_Add(pDemux_X->out,&pSys_X->VideoFormat_X);
and:
CodecFourCC_X=VLC_FOURCC('k','t','c','1'); //In-house format, not supported by vlc
es_format_Init(&pSys_X->TcFormat_X,SPU_ES,CodecFourCC_X);
pSys_X->pEsTc_X=es_out_Add(pDemux_X->out,&pSys_X->TcFormat_X);
When the demux receive our proprietary AV ip stream it outputs blocks with the corresponding data with:
block_t *pBlock_X;
Video:
es_out_Control(_pDemux_X->out,ES_OUT_SET_PCR,pBlock_X->i_pts);
es_out_Send(_pDemux_X->out,pSys_X->pEsVideo_X,pBlock_X);
Text:
es_out_Send(_pDemux_X->out,pSys_X->pEsTc_X,pBlock_X);
All the different payload are correcty setuped in the pBlock_X structure
So far so good, everything seems ok.
My questions are:
- Which king of module do I need to create to consume the text stream which is produced by es_out_Send(_pDemux_X->out,pSys_X->pEsTc_X,pBlock_X) ? (I don't want to use standard Vlc module because I need to make extra work on the text payload)
- How Vlc makes the link between my new codec fourcc code and the module which can handle its processing ? (In my case CodecFourCC_X=VLC_FOURCC('k','t','c','1'); //In-house format, not supported by vlc)
- By looking in Vlc source it seems that the association between codec fourcc code and codec module is stored in a static array. Is that right ?
- Is there any documentation or examples of a module which produce a custom elementary stream and another module which consume it ? !! these modules should produce and process out of the shelf unsupported data type (no MJPEG or MP3 but a 'new' unsupported format)
- If I just want to display my text metadata stream as a "marquee", is it possible to consume the text stream using a standard vlc module (!!! text data can chand up to 60 times per seconds !!)
Thank you very much for your time and help
Best regards