On Mon, Feb 20, 2012 at 10:17 AM, Dan Dennedy <d...@dennedy.org> wrote:
> 2012/2/17 Maksym Veremeyenko <ve...@m1stereo.tv>:
>> 15.02.12 20:49, Dan Dennedy написав(ла):
>> [...]
>>
>>> In the pixbuf patch, you should not call the convert_image virtual
>>> function directly; use mlt_frame_get_image().
>>
>> use mlt_frame_get_image for converting image did not work - call to that
>> function return blank frame...
>
> It will only work when you call mlt_frame_set_image beforehand, which
> I believe you had done in the previous patch. Now you are not, so
> yeah, it is ok to call convert_image.
>
>> i updated patch and added the same functionality to pango producer, but
>> calling convert_image virtual function directly left till i find another way
>> to convert it...
>
> This is not fault of yours, but I can simply not include yet another
> form of caching into this pixbuf producer. I need to review the old
> cache (as opposed to usage of mlt_cache) first.

The old cache driven by the "cache" property caches an entire image
sequence into memory, which has very limited usage. The only time it
makes sense is when you have a short sequence and you reuse that
producer. The only thing I can see really using this is some unknown
playout server that smartly reuses a producer for an animated lower
third or watermark. Note this does not cache the colorspace-converted
images.

The purpose of mlt_cache for "pixbuf.pixbuf" is to recycle the
unscaled image because the resolution can change from one frame to the
next by the requester (e.g. affine transition). The usage of
mlt_service_cache prevents too many GdkPixbuf objects in memory at the
same time in a complex composition. We had kdenlive users using
hundreds of image clips - not an image sequence, but a laboriously
constructed slideshow. These pixbuf objects hold open a file
descriptor exhausting max file handles per process as well consuming
memory.

The purpose of mlt_cache for "pixbuf.image" is to recycle the scaled
image. Again, the usage of mlt_service_cache helps reduce memory
consumption. A mlt_service_cache applies across all instances of a
particular service in a graph. IOW, only up to 10 are actually in
memory while the least recently used get flushed. Your patch does not
take advantage of this. Imagine a few hundred digital photos
referenced by a Kdenlive project. Once you play through the project,
all of those images (albeit scaled and converted) are being cached in
producer_pixbuf.clone.image.

I think "pixbuf.image" should hold the converted image, but the
refresh_image() function needs refactoring to simplify it before we
can do anything more to it. Also, I maintain producer_qimage in
parallel with this, so it will need the same treatment. Finally, both
of these are also pending an enhancement to image sequence loading
that j-b-m requested. I will start the refactoring now.

-- 
+-DRD-+

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to