Resource Management

System resources are limited in an embedded environment. Since users can run multiple applications concurrently in a multitasking environment, it isn't always possible to satisfy all of the resourcing needs of all applications simultaneously.

For this reason, system resources may be revoked from a running application when they are needed elsewhere. At any point in time, it's possible that the resources used by the camera are required by a higher priority application.

Since there's no way to prevent an application from storing references to allocated buffers, your application should call the camera_register_resource() function to request that the operating system temporarily defer the unmapping of buffer memory. After your application is registered, whenever resources are needed elsewhere by higher priority applications, your application should receive a CAMERA_STATUS_RESOURCENOTAVAIL status event. When your application receives this status event, your camera application should immediately cease processing all buffers and call the camera_deregister_resource() function to let the operating system know that it can proceed to unmap allocated buffer memory. A timeout is in place that limits the amount of time your application has before resources will be forcefully revoked. For this reason, it is important that your application respond as soon as possible after receiving the CAMERA_STATUS_RESOURCENOTAVAIL status event.

See camera_register_resource() and camera_deregister_resource() for further information.