[vlc-devel] [RFC 1/8] libvlc: add a bool return value to the resize callback

Rémi Denis-Courmont remi at remlab.net
Tue Nov 20 17:54:51 CET 2018


Le tiistaina 20. marraskuuta 2018, 18.38.05 EET Steve Lhomme a écrit :
> On 20/11/2018 17:21, Rémi Denis-Courmont wrote:
> > Le tiistaina 20. marraskuuta 2018, 17.42.35 EET Steve Lhomme a écrit :
> >> For some reason it may be impossible to the host to provide a context
> >> with
> >> the given size.
> > 
> > As already explained, this cannot work. We tried that already in the past
> > and removed it knowingly. The core has no way to handle rejected resizes,
> > since they are asynchronous and already acted upon by the time this
> > callback is invoked.
> > 
> > Indeed, the Resize() function would need to pass the error to the caller,
> > which it cannot do.
> 
> You mean like this ?
> https://code.videolan.org/robUx4/vlc/blob/libvlc/callbacks/10/modules/video_
> output/vgl.c#L72

Resize() cannot return an error because it corresponds to 
VOUT_DISPLAY_CHANGE_* controls which cannot fail (or rather, are assumed to 
succeed), because they merely notify of a change after it already happened.

If you need to reallocate buffers on resize, then you need invalid pictures. 
You can then fail the allocation in the pool callback *after* the resize 
event. This is obviously specific to buffer pull model.

But regardless fo pull or push, if you cannot allocate buffers, video will be 
decoded into oblivion. There is not much that be done.

-- 
レミ・デニ-クールモン
http://www.remlab.net/





More information about the vlc-devel mailing list