Help understand plugin capability

This forum is about all development around libVLC.
vanillacandle
New Cone
New Cone
Posts: 3
Joined: 02 Jun 2012 01:32

Help understand plugin capability

Postby vanillacandle » 02 Jun 2012 01:40

Hi,
I need to write a plugin which will read additional input file and while a move is playing will perform some tasks at particular times specified in that input file.

I read the documentation about plugins and have looked at the code for existing ones but I can't understand which capability my plugin will fall into. It must be similar to how subtitles work - they appear on the screen at a certain point of time.

Could someone point me to an existing plugin which does something similar ?

Thank you!

Rémi Denis-Courmont
Developer
Developer
Posts: 15135
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Help understand plugin capability

Postby Rémi Denis-Courmont » 02 Jun 2012 11:16

There is no plugin capability for "subtitles". The subtitle file formats are implemented by demuxers like all other file formats, and then a decoder plugin converts the text to Unicode and extracts style informations where needed.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

vanillacandle
New Cone
New Cone
Posts: 3
Joined: 02 Jun 2012 01:32

Re: Help understand plugin capability

Postby vanillacandle » 02 Jun 2012 14:11

Thank you for the reply.

I mentioned subtitles only as an example. After a media file is opened, my plugin needs to read a secondary file and do an action at a specific timestamp in the movie. My understanding is that in order to keep track of the current movie time, I need to subscribe to the player's 'time changed' event. Am I correct? Is there another way ?

I still don't understand the capability for this kind of plugin?

Thanks!

nkoriyama
Cone that earned his stripes
Cone that earned his stripes
Posts: 338
Joined: 01 Sep 2011 20:50
VLC version: git
Operating System: Windows / Mac OS X
Location: Japan

Re: Help understand plugin capability

Postby nkoriyama » 03 Jun 2012 13:03

Typical processing for subtitles: [module (capability, category, subcategory)]
[demuxer (demux, CAT_INPUT, SUBCAT_INPUT_DEMUX)]

[es_output]

[codec (decoder, CAT_INPUT, SUBCAT_INPUT_SCODEC)]

[vout_subpictures]
↓ ↓
↓ [text_renderer (text_renderer, CAT_VIDEO, SUBCAT_VIDEO_SUBPIC)]
↓ ↓
[video_output]


Demuxer parses stream (video file, text file, etc) and sends subtitles data block to decoder.
- Initialize and Add ES to send subtitles data block to decoder.

Code: Select all

es_format_Init( &fmt, SPU_ES, VLC_CODEC_*** ); /* */ p_sys->es = es_out_Add( p_demux->out, &fmt );
- Parse stream and generate subtitles data block.
data block (block_t) has time related information (block_t->i_pts, block_t->i_length).
- Send subtitles data block to decoder.

Code: Select all

es_out_Send( p_demux->out, p_sys->es, p_block );
Decoder receives subtitles data block and sends subpicture data.
- Check codec type.

Code: Select all

if( p_dec->fmt_in.i_codec != VLC_CODEC_*** ) return VLC_EGENERIC;
- Parse data block and generate text or image subpicture data.
If the subpicture data is text based, the character encoding of the text must be converted to UTF-8.
Subpicture data(subpicture_t) has also time related information (subpicture_t->i_start, subpicutre_t->i_stop), and these variables are set from data block like tihs:

Code: Select all

p_spu->i_start = p_block->i_pts; p_spu->i_stop = p_block->i_pts + p_block->i_length;
How To Ask Questions The Smart Way http://www.catb.org/~esr/faqs/smart-questions.html
My hack for ISDB-T http://sdrv.ms/126weue


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 7 guests