Dear All,

My name is Amaresh. I am working as a junior engineer in Altech UEC on STB
domain from past 6 months. I am very much interested to learn directfb.

I have installed directfb library on my virtual machine fedora 12.

I am trying to load sample png image and display it.

i got the following code from the net sample2.c

#include <directfb.h>
#include <unistd.h>

IDirectFB               *dfb;
IDirectFBSurface        *primary;
IDirectFBImageProvider  *provider;

DFBSurfaceDescription    dsc;

int main(int argc, char *argv[])
{
        DirectFBInit(&argc, &argv);
        DirectFBCreate(&dfb);

        dfb->SetCooperativeLevel(dfb, DFSCL_FULLSCREEN);

  /* Primary */
        memset(&dsc, 0, sizeof(DFBSurfaceDescription));
        dsc.flags = DSDESC_CAPS;
        dsc.caps = DSCAPS_PRIMARY;
        dfb->CreateSurface(dfb, &dsc, &primary);

  /* Background */

        dfb->CreateImageProvider(dfb, "/home/amaresh/hello/sample.png",
&provider);
        provider->RenderTo(provider, primary, NULL);
        provider->Release(provider);

        sleep(5);

        primary->Release(primary);
        dfb->Release(dfb);
        return 0;
}

i have compiled using below command

# cc sample2.c -I /usr/include/directfb/ /usr/local/lib/libdirectfb-1.7.so.0

# ./a.out

   ~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.7.0 |~~~~~~~~~~~~~~~~~~~~~~~~~~
        (c) 2001-2012  The world wide DirectFB Open Source Community
        (c) 2000-2004  Convergence (integrated media) GmbH
      ----------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2012-07-20 14:33)
(*) Direct/Thread: Started 'Fusion Dispatch' (1928) [MESSAGING OTHER/OTHER
0/0] <10485760>...
(*) Direct/Thread: Started 'VT Switcher' (1931) [CRITICAL OTHER/OTHER 0/0]
<10485760>...
(*) Direct/Thread: Started 'VT Flusher' (1932) [DEFAULT OTHER/OTHER 0/0]
<10485760>...
(*) DirectFB/FBDev: Found 'VESA VGA' (ID 0) with frame buffer at
0xd0000000, 3600k (MMIO 0x00000000, 0k)
(*) Direct/Thread: Started 'Linux Input' (1933) [INPUT OTHER/OTHER 0/0]
<10485760>...
(*) DirectFB/Input: Power Button (1) 0.1 (directfb.org)
(*) Direct/Thread: Started 'Linux Input' (1934) [INPUT OTHER/OTHER 0/0]
<10485760>...
(*) DirectFB/Input: Macintosh mouse button emulatio (2) 0.1 (directfb.org)
(*) Direct/Thread: Started 'Linux Input' (1935) [INPUT OTHER/OTHER 0/0]
<10485760>...
(*) DirectFB/Input: AT Translated Set 2 keyboard (3) 0.1 (directfb.org)
(*) Direct/Thread: Started 'Linux Input' (1936) [INPUT OTHER/OTHER 0/0]
<10485760>...
(*) DirectFB/Input: ImPS/2 Generic Wheel Mouse (4) 0.1 (directfb.org)
(*) Direct/Thread: Started 'Hotplug with Linux Input' (1937) [INPUT
OTHER/OTHER 0/0] <10485760>...
(*) DirectFB/Input: Hot-plug detection enabled with Linux Input Driver
(*) Direct/Thread: Started 'PS/2 Input' (1938) [INPUT OTHER/OTHER 0/0]
<10485760>...
(*) DirectFB/Input: IMPS/2 Mouse 1.0 (directfb.org)
(*) DirectFB/Input: Hot-plug detection enabled with Input Hub Driver
(*) Direct/Thread: Started 'Keyboard Input' (1939) [INPUT OTHER/OTHER 0/0]
<10485760>...
(*) DirectFB/Input: Keyboard 0.9 (directfb.org)
(*) DirectFB/Genefx: MMX detected and enabled
(*) DirectFB/Graphics: MMX Software Rasterizer 0.7 (directfb.org)
(*) DirectFB/Core/WM: Default 0.3 (directfb.org)
(*) FBDev/Mode: Setting 1280x720 RGB16
(*) FBDev/Mode: Switched to 1280x720 (virtual 1280x720) at 16 bit (RGB16),
pitch 2560
(*) FBDev/Mode: Setting 1280x720 RGB16
(*) FBDev/Mode: Switched to 1280x720 (virtual 1280x720) at 16 bit (RGB16),
pitch 2560
Segmentation fault (core dumped)

I am getting segmentation fault while running .exe file.

First three times it ran successfully and displayed the image.

Could you guys help me please ?

If you guys have a any documents on directfb, please send me.

Thanks in advance

Regards,
Amaresh
_______________________________________________
directfb-users mailing list
directfb-users@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to