[Swfdec] Swfdec does not respond to key events
Helmut.Jahns at sennheiser.com
Helmut.Jahns at sennheiser.com
Mon Dec 1 09:38:34 PST 2008
Hi,
I'm using Swfdec 0.8.2 and cannot process any kepress events to Swfdec,
neither on GTK nor using Direct FB.
The initial screen is OK, but on pressing a key, swfdec_player_key_press()
is invoked providing the Swfdec key ID (with UCS4 key = 0). I noticed that
swfdec_dfb_player_handle_input_event() is called by swfdec_marshal,
therefore I assume that transmitting the key event message works fine, but
may be the way of setting up the player is wrong.
Do I need a special Function call for processing key events properly?
The setup of Swfdec is listed below.
Any help would be appreciated.
With kind regards,
Helmut Jahns
(void) setUpSwfdecPlayer:(NSString*)flashFileUr
{
unsigned int w, h;
IDirectFB* dfb;
DIRECTFB(DirectFBCreate,(&dfb));
DIRECTFB(dfb->SetCooperativeLevel,(dfb, DFSCL_EXCLUSIVE));
IDirectFBSurface* surface;
DFBSurfaceDescription surface_description = {
.flags = DSDESC_CAPS,
.caps = DSCAPS_PRIMARY,
};
DIRECTFB(dfb->CreateSurface,(dfb, &surface_description, &surface));
DIRECTFB(surface->GetSize,(surface,(int*)&w,(int*)&h));
fprintf(stderr, "DirectFB: width=%u, height=%u\n", w, h);
DIRECTFB(surface->Clear,(surface,0,0,0,0xff));
DIRECTFB(surface->Flip,(surface,NULL,DSFLIP_NONE));
ioctl(devfb, FBIOBLANK, 0);
// create Cairo and link it to Direct FB surface
cairo_surface_t* cairo_surface
= cairo_directfb_surface_create(dfb, surface);
cr = cairo_create(cairo_surface);
cairo_set_tolerance(cr, 1);
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
cairo_set_source_rgba(cr, 0, 0, 0, 1);
cairo_paint(cr);
ioctl(devfb, FBIOBLANK, 0);
// create player - swfdec_player_init() is executed implicitely
my_player = swfdec_player_new(NULL); // 0: no AS debugger
// set file to playback
SwfdecURL* flash_file_location =
swfdec_url_new_from_input ([flashFileUrl cString]);
swfdec_player_set_url(my_player, flash_file_location);
swfdec_url_free (flash_file_location);
// provide renderer to the player
SwfdecRenderer* my_renderer =
swfdec_renderer_new_for_player (cairo_surface, my_player);
swfdec_player_set_renderer (my_player, my_renderer);
// initial drawing
int i;
for (i=0; i<3; i++ )
{
swfdec_player_advance(my_player, 100);
swfdec_player_render(my_player, cr);
ioctl(devfb, FBIOBLANK, 0);
}
// TODO: remove this. This loop has been introduced due to
// a delay of the special swf file to permit to draw
// the menu icons.
}
Sennheiser electronic GmbH & Co.KG, Sitz: Wedemark, Handelsregister: AG
Hannover HRA 120100, Aufsichtsratsvorsitzender: Prof. Dr. sc. techn. Jörg
Sennheiser phG:
Sennheiser Beteiligungsgesellschaft mbH, Sitz: Wedemark, Handelsregister:
AG Hannover HRB 120179, Geschäftsführer: Volker Bartels, Dr. Heinrich
Esser, Stefan Junker
Diese E-Mail enthält vertrauliche oder rechtlich geschützte Informationen.
Wenn Sie nicht der beabsichtigte Empfänger sind, informieren Sie bitte
sofort den Absender
und löschen Sie diese E-Mail. Das unbefugte Kopieren dieser E-Mail oder die
unbefugte Weitergabe der enthaltenen Informationen ist nicht gestattet.
The information contained in this message is confidential or protected by
law. If you are not the intended recipient, please contact the sender
and delete this message. Any unauthorized copying of this message or
unauthorized distribution of the information contained herein is
prohibited.
More information about the Swfdec
mailing list