thanks for your quick response ! I am using curl as my net lib and will try it . <br><br><div class="gmail_quote">On Mon, Apr 26, 2010 at 4:44 AM, Benjamin Otte <span dir="ltr"><<a href="mailto:otte@gnome.org">otte@gnome.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Your SwfdecPlayer subclass needs to use a SwfdecLoader that can parse<br>
HTTP urls. The default implementation can only open file:// urls.<br>
But the code in swfdec-gtk/swfdec_gtk_loader.c contains an<br>
implementation that uses GNOME's libsoup for this purpose. You can<br>
cut'n'paste this code if you want. It doesn't use gtk, but it does use<br>
libsoup. Or you can write your own using any HTTP library that you<br>
want.<br>
<br>
Benjamin<br>
<div><div></div><div class="h5"><br>
<br>
On Mon, Apr 26, 2010 at 10:04 AM, myopc myopc <<a href="mailto:myopc.hi@gmail.com">myopc.hi@gmail.com</a>> wrote:<br>
> hi,all<br>
> anyone know how to make a swf player without gtk ? I have written one<br>
> but it can parse only simple files, url like 'http://..." fails (but the gtk<br>
> sample can do) ?<br>
> My code is like this:<br>
><br>
> swfdec_player_set_url(player, url);<br>
> swfdec_url_free(url);<br>
> while (!swfdec_player_is_initialized(player)) {<br>
> glong next;<br>
> next = swfdec_player_get_next_event(player);<br>
> LOGD("parser header ... %d", next);<br>
> if (next < 0) { //????<br>
> //LOGE("swfdec_player_get_next_event: no evt");<br>
> return 1;<br>
> }<br>
> swfdec_player_advance(player, next);<br>
> }<br>
> swfdec_player_get_default_size(player, &width, &height);<br>
> LOGI("w/h: %u/%u, backgroud color: %u, rate: %f",<br>
> width,height,<br>
> swfdec_player_get_background_color(player),<br>
> swfdec_player_get_rate(player));<br>
><br>
> bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height, 0);<br>
> mysurface = cairo_image_surface_create_for_data(<br>
> (unsigned char*) bitmap.getPixels(), CAIRO_FORMAT_ARGB32, width,<br>
> height, bitmap.rowBytes());<br>
> cr = cairo_create(mysurface);<br>
> ren = swfdec_renderer_new_for_player(mysurface, player);<br>
> swfdec_player_set_renderer(player, ren);<br>
> cairo_surface_destroy(mysurface);<br>
> cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);<br>
> cairo_set_tolerance(cr, 0.50);<br>
> time_t now = time(0);<br>
> while (1) {<br>
> if (time(0) - now >= 10)<br>
> break;<br>
> //sleep(1); // dummy loop<br>
> //LOGD("do frame");<br>
> swfdec_player_advance(player, 100);<br>
> swfdec_player_render(player, cr);<br>
> }<br>
><br>
> swfdec_player_get_next_event will return 0/-1 when urls like 'http://...',<br>
> I dont know what to do with this.<br>
> any comment will be appreciated, thanks !<br>
><br>
><br>
> --<br>
> Best Regards.<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Swfdec mailing list<br>
> <a href="mailto:Swfdec@lists.freedesktop.org">Swfdec@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/swfdec" target="_blank">http://lists.freedesktop.org/mailman/listinfo/swfdec</a><br>
><br>
><br>
</blockquote></div><br><br clear="all"><br>-- <br><br>--<br>Best Regards.<br><br>