Hi All,
I would ask some idea about what could prevent Ienc1_create to create a jpeg encoder. Is there some restriction on the image size? (720x576 in my case). Looking at the output I can see that the "jpegenc" algorithm should be available so I don't understand the reason why the encoder is not created.
Here the code:
CaptureEnv *envp = (CaptureEnv *) arg;
Void *threadstatus = THREAD_SUCCESS;
IMGENC1_Params params = Ienc1_Params_DEFAULT;
IMGENC1_DynamicParams dynParams = Ienc1_DynamicParams_DEFAULT;
Engine_Handle hEngine = NULL;
IMGENC1_Handle hImgencPtr;
//Ienc_Handle hIe = NULL;
Ienc1_Handle hImgEnc = NULL;
int status;
int bufId, chId;
MCVIP_BufInfo *pBuf;
char algName[20];
....
params.maxWidth = gCAPTURE_ctrl.reszPrm.inWidth;
params.maxHeight = gCAPTURE_ctrl.reszPrm.inHeight;
params.size = sizeof(IMGENC1_Params);
params.maxScans = 1;
params.dataEndianness = XDM_BYTE;
params.forceChromaFormat = XDM_YUV_422ILE;
dynParams.inputWidth = params.maxWidth;
dynParams.inputHeight = params.maxHeight;
hEngine = Engine_open(envp->engineName, NULL, NULL);
fprintf(stdout,"Engine name: %s\n", envp->engineName);
if (hEngine == NULL) {
ERR("Failed to open codec engine %s\n", envp->engineName);
cleanup(THREAD_FAILURE);
}
hImgEnc = Ienc1_create(hEngine, algName, ¶ms, &dynParams);
if (hImgEnc == NULL) {
ERR("Failed to create image encoder: %s\n", algName);
Int numAlgs, i;
char name[30];
Engine_AlgInfo algInfo;
algInfo.algInfoSize=sizeof(Engine_AlgInfo);
Engine_Error err;
err = Engine_getNumAlgs(envp->engineName, &numAlgs);
printf("Use one of the following %d Algorithms: \n", numAlgs);
for (i = 0; i < numAlgs; i++) {
err = Engine_getAlgInfo(envp->engineName, &algInfo, i);
printf("alg[%d]: name = %s typeTab = %s local = %d\n", i, algInfo.name, *(algInfo.typeTab), algInfo.isLocal);
}
cleanup(THREAD_FAILURE);
}
And this the OUTPUT screen: as you can see jpegenc is available on the codec engine...
Engine name: encode
Avg Time (msecs) for Capture: 6.0, Demux: 6.0, DMA: 4.0 (1 frames)
Error: Failed to create image encoder: jpegenc
Use one of the following 5 Algorithms:
alg[0]: name = mpeg4enc typeTab = ti.sdo.ce.video1.IVIDENC1 local = 1
alg[1]: name = h264enc typeTab = ti.sdo.ce.video1.IVIDENC1 local = 1
alg[2]: name = g711enc typeTab = ti.sdo.ce.speech1.ISPHENC1 local = 1
alg[3]: name = jpegenc typeTab = ti.sdo.ce.image1.IIMGENC1 local = 1
alg[4]: name = jpegdec typeTab = ti.sdo.ce.image1.IIMGDEC1 local = 1
Thank you!