[vlc-devel] [vlc-commits] vout: fix picture lock/unlock with private pool

Thomas Guillem thomas at gllm.fr
Mon Nov 3 15:35:37 CET 2014



On Mon, Nov 3, 2014, at 13:35, Rémi Denis-Courmont wrote:
> Le 2014-11-03 13:48, Thomas Guillem a écrit :
> > It crashes in mediacodec because p_pic->p_sys is NULL;
> 
> Ideally, we would have a separate type for picture references and 
> pictures, so that we could track references to the same picture in 
> different ways in different code paths. We do not, and consequently, the 
> picture_t pointer returned by a pool may differ from that given to the 
> pool when it was created.
> 
> Regardless, all the data inside should match, including p_sys. As far 
> as I could test, it worked fine.
> 
> > p_pic and p_pic->p_sys are normally allocated from android/opaque.c 
> > and
> > given to a pool.
> >
> > So, I think decoder_NewPicture(p_dec) doesn't return a picture 
> > allocated
> > by the pool anymore.
> 
> There are three pools: decoder, private, display, not the pool. Only 
> the last one is warranted to contain picture form the display or the 
> splitter. For the other two ones, it depends if direct rendering works 
> or does not.

With Mediacodec, we use android/opaque vout that use a pool with lock /
unlock. Because of that, we don't use the code patch where direct
rendering is enabled.

A solution for my problem is to move the "!picture_pool_NeedsLocking()"
check and have, at the end of vout_InitWrapper:

if (!picture_pool_NeedsLocking(sys->decoder_pool))
    sys->private_pool = picture_pool_Reserve(sys->decoder_pool,
    private_picture);

I have a working patch, but I'm not sure about all the consequences.

> 
> -- 
> Rémi Denis-Courmont
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



More information about the vlc-devel mailing list