summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@gnome.org>2008-01-22 12:38:33 +0100
committerBenjamin Otte <otte@gnome.org>2008-01-22 12:38:33 +0100
commit9754142bf3ee212d2158304f6572e8a266cf8b82 (patch)
tree9859e0ac39ec13555e60144beb455163f8ebd684
parent81516c8555ce1030ec76bee3180b600d5007f30c (diff)
add properties for setting cache and garbage size
This should allow controlling the memory taken by Swfdec a bit.
-rw-r--r--player/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/player/main.c b/player/main.c
index 87c052b..4b00bbe 100644
--- a/player/main.c
+++ b/player/main.c
@@ -44,9 +44,13 @@ main (int argc, char *argv[])
IDirectFBSurface *surface;
/* config variables */
char *size = NULL;
+ int cache_size = 50 * 1024; /* 50 MB - Swfdec default value */
+ int garbage_size = 8 * 1024; /* 8 MB - Swfdec default value */
GOptionEntry options[] = {
{ "size", 's', 0, G_OPTION_ARG_STRING, &size, "WIDTHxHEIGHT to specify a size or \'fullscreen\' to run fullscreen", "STRING" },
+ { "cache-size", 'c', 0, G_OPTION_ARG_INT, &cache_size, "Amount of kB allowed as cache", "KB" },
+ { "garbage-size", 'g', 0, G_OPTION_ARG_INT, &garbage_size, "Amount of kB before garbage collection runs", "KB" },
{ NULL }
};
@@ -71,6 +75,8 @@ main (int argc, char *argv[])
ERROR_CHECK (DirectFBCreate (&dfb));
player = swfdec_dfb_player_new_from_file (dfb, argv[1]);
+ g_object_set (player, "cache-size", (gulong) cache_size * 1024,
+ "memory-until-gc", (gulong) garbage_size * 1024, NULL);
dsc.flags = DSDESC_CAPS;
dsc.caps = DSCAPS_DOUBLE | DSCAPS_PRIMARY;