The Multi-Media Abstraction Layer (MMAL) library provided by Broadcom is not documented, so it's nearly impossible to understand how to use it. Furthermore, it's a library that wraps all the OpenMAX IL specification, so if you simply need to capture a JPEG image like in this example, you can just ignore that extra layer and talk directly to OpenMAX IL. Once you understand OpenMAX IL, it's affordable to try to write your own programs without MMAL. In other words, if you are new to the OpenMAX world, it's better to learn OpenMAX IL than MMAL, which is not documented and only works with Broadcom devices.
This example captures an image in a JPEG format. The components involved are: camera
and image_encode
. The image_write
component doesn't work correctly or I don't understand how to use it. I always get the error OMX_ErrorInsufficientResources
when I change the image_write
state from LOADED to IDLE.
Build steps:
- Download and install the
gcc
andmake
programs. - Download this repository.
- Compile and execute:
make && ./jpeg
Useful documentation: