[vlc-devel] Writing new KLV module

Rémi Denis-Courmont remi at remlab.net
Sat May 8 21:15:48 CEST 2010


Le samedi 8 mai 2010 22:03:31 Yair Han, vous avez écrit :
> 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?

The caller (in this case, the VLC ES output) is responsible for serializing 
use of a single decoder object. Decode() is called (repeatedly) after Open() 
returns VLC_SUCCESS; Close() is only be called after any pending Decode() 
returns.

On the other hand, the Open() function may be called from a different thread 
than Decode() so you cannot rely on thread-specific variables.

> Do I need to add a mutex to exclude the access to them?

No. You may need a mutex if you register a variable callback 
(var_AddCallback); otherwise, synchronization is done by the caller.

> Does the p_sys of the module need to be exclude from access form different
> contexts too?

Only if you use var_AddCallback().

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



More information about the vlc-devel mailing list