[FFmpeg-devel] [PATCH] zerocodec: fix direct rendering.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Jul 21 13:44:57 CEST 2012


On Sat, Jul 21, 2012 at 01:42:26PM +0200, Reimar Döffinger wrote:
> On Sat, Jul 21, 2012 at 11:32:06AM +0000, Paul B Mahol wrote:
> > On 7/21/12, Reimar Doeffinger <Reimar.Doeffinger at gmx.de> wrote:
> > > Set picture type before calling get_buffer.
> > > This allows the DR application to make better decisions.
> > > It also fixes a resource leak in case of missing reference frames
> > > since it would call get_buffer but never release_buffer.
> > > Also use FFSWAP to ensure that the AVFrame is properly initialized
> > > in the next get_buffer (in particular that data[0] is NULL).
> > >
> > > Signed-off-by: Reimar Doeffinger <Reimar.Doeffinger at gmx.de>
> > > ---
> > >  libavcodec/zerocodec.c |   34 +++++++++++++++++-----------------
> > >  1 file changed, 17 insertions(+), 17 deletions(-)
> > >
> > 
> > What about reget_buffer()?
> 
> Could be used, but then you need another buffer to do the zlib
> compression into first.
> Doesn't seem like much of a win to me.
> All that you'd win I think is that you can decompress the whole
> frame in one go.

I forgot: however that means you either have to memcpy the keyframes
or keep the current code around just for the key frames.
If we had our own zlib decompression that would be a different case:
we could use reget_buffer and change the decompression to not write out
any 0s, thus reducing the bandwidth needed and possibly increasing
performance.


More information about the ffmpeg-devel mailing list