hi all
now i can get a jpg image from DM355IPNC,but its size is 640x352.
what i changed is here:
static int jpegVideoBuffer(IMGENC1_Handle hEncode, char *inBuf, int inSize,
char *outBuf, int *outBufSize, int *frametype, int width,
int height)
{
XDM1_BufDesc inBufDesc;
XDM1_BufDesc outBufDesc;
Int32 status;
IMGENC1_InArgs inArgs;
IMGENC1_OutArgs outArgs;
inBufDesc.numBufs = 1;
inBufDesc.descs[0].bufSize = inSize;
inBufDesc.descs[0].buf = inBuf;
outBufDesc.numBufs = 1;
outBufDesc.descs[0].bufSize = D1_FRAME_SIZE;
outBufDesc.descs[0].buf = outBuf;
inArgs.size = sizeof(IMGENC1_InArgs);
outArgs.size = sizeof(IMGENC1_OutArgs);
/* perform the image (JPEG) encoding */
status = IMGENC1_process(hEncode, &inBufDesc, &outBufDesc, &inArgs,
&outArgs);
if (status != IMGENC1_EOK) {
ERR("Encoder process returned fail!! \n");
return FAILURE;
}
*outBufSize = outArgs.bytesGenerated;
*frametype = 1;
////////////////////////////////////////////////add here//////////////////////////////////////////////
if(sig_usr2 == 1)
{
time_t zeit;
char strzeit[256];
struct tm *zeitinfo;
setlocale(LC_ALL, "");
time(&zeit);
zeitinfo = localtime(&zeit);
strftime(strzeit, 255, "%Y%m%d_%R:%S", zeitinfo);
char dateiname[40];
strcpy(dateiname,"usb");
strcat(dateiname,strzeit);
strcat(dateiname,".jpg");
FILE *filestream = NULL;
filestream = fopen(dateiname, "w");
fwrite(outBuf, 1, outArgs.bytesGenerated, filestream);
fclose(filestream);
printf("Schreibe Datei: %s\n", dateiname);
}
////////////////////////////////////////////////add end//////////////////////////////////////////////
sig_usr2 = 0;
return SUCCESS;
}
but i want get 2592x1944 or 1280x960 jpg image,what should i do?