[Swfdec] screenshot of swf file

Paul Brooker paul at thefunnyfish.net
Sun Jan 17 13:30:07 PST 2010


Hi,
Im trying to thumbnail a swf file based on this found at 
http://www.mail-archive.com/swfdec@lists.freedesktop.org/msg00821.html.

#include <stdlib.h>
#include <stdio.h>
#include <swfdec/swfdec.h>
#include <cairo.h>

void swfdec_player_save (SwfdecPlayer *player, guint width, guint 
height, const char *filename) {
     cairo_surface_t *surface;
     cairo_t *cr;
     surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, 
height);
     cr = cairo_create (surface);
     swfdec_player_render (player, cr);
     cairo_destroy (cr);
     cairo_surface_write_to_png (surface, filename);
     cairo_surface_destroy (surface);
}

int main(int argc, char *argv[]) {
     char *input = argv[1];
     char *output = argv[2];
     SwfdecPlayer *player = swfdec_player_new(NULL);
     SwfdecURL *url = swfdec_url_new_from_input(input);
     swfdec_player_set_url(player, url);
     swfdec_url_free (url);
     swfdec_player_set_size (player, 800, 480);
     swfdec_player_advance(player, swfdec_player_get_next_event (player));
     swfdec_player_save(player, 800, 480, output);
     return 0;
}

Using this i get a blank transparent png output as reported by the 
original poster.  Ive also tried the gnome thumbnailer which produces 
the same result. The swf file is a single frame containing just two 
boxes. I cant see anything unusual from any of the debugging output.  Im 
not sure where to look for the problem. Im running it on an ARM board 
and using swfdec version 0.8.4. Any help would be much appreciated.

Thanks in advance,
Paul Brooker


More information about the Swfdec mailing list