[vlc-devel] [Patch] Sending a signal when a vout is created/destroyed

Laurent Aimar fenrir at via.ecp.fr
Wed Jan 20 00:29:38 CET 2010


Hi,

On Wed, Jan 20, 2010, Hugo Beauzee-Luyssen wrote:
> This patchs adds a libvlc_MediaPlayerVoutChanged event, that let an
> application using libvlc know when a vout has been created.
> This can be usefull when trying to know the width or height of a
> media, using libvlc_video_get_width/height, as these functions
> immediatly return when no vout has been spawned.

> +        struct
> +        {
> +            int created;
> +        } media_player_vout_changed;
 With the current way vout event is implemented, you cannot know if a vout
is created or destructed, and so you won't be able to properly set ::created.
 On the other hand, you can easily return if there is a vout or not.
For that you may use input_GetVout() (you have to release the returned vout)
even if it does a bit more than needed.

> +    else if ( newval.i_int == INPUT_EVENT_VOUT )
> +    {
> +        p_mi->has_vout = !p_mi->has_vout;
 That won't work, multiple vout can be created, and INPUT_EVENT_VOUT can also be
triggered only once for a destruction+creation.

Regards,

-- 
fenrir




More information about the vlc-devel mailing list