Example #1
0
// this function run the boilerplate to setup the openmax components;
int
setupOpenMaxJpegDecoder(OPENMAX_JPEG_DECODER ** pDecoder)
{
    *pDecoder = malloc(sizeof(OPENMAX_JPEG_DECODER));
    if (pDecoder[0] == NULL) {
	perror("malloc decoder");
	return OMXJPEG_ERROR_MEMORY;
    }
    memset(*pDecoder, 0, sizeof(OPENMAX_JPEG_DECODER));

    if ((pDecoder[0]->client = ilclient_init()) == NULL) {
	perror("ilclient_init");
	return OMXJPEG_ERROR_ILCLIENT_INIT;
    }

    if (OMX_Init() != OMX_ErrorNone) {
	ilclient_destroy(pDecoder[0]->client);
	perror("OMX_Init");
	return OMXJPEG_ERROR_OMX_INIT;
    }
    // prepare the image decoder
    int             ret = prepareImageDecoder(pDecoder[0]);
    if (ret != OMXJPEG_OK)
	return ret;

    ret = prepareResizer(pDecoder[0]);
    if (ret != OMXJPEG_OK)
	return ret;

    ret = startupImageDecoder(pDecoder[0]);
    if (ret != OMXJPEG_OK)
	return ret;

    return OMXJPEG_OK;
}
Example #2
0
int omxResize(ILCLIENT_T *client, IMAGE *inImage, IMAGE *outImage){
	OMX_RESIZER resizer;
	resizer.client=client;
	resizer.pInputBufferHeader=NULL;
	int ret = prepareResizer(&resizer);
	if (ret != OMX_IMAGE_OK){
		return ret;
	}
	ret = startupResizer(&resizer, inImage);
	if (ret != OMX_IMAGE_OK){
		return ret;
	}
	ret = doResize(&resizer, inImage, outImage);
	if (ret != OMX_IMAGE_OK){
		return ret;
	}
	
	COMPONENT_T *list[2];
	list[0]=resizer.component;
	list[1]=NULL;
	ilclient_cleanup_components(list);
	return ret;
}