[vlc-devel] RE : [LONG] Some thoughts and questions about vout

brezhoneg1 brezhoneg1 at yahoo.fr
Thu Nov 13 15:28:58 CET 2008


Hi,

Ok, I do agree there is a problem with vlc_object_find for recycling
object. A lock mechanism is required.

Are you interested in integrating a recycling mechanism in vlc ? I can
write something and submit it for review. Would that be something worth
doing for future enhancement? 

I am thinking of:

4 exported functions :

int vlc_recycle_init (p _libvlc)
int vlc_recycle_release ( p_libvlc )
vlc_object_t* vlc_object_request ( p_obj, object_type )
int vlc_object_recycle( p_obj )

The internal implementation would be:
- a pointer to a recycle_t structure in libvlc
- a list of p_obj to be kept 
- proper lock mechanism
- proper reference handling 

Erwan10

  

-----Message d'origine-----
De : vlc-devel-bounces at videolan.org
[mailto:vlc-devel-bounces at videolan.org] De la part de Rémi
Denis-Courmont
Envoyé : jeudi 13 novembre 2008 08:41
À : Mailing list for VLC media player developers
Objet : Re: [vlc-devel] [LONG] Some thoughts and questions about vout
Importance : Faible


On Wed, 12 Nov 2008 22:38:58 +0100, "brezhoneg1" <brezhoneg1 at yahoo.fr>
wrote:
> I guess this vout recycling scheme wasn't removed just to make users
> enrage! If stability was at stake, that's a point.
> 
> About vlc_object_find (being deprecated and yet so widely used), is
> there any guideline to figure out how to do things the new/right way?
> Without these guidelines, one can but feel helpless about all those
> FIND_ANYWHERE which prevent promising new libvlc api to deliver its
true
> value!

Keep track of what you need to keep track of explicitly, via type-safe
pointers, thread-safe referencing, etc.

In any case, you CANNOT do recycling with vlc_object_find(). You have no
way to ensure that someone else is not trying to dispose or recycle the
same object at the _same_ time. In that case, vlc_object_find() is not
only
ugly and restrictive, it's just plain wrong.


-- 
Rémi Denis-Courmont







More information about the vlc-devel mailing list