09.11.2012 Views

Contents - Raspberry PI Community Projects

Contents - Raspberry PI Community Projects

Contents - Raspberry PI Community Projects

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

documentation is contained within comments in the header files, as well as<br />

documentation for the OpenMAX IL components in the documentation directory on<br />

Github (https://github.com/raspberrypi/firmware/tree/master/documentation/<br />

ilcomponents) , however it is severely lacking and difficult to understand in a general<br />

sense for people wanting to experiment with the device due to it being proprietary. As<br />

such, we encourage you to edit this page (http://elinux.org/<br />

index.php?title=RPi_VideoCore_A<strong>PI</strong>s&action=edit) to help us build a much better open<br />

documentation.<br />

Quirks<br />

▪ The <strong>Raspberry</strong> Pi requires that the bcm_host_init() function is called first<br />

before any GPU calls can be made.<br />

▪ Before calling any of the vc_* functions, you need to initialise vcos and vchi, and<br />

make a vchi connection, before then calling the corresponding vc_*_init function<br />

for the part of the library you want to use: vc_vchi_dispmanx_init,<br />

vc_vchi_tv_init, vc_vchi_cec_init or vc_vchi_gencmd_init.<br />

(See this sample code (https://github.com/adammw/rpi-output-swapper/blob/<br />

master/video_swap.c#L152-169) which does initialisation for vc_tvservice_*<br />

A<strong>PI</strong>s)<br />

▪ Linking against the EGL library (-lEGL) also requires you to link against the<br />

GLESv2 library (-lGLESv2).<br />

▪ graphics_get_display_size() is a broadcom-specific function<br />

Built-in Sample Programs<br />

The <strong>Raspberry</strong> Pi comes with 7 sample programs and two helper libraries in the /opt/vc/<br />

src/hello_pi directory showing some of the system's capabilities and sample code.<br />

hello_video<br />

This sample decodes h264 video using the OpenMAX A<strong>PI</strong>s and the ilclient library, and is<br />

distributed with a short scene of Big Buck Bunny (http://www.bigbuckbunny.org/)<br />

hello_audio<br />

This sample plays a sine wave for ten seconds using the ??? A<strong>PI</strong>s.<br />

hello_triangle<br />

This sample shows how to get a OpenGL ES context on the <strong>Raspberry</strong> Pi.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!