[vlc-devel] Writing new KLV module

Yair Han YairH at optibase.com
Sat May 8 21:03:31 CEST 2010


Thanks Remi.

As I wrote I'll send the code. I'll appreciate if you'll take a look on it.

Anyway, the question you wrote you didn't understand is a context issue. The open and close methods are called in the same context as the decode method? Do I need to add a mutex to exclude the access to them?
Does the p_sys of the module need to be exclude from access form different contexts too?

Thanks,
Yair


-----Original Message-----
From: Rémi Denis-Courmont [mailto:remi at remlab.net] 
Sent: Saturday, May 08, 2010 8:19 PM
To: vlc-devel at videolan.org
Cc: Yair Han
Subject: Re: [vlc-devel] Writing new KLV module

Le samedi 8 mai 2010 19:59:08 Yair Han, vous avez écrit :
> The TS Demux recognizes the metadata PID and collects the data to a
> p_block. The p_block is passed okay to the klv module and gets
> translated properly.
> 
> Do I need to free the block in the decoder (my new module) or leave it
> to the demux to free?

The codec needs to free it (or pass it onto something else).

> Can I use the block from the demux or should I use duplicate block
> before using on the module?

You must not refer to a block after you gave it to es_out_Send(). It will be 
stored in the elementary stream FIFO where the codec will dequeue it 
asynchronously.

> What do I need to exclude the use of p_sys inside my module or the Open
> + Close methods from the Decode method or both?

I don't understand your question.

> The output could be one of two. Sub picture on screen (still need to
> implement) and text output to the calling application through the
> ActiveX plugin
> 
> How do I use a var_string for output string properly?

You need to create a string variable on an object. Then you can call 
var_SetString(), var_AddCallback() and/or var_GetString() on that object.

> How and where I need to exclude access to interface string?

var_* functions are interlocked internally. However, you need to have a 
reference to the object that the variable belongs to, when you call var_*.

> Do I need to call var_SetString inside my module or just memcopy to the
> interface var?
> 
> 
> 
> The current status is that it works functionally and the klv string gets
> to the calling application but it crashes after a few seconds or
> minutes. I guess it's some memory corruption but I can't find it.

valgrind could be helpful there.

-- 
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis



More information about the vlc-devel mailing list