![]() |
Synergy Software Package User's Manual
|
RTOS-integrated JPEG Framework. More...
Data Structures | |
| struct | sf_jpeg_decode_instance_ctrl_t |
Macros | |
| #define | SF_JPEG_DECODE_CODE_VERSION_MAJOR (2U) |
| #define | SF_JPEG_DECODE_OPEN (0x4A504547U) |
| #define | SF_JPEG_ERROR_RETURN(a, err) SSP_ERROR_RETURN((a), (err), &g_module_name[0], &s_sf_jpeg_version) |
Functions | |
| ssp_err_t | sf_jpeg_initialize (sf_jpeg_decode_instance_ctrl_t *const p_ctrl, sf_jpeg_decode_cfg_t const *const p_cfg) |
| Acquires mutex, then handles driver initialization at the HAL layer. This function releases the mutex before returns to the caller. More... | |
| ssp_err_t | SF_JPEG_Decode_Open (sf_jpeg_decode_ctrl_t *const p_api_ctrl, sf_jpeg_decode_cfg_t const *const p_cfg) |
| Parameter checking and initialize JPEG decode with sf_jpeg_initialize helper function and marking the open flag in control block. More... | |
| ssp_err_t | SF_JPEG_Decode_InputBufferSet (sf_jpeg_decode_ctrl_t *const p_api_ctrl, void *const p_buffer, uint32_t const buffer_size) |
| Configures JPEG coded input data. More... | |
| ssp_err_t | SF_JPEG_Decode_LinesDecodedGet (sf_jpeg_decode_ctrl_t *const p_api_ctrl, uint32_t *const p_lines) |
| Obtain number of lines decoded by the codec. More... | |
| ssp_err_t | SF_JPEG_Decode_HorizontalStrideSet (sf_jpeg_decode_ctrl_t *const p_api_ctrl, uint32_t horizontal_stride) |
| Configure the horizontal stride value. More... | |
| ssp_err_t | SF_JPEG_Decode_ImageSubsampleSet (sf_jpeg_decode_ctrl_t *const p_api_ctrl, jpeg_decode_subsample_t horizontal_subsample, jpeg_decode_subsample_t vertical_subsample) |
| Configure the horizontal and vertical subsample values. This allows an application to reduce the size of the decoded image at runtime. More... | |
| ssp_err_t | SF_JPEG_Decode_OutputBufferSet (sf_jpeg_decode_ctrl_t *const p_api_ctrl, void *p_buffer, uint32_t buffer_size) |
| Configure the decode output buffer. More... | |
| ssp_err_t | SF_JPEG_Decode_Wait (sf_jpeg_decode_ctrl_t *const p_api_ctrl, jpeg_decode_status_t *const p_status, uint32_t timeout) |
| Wait for current JPEG codec operation to finish. More... | |
| ssp_err_t | SF_JPEG_Decode_StatusGet (sf_jpeg_decode_ctrl_t *const p_api_ctrl, jpeg_decode_status_t *const p_status) |
| Obtain JPEG codec status. This function can be used to poll the device instead of using SF_JPEG_Decode_Wait() to block on JPEG operations. More... | |
| ssp_err_t | SF_JPEG_Decode_PixelFormatGet (sf_jpeg_decode_ctrl_t *const p_api_ctrl, jpeg_decode_color_space_t *const p_color_space) |
| Obtain the format of the image. This function is only useful for decoding a JPEG image. More... | |
| ssp_err_t | SF_JPEG_Decode_ImageSizeGet (sf_jpeg_decode_ctrl_t *const p_api_ctrl, uint16_t *p_horizontal_size, uint16_t *p_vertical_size) |
| Obtain the size of the image. This function is only useful for decoding a JPEG image. More... | |
| ssp_err_t | SF_JPEG_Decode_Close (sf_jpeg_decode_ctrl_t *const p_api_ctrl) |
| Close JPEG codec device. Un-finished codec operation is interrupted, and output data are discarded. More... | |
| ssp_err_t | SF_JPEG_Decode_VersionGet (ssp_version_t *const p_version) |
| Get version and store it in provided pointer p_version. More... | |
RTOS-integrated JPEG Framework.
| #define SF_JPEG_DECODE_CODE_VERSION_MAJOR (2U) |
Version of code that implements the API defined in this file
| #define SF_JPEG_DECODE_OPEN (0x4A504547U) |
"JPEG" in ASCII, used to identify general JPEG control block
| #define SF_JPEG_ERROR_RETURN | ( | a, | |
| err | |||
| ) | SSP_ERROR_RETURN((a), (err), &g_module_name[0], &s_sf_jpeg_version) |
Macro for error logger.
| ssp_err_t SF_JPEG_Decode_Close | ( | sf_jpeg_decode_ctrl_t *const | p_api_ctrl | ) |
Close JPEG codec device. Un-finished codec operation is interrupted, and output data are discarded.
| SSP_SUCCESS | The JPEG decode device is successfully closed. |
| SSP_ERR_ASSERTION | p_ctrl is null. |
| SSP_ERR_NOT_OPEN | JPEG Decode Framework module is not yet initialized. |
Call the low level driver to close the JPEG device.
Clear information from control block so other functions know this block is closed
| ssp_err_t SF_JPEG_Decode_HorizontalStrideSet | ( | sf_jpeg_decode_ctrl_t *const | p_api_ctrl, |
| uint32_t | horizontal_stride | ||
| ) |
Configure the horizontal stride value.
| SSP_SUCCESS | Horizontal Stride value is successfully configured. |
| SSP_ERR_ASSERTION | p_ctrl is null. |
| SSP_ERR_NOT_OPEN | JPEG Decode Framework module is not yet initialized. |
| SSP_ERR_IN_USE | The mutex may be unavailable for the the device. See HAL driver for other possible causes. |
Obtain mutex before making HAL-level driver call.
| ssp_err_t SF_JPEG_Decode_ImageSizeGet | ( | sf_jpeg_decode_ctrl_t *const | p_api_ctrl, |
| uint16_t * | p_horizontal_size, | ||
| uint16_t * | p_vertical_size | ||
| ) |
Obtain the size of the image. This function is only useful for decoding a JPEG image.
| SSP_SUCCESS | The JPEG image size is obtained. |
| SSP_ERR_ASSERTION | p_ctrl is null. |
| SSP_ERR_NOT_OPEN | JPEG Decode Framework module is not yet initialized. |
| SSP_ERR_IN_USE | The mutex may be unavailable for the the device. See HAL driver for other possible causes. |
Obtain mutex before making HAL-level driver call.
| ssp_err_t SF_JPEG_Decode_ImageSubsampleSet | ( | sf_jpeg_decode_ctrl_t *const | p_api_ctrl, |
| jpeg_decode_subsample_t | horizontal_subsample, | ||
| jpeg_decode_subsample_t | vertical_subsample | ||
| ) |
Configure the horizontal and vertical subsample values. This allows an application to reduce the size of the decoded image at runtime.
| SSP_SUCCESS | Image subsample values are successfully configured. |
| SSP_ERR_ASSERTION | p_ctrl is null. |
| SSP_ERR_NOT_OPEN | JPEG Decode Framework module is not yet initialized. |
| SSP_ERR_IN_USE | The mutex may be unavailable for the the device. See HAL driver for other possible causes. |
Obtain mutex before making HAL-level driver call.
| ssp_err_t SF_JPEG_Decode_InputBufferSet | ( | sf_jpeg_decode_ctrl_t *const | p_api_ctrl, |
| void *const | p_buffer, | ||
| uint32_t const | buffer_size | ||
| ) |
Configures JPEG coded input data.
This API configures the decode input buffer address register. After the input buffer address is set, the driver checks whether the output buffer address is set, and verifies that the output buffer size is large enough to hold at least eight output lines of data. If both the input buffer and output buffer are set properly, the driver automatically starts the decode process.
| SSP_SUCCESS | Decode input buffer is successfully configured. |
| SSP_ERR_ASSERTION | p_ctrl is null. |
| SSP_ERR_NOT_OPEN | JPEG Decode Framework module is not yet initialized. |
| SSP_ERR_IN_USE | The mutex may be unavailable for the the device. See HAL driver for other possible causes. |
Obtain mutex before making HAL-level driver call.
Call the HAL driver layer inputBufferSet routine.
| ssp_err_t SF_JPEG_Decode_LinesDecodedGet | ( | sf_jpeg_decode_ctrl_t *const | p_api_ctrl, |
| uint32_t *const | p_lines | ||
| ) |
Obtain number of lines decoded by the codec.
| SSP_SUCCESS | Lines decoded value is successfully obtained. |
| SSP_ERR_ASSERTION | p_ctrl is null. |
| SSP_ERR_NOT_OPEN | JPEG Decode Framework module is not yet initialized. |
| SSP_ERR_IN_USE | The mutex may be unavailable for the the device. See HAL driver for other possible causes. |
Obtain mutex before making HAL-level driver call.
| ssp_err_t SF_JPEG_Decode_Open | ( | sf_jpeg_decode_ctrl_t *const | p_api_ctrl, |
| sf_jpeg_decode_cfg_t const *const | p_cfg | ||
| ) |
Parameter checking and initialize JPEG decode with sf_jpeg_initialize helper function and marking the open flag in control block.
| SSP_SUCCESS | JPEG Decode framework is successfully opened. |
| SSP_ERR_ASSERTION | One of the following parameters may be null: p_ctrl or p_cfg. |
| SSP_ERR_ALREADY_OPEN | JPEG Decode framework is already open. |
Initialize the JPEG framework
Save driver structure pointer for use in other framework layer functions.
Mark control block open so subsequent calls know the device is open.
| ssp_err_t SF_JPEG_Decode_OutputBufferSet | ( | sf_jpeg_decode_ctrl_t *const | p_api_ctrl, |
| void * | p_buffer, | ||
| uint32_t | buffer_size | ||
| ) |
Configure the decode output buffer.
This API configures the decode output buffer address register. After the output buffer address is set, the driver computers the number of output lines the buffer is able to hold. The hardware requires the number out output lines to decode at a time is multiple of eight. If both the input buffer and output buffer are set properly, the driver automatically starts the decode process.
| SSP_SUCCESS | Output buffer is successfully configured. |
| SSP_ERR_ASSERTION | p_ctrl is null. |
| SSP_ERR_NOT_OPEN | JPEG Decode Framework module is not yet initialized. |
| SSP_ERR_IN_USE | The mutex may be unavailable for the the device. See HAL driver for other possible causes. |
Obtain mutex before making HAL-level driver call.
| ssp_err_t SF_JPEG_Decode_PixelFormatGet | ( | sf_jpeg_decode_ctrl_t *const | p_api_ctrl, |
| jpeg_decode_color_space_t *const | p_color_space | ||
| ) |
Obtain the format of the image. This function is only useful for decoding a JPEG image.
| SSP_SUCCESS | The JPEG image size is obtained. |
| SSP_ERR_ASSERTION | p_ctrl is null. |
| SSP_ERR_NOT_OPEN | JPEG Decode Framework module is not yet initialized. |
| SSP_ERR_IN_USE | The mutex may be unavailable for the the device. See HAL driver for other possible causes. |
Obtain mutex before making HAL-level driver call.
| ssp_err_t SF_JPEG_Decode_StatusGet | ( | sf_jpeg_decode_ctrl_t *const | p_api_ctrl, |
| jpeg_decode_status_t *const | p_status | ||
| ) |
Obtain JPEG codec status. This function can be used to poll the device instead of using SF_JPEG_Decode_Wait() to block on JPEG operations.
| SSP_SUCCESS | The JPEG status information is obtained. |
| SSP_ERR_ASSERTION | p_ctrl is null. |
| SSP_ERR_NOT_OPEN | JPEG Decode Framework module is not yet initialized. |
| SSP_ERR_IN_USE | The mutex may be unavailable for the the device. See HAL driver for other possible causes. |
Obtain mutex before making HAL-level driver call.
| ssp_err_t SF_JPEG_Decode_VersionGet | ( | ssp_version_t *const | p_version | ) |
Get version and store it in provided pointer p_version.
| SSP_SUCCESS | Version returned successfully. |
| SSP_ERR_ASSERTION | Parameter p_version is null. |
| ssp_err_t SF_JPEG_Decode_Wait | ( | sf_jpeg_decode_ctrl_t *const | p_api_ctrl, |
| jpeg_decode_status_t *const | p_status, | ||
| uint32_t | timeout | ||
| ) |
Wait for current JPEG codec operation to finish.
| SSP_SUCCESS | The wait function returns successfully. |
| SSP_ERR_ASSERTION | p_ctrl or p_status is null. |
| SSP_ERR_NOT_OPEN | JPEG Decode Framework module is not yet initialized. |
| SSP_ERR_TIMEOUT | The wait operation timed out, the underlying driver did not response in time. |
| SSP_ERR_WAIT_ABORTED | System internal error occurred. |
Obtain mutex before making HAL-level driver call.
| ssp_err_t sf_jpeg_initialize | ( | sf_jpeg_decode_instance_ctrl_t *const | p_ctrl, |
| sf_jpeg_decode_cfg_t const *const | p_cfg | ||
| ) |
Acquires mutex, then handles driver initialization at the HAL layer. This function releases the mutex before returns to the caller.
| [in,out] | p_ctrl | Control handle for JPEG framework context for a device. |
| [in] | p_cfg | Pointer to JPEG framework Configuration Structure. |
| SSP_SUCCESS | JPEG Decode driver is successfully opened. |
| SSP_ERR_INTERNAL | An internal ThreadX error has occurred. |
Create event flags for use with wait function
Create the mutex for this instance, this mutex is used to protect access to lower level hardware
Duplicate the content of p_cfg.
Install framework callback and context.
Call the low level driver to configure the JPEG device.
If the operation failed, delete the resources.