[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-commit] gnash ChangeLog libbase/image.cpp libbase/image.h

From: strk
Subject: Re: [Gnash-commit] gnash ChangeLog libbase/image.cpp libbase/image.h
Date: Wed, 2 May 2007 21:08:24 +0200

On Wed, May 02, 2007 at 11:18:20AM -0600, Rob Savoye wrote:
> Bastiaan Jacques wrote:
> >
> > That's not surprising, since the image buffer is needlessly copied into
> > newly allocated buffers several times before the single frame is
> > actually rendered. This code badly needs an efficiency overhaul.
>   The goal of high performance networking is to pass pointers around as
> much as possible, and avoid copying data as much as possible.

I agree, but everytime we pass pointers (or references) around we must
carefully consider ownership issues.
In this case image_base class *owns* the buffer, and ::update copies it.

We might define a non-owning class maybe, but I belive most of the time 
the buffer is needlessly copied (as Bastiaan noticed) as the result
of a gstreamer callback. Most of the time the copied buffer is not even
used as at ::display time just the "last available buffer" is used.
Another approach might be creating the buffer on demand (at ::display time).
This would also allow optimization in case we'll skip rendering completely
when we're late on the timeline.

Further optimization might include doing some research about wheter gstreamer
can decode into a provided buffer, so it would  directly fill up the image_base
buffer and we'd completely avoid the additional copy.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]