[MPlayer-G2-dev] libvo2 documentation and pre22 iz out
Arpi
arpi at thot.banki.hu
Thu May 15 02:13:14 CEST 2003
Hi,
> I've also finished libvo2 dosc, here's it for discussion:
Ok i've done some changes, actually added (optional) support for on-demand
buffer allocation:
----- (paste from updated libvo2.txt)
You have to allocate (calloc()) an array of vo_bufffer_t structures, and put
the pointer into vo->buffers. Then loop though the array and fill each buffer
description struct, ie. put plane pointers/stride there. You can store your
private per-buffer data in vo_buffer_t->priv.
The number of allocated buffers should be put into vo->num_buffers.
You can also choose buffer allocation on-demand, ie. allocate buffers only when
needed so you don't allocate more (or less) than the ideal number of buffers.
For this, you need to implement get_buffer() and release_buffer() functions.
get_buffer() will allocate and return a single buffer, or NULL if allocation
failed (no more resources etc). release_buffer() will be called to free it.
Note: you can mix the 2 methods, vo->num_buffers+vo->buffers[] and get_buffer(),in this case when num_buffers is not enough, then get_buffers() will be called
(think it is called get_more_buffers :)). The release_buffer() is only called
for buffers allocated by get_buffers(), never for the ones from buffers[] !
So you can allocate one buffer in config(), to test if allocation doesn't fail,
and implement get_buffer() to allow application to request more buffers.
-----
A'rpi / Astral & ESP-team
--
Developer of MPlayer G2, the Movie Framework for all - http://www.MPlayerHQ.hu
More information about the MPlayer-G2-dev
mailing list