This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to insert Comment Marker in JPEG encoder



What is the proper way to insert a comment marker?

I get errors

CMEMK Error: get_phys: Unable to find phys addr for 0x00000018
CMEMK Error: get_phys: get_user_pages() failed: -14
CMEMK Error: GETPHYS: Failed to convert virtual 0x18 to physical.

when calling IMGENC1_process:

memset(&jpegInargs, 0, sizeof(jpegInargs));
memset(&jpegOutargs, 0, sizeof(jpegOutargs));
jpegInargs.imgencInArgs.size = sizeof(jpegInargs);
jpegInargs.sliceNum = 0;
jpegOutargs.imgencOutArgs.size = sizeof(jpegOutargs);
jpegOutargs.imgencOutArgs.bytesGenerated = 0;
inbufdesc.numBufs = 1;
inbufdesc.descs[0].buf = encoder_output_buffer; // no input buffer (generating header only)
inbufdesc.descs[0].bufSize = JPEG_BUF_SIZE;
outbufdesc.numBufs = 1;
outbufdesc.descs[0].buf = encoder_output_buffer;
outbufdesc.descs[0].bufSize = JPEG_BUF_SIZE;

jpegInargs.insertCommentMarker = 1;
jpegInargs.commentSegLen = strlen(comments);

res = IMGENC1_process(ieh, &inbufdesc, &outbufdesc, (IIMGENC1_InArgs*)&jpegInargs, (IIMGENC1_OutArgs*)&jpegOutargs) ;

Update:

When insertCommentMarker = 1and commentSegLen = strlen() lines in the code above are removed, the encoder runs without any errors and the picture is encoded properly.