When I notice that "./configure --enable-multi" can support
multi-application core (default = no), I reconfigure to install
DirectFB again in order to support multi-application.
Unfortunately, "video_surface.c", the attachment uploaded, give a
error like that "Caught signal 11 (at 0x2c, invalid address)
Direct/Thread: Killing 'Fusion Dispatch' (3702)".
However, without enable-multi, "video_surface.c", I wrote, was able to
play video happly.
What's more, the example "df_video_particle.c" under
"DirectFB-example/src/" met the same error with the "enable-multi",
but such as "df_window.c", "df_video.c" never give such error.
My sincere thanks go to someone give some advice to the confused boy^_^
--
An individual human existence should be like a river - small at first,
narrowly contained within its banks, and rushing passionately past
boulders and over waterfalls. Gradually the river grows wider, the
banks recede, the waters flow more quietly, and in the end, without
any visible break, they become merged in the sea, and painlessly lose
their individual being.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <directfb.h>
#define DFBCHECK( x... ) \
{\
int err = x;\
if (err != DFB_OK) {\
fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ );\
DirectFBErrorFatal( #x, err );\
}\
}
int
main(int argc, char *argv[])
{
IDirectFB *dfb;
IDirectFBSurface *surface;
IDirectFBVideoProvider *provider;
DFBSurfaceDescription surface_desc;
DFBRectangle rect;
double ret_seconds;
if (argc < 2) {
printf("Usage: <video / audio file>\n");
exit(-1);
}
DFBCHECK(DirectFBInit(&argc, &argv));
DFBCHECK(DirectFBCreate(&dfb));
surface_desc.flags = DSDESC_CAPS;
surface_desc.caps = DSCAPS_PRIMARY;
DFBCHECK(dfb->CreateSurface(dfb, &surface_desc, &surface));
DFBCHECK(dfb->CreateVideoProvider(dfb, argv[1], &provider));
DFBCHECK(provider->GetSurfaceDescription(provider, &surface_desc));
rect.x = 0;
rect.y = 0;
rect.w = surface_desc.width;
rect.h = surface_desc.height;
DFBCHECK(provider->PlayTo(provider, surface, &rect, NULL, NULL));
ret_seconds = provider->GetLength(provider, &ret_seconds);
sleep(ret_seconds);
if (provider)
provider->Release(provider);
if (surface)
surface->Release(surface);
if (dfb)
dfb->Release(dfb);
return 1;
}
_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users