DIRECTFB Learning Notes

Source: Internet
Author: User
Tags gtk
DIRECTFB Overview:

DIRECTFB is the graphical API that exists above the frame buffer layer and advanced graphics management such as GTK +. It provides graphics hardware acceleration with a small system resource footprint, providing advanced image operations such as the multi-channel a channel rendering model. It does not modify the Linux kernel, except that the standard C library has no dependencies on other libraries. It is applied in the development of DTV display system based on Linux system and other projects related to Linux display interface. Support the majority of the market display card, support keyboard, mouse, remote control, game handle, touch screen, such as input equipment. Supports JPEG, PNG, GIF, MPEG1/2, AVI, MOV, Flash, Video4linux, DirectFB bitmap font and TrueType audio and video files and fonts.

Upper API Support DIRECTFB are as follows:

XDIRECTFB, DIRECTFBGL, GTK +, Dfbterm, Dfbsee, Dfbpoint, MythTV, Qt on DIRECTFB, SDL (Simple DirectMedia Layer).

DIRECTFB operating system supported by official claim:

Linux, Freebsd/netbsd/openbsd, Mac OS X.

UCLinux, Celinux can find an incomplete transplant case.

Compare, compared to GTK +, Minigui, etc., DIRECTFB promotion did not do a good job, at least did not see the transplanted to the Windows Series platform Roadmap.

about DIRECTFB of the Layer problem

And Shikoko discussed the layer number of DPF system, summed up the number of layer support to rely on the chip and drive to achieve the common support. In the past, DTV system has several OSD layer, video layer, cursor layer and so on. Online Check the DIRECTFB can support the number of layer layer, found that for DIRECTFB layer has two levels of understanding:

1. As a hardware layer: the amount of layer in the hardware layer depends on the hardware resources of the chip. The Idirectfbdisplaylayer interface is used in DIRECTFB. Its contents are displayed directly on the screen.

2. As a software level: DIRECTFB does not have a dedicated interface, but can use the Idirectfbwindow interface to build their own layer structure. Use Idirectfbwindow->setopacity (Idirectfbwindow *thiz, __u8 opacity) to implement such a structure.

> Idirectfbwindow OSD <--highest window

> Idirectfbwindow video and Video Provider

> Idirectfbwindow Mpegstill

> Idirectfbwindow background with Image provider<--lowest window

By setting its opacity to implement 4 different layer on a hardware layer.

According to this implementation method, and DIRECTFB directly framebuffer memory mapping to application in the memory of the working principle, suddenly associated with the RAMDAC, guess we DPF may also have this device. Immediately after querying the relevant data of RAMDAC, the role of RAMDAC is to convert digital image data into computer display required analog data. The monitor received the analog model after RAMDAC processing. RAMDAC experienced a process of transition that separates the GPU--merging it into one chip--and placing it separately, mainly due to cost and performance considerations. Then check the DPF whether there are similar devices, did not find, forget.

DIRECTFB the installation process

1. Extract directfb-1.0.0.tar.gz Package

2. Enter this directory to perform

#./configure

# make

# make Install

Everything's fine.

DIRECTFB Sample the compilation

Take the official example to play first, the first time directly with #gcc Draw_linc.c–o draw, error, No such file or directory ' Directfb.h '

The workaround is to include the installation directory on DIRECTFB, # GCC–I/USR/LOCAL/DIRECTFB Draw_linc.c–o Draw

This is in link when the error, a lot of undefined reference to ' xxxx '

Fill up Lib directory, # GCC-L/USR/LOCAL/LIB-I/USR/LOCAL/INCLUDE/DIRECTFB Draw_line.c-o Draw

But found or error, according to the prompts, view the/usr/local/lib/pkgconfig directfb.pc file, found that there are compile parameter information

Prefix=/usr/local

Exec_prefix=${prefix}

Libdir=${exec_prefix}/lib

Includedir=${prefix}/include

Name:directfb

Description:graphics and Windowing Library for the Linux frame buffer device

version:1.0.0

Requires:fusion Direct

Libs:-l${libdir}-ldirectfb-lpthread-ldl-lz

Cflags:-D_REENTRANT-I${PREFIX}/INCLUDE/DIRECTFB

Obviously, we have to add parameters.

The solution is as follows, # Gcc-l/usr/local/lib-i/usr/local/include/directfb-ldirectfb-lpthread-ldl-lz Draw_line.c-o Draw

Compiled through.

Of course, the easiest way to do this is pkg-config, because the DIRECTFB is configured automatically when it is installed.

# gcc ' pkg-config--cflags--libs directfb ' Draw_line.c-o draw

Compiled through.

DIRECTFB Sample the running

Run directly./draw, when you open the framebuffer error.

Query result is framebuffer also need to configure.

Add vga=0x317 This parameter to the/BOOT/GRUB/MENU.LST.

After restarting, run again. The/draw,framebuffer error has been resolved, but there are no shared libraries issues to be found.

After adding # Export Ld_library_path=/usr/directfb25/lib, the file is returned to the state "/dev/fb0:no such file or directory" when the framebuffer error occurs. fainted. Monday continue to check the bottom of the framebuffer where there is a problem.

Thank God finally made the pass, really is the bottom framebuffer problem. The method is in/boot/grub/menu.lst kernel this line after adding vga=0x317,reboot, the splash screen appeared in two cute little penguins, this I am sure Framebuffer opened. Everything is OK after running the program.

But one thing to note is that after opening a new terminal, in order to run the DIRECTFB program, you must first set an environment variable, export ld_library_path=/usr/local/lib. Put this sentence in the/ROOT/.BASHRC, effective. Tomorrow's task is to load a picture out.

All OK, finished the remaining three after the sample, summed up, the official five sample provides the line, picture, painting text, pictures in accordance with the keyboard response to move up and down, the picture according to the keyboard response random move.

Sample in the creation of image objects are implemented with Createimageprovider, after the actual measurement, can support the image format: JPG, PNG, GIF, unsupported image format: BMP, TIF.

a new summary of DIRECTFB

After a lot of data verification, DIRECTFB is to framebuffer encapsulation, to provide a new, more powerful graphics API interface for the upper layer GTK +, QT and other calls. However, if you want to implement the effects of a drop-down menu, you must use the Advanced graphics library, such as GTK +, to invoke DIRECTFB to implement the control.

DIRECTFB of Learning

Today I Learn the global settings of DIRECFB:/ETC/DIRECTFBRC, Every DIRECTFB application'll read that setting file at f Irst. And the parameter shows below can also is transmitted by the prefix--DFB. behind.

I ' ve tried the parameters as below.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.