31.01.15 23:56, Dan Dennedy написав(ла):
On Thu, Jan 29, 2015 at 8:21 AM, Maksym Veremeyenko <ve...@m1stereo.tv
<mailto:ve...@m1stereo.tv>> wrote:

    Hi,

    i noticed that sometimes pixbufs producers stop caching converted
    images and do conversion on each get_image call. i found that it
    happens because of cached pixbuf, image and alpha been dropped from
    cache because of cache limit.

    attached patch implement extending limit of that cache.


1.) Change MLT_GTK2_PRODUCER_CACHE to MLT_PIXBUF_CACHE as this only
affects pixbuf, of which there is only a producer. I strongly doubt that
we will ever have a pixbuf consumer because the avformat consumer works
fine for images.

2.) Needs to be documented in the yml.
please review updated patch

--
________________________________________
Maksym Veremeyenko
>From 3f62e239b72c36ed1fd6dd758fe5987b6358b777 Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <ve...@m1stereo.tv>
Date: Mon, 2 Feb 2015 13:48:42 +0200
Subject: [PATCH] introduce environment variable MLT_PIXBUF_PRODUCER_CACHE to
 increase/override number of cached converted images

---
 src/modules/gtk2/factory.c           |    8 ++++++++
 src/modules/gtk2/producer_pixbuf.yml |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/modules/gtk2/factory.c b/src/modules/gtk2/factory.c
index 5aee606..90a886d 100644
--- a/src/modules/gtk2/factory.c
+++ b/src/modules/gtk2/factory.c
@@ -20,6 +20,7 @@
 #include <string.h>
 #include <framework/mlt.h>
 #include <gdk/gdk.h>
+#include <stdlib.h>
 
 #ifdef USE_PIXBUF
 extern mlt_producer producer_pixbuf_init( char *filename );
@@ -41,6 +42,13 @@ static void initialise( )
 	{
 		init = 1;
 		g_type_init( );
+		if ( getenv("MLT_PIXBUF_PRODUCER_CACHE") )
+		{
+			int n = atoi( getenv("MLT_PIXBUF_PRODUCER_CACHE" )  );
+			mlt_service_cache_set_size( NULL, "pixbuf.image", n );
+			mlt_service_cache_set_size( NULL, "pixbuf.alpha", n );
+			mlt_service_cache_set_size( NULL, "pixbuf.pixbuf", n );
+		}
 	}
 }
 
diff --git a/src/modules/gtk2/producer_pixbuf.yml b/src/modules/gtk2/producer_pixbuf.yml
index ef1b7af..e390da1 100644
--- a/src/modules/gtk2/producer_pixbuf.yml
+++ b/src/modules/gtk2/producer_pixbuf.yml
@@ -16,6 +16,8 @@ notes: >
   whatever the consumer requests. Therefore, it will lose its aspect ratio if 
   so requested, and it is up to the consumer to request a proper width and 
   height that maintains the image aspect.
+  Environment variable MLT_PIXBUF_PRODUCER_CACHE could be used to to override
+  /increase the number of cached converted images for simultaneous use.
 
 parameters:
   - identifier: argument
-- 
1.7.7.6

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to