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

Hugo Beauzee-Luyssen beauze.h at gmail.com
Wed Jan 20 00:41:07 CET 2010


On Wed, Jan 20, 2010 at 12:29 AM, Laurent Aimar <fenrir at via.ecp.fr> wrote:
> 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
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>

This should integrate your advices.
I renamed the created field to has_vout. It's enough to know when an
user can starts to use the function mentioned earlier.

Regards,

-- 
Hugo Beauzée-Luyssen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Adding-an-event-when-a-vout-is-created-or-destroyed.patch
Type: text/x-patch
Size: 1832 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20100120/56ce335c/attachment.bin>


More information about the vlc-devel mailing list