Li Chen(deleted)
|
Zero copy issue regarding camera data
|
Li Chen(deleted)
04/13/2023 11:27 PM
post122211
|
Zero copy issue regarding camera data
Hello,I am currently running the QNX system on Qualcomm's chip and have obtained camera data. My goal is to transfer
this data to OPENGL in zero-copy format, but I have encountered an error.
To illustrate, I have created a new screen_buffer_t and pointed it to the memory address of the camera data. However,
when attempting to display it on the screen, I keep receiving an "invalid parameter" error.
The code is as follows:
qcarcam_ret = qcarcam_get_frame(qcarcam_context, &frame_info, 1000000 * 1000, 0);
screen_buffer_t screenbuf;
screen_create_buffer(&screenbuf);
int err = screen_set_buffer_property_iv(screenbuf, SCREEN_PROPERTY_FORMAT, (const int[]) { SCREEN_FORMAT_UYVY });
int rect[4] = { 0, 0, 1600, 1300 };
int dims[2] = { 1600, 1300 };
err = screen_set_buffer_property_iv(screenbuf, SCREEN_PROPERTY_BUFFER_SIZE, rect);
screen_set_buffer_property_iv(screenbuf, SCREEN_PROPERTY_SIZE, dims);
int stride = 1600 * 1300;
screen_set_buffer_property_iv(screenbuf, SCREEN_PROPERTY_STRIDE, &stride);
err = screen_set_buffer_property_pv(screenbuf, SCREEN_PROPERTY_POINTER, &vir_buffer[frame_info.idx]);
err = screen_blit(screen_context, screen_buf, screenbuf, NULL);
What is the issue with the code above, and where can I find examples or information about zero-copy?
|
|
|