Hi, I encountered a strange issue of convertor in MMAPI.
When i modify the output data of convertor, it will affect the future output.
I have modifed “00_video_decode” to reproduce this issue.
In “conv0_capture_dqbuf_thread_callback” function, my modification as follows:
static bool
conv0_capture_dqbuf_thread_callback(struct v4l2_buffer *v4l2_buf,
NvBuffer * buffer, NvBuffer * shared_buffer,
void *arg)
{
context_t *ctx = (context_t *) arg;
if (!v4l2_buf)
{
cerr << "Error while dequeueing conv capture plane buffer" << endl;
abort(ctx);
return false;
}
if (v4l2_buf->m.planes[0].bytesused == 0)
{
return false;
}
// Write raw video frame to file and return the buffer to converter
// capture plane
if (!ctx->stats && ctx->out_file)
{
write_video_frame(ctx->out_file, *buffer);
}
//TEST: modify the output data
{
int i, j;
for(i=0; i<120; i++)
{
for(j=0; j<120; j++)
{
buffer->planes[0].data[i*buffer->planes[0].fmt.stride + j] = 0;
}
}
}
if (!ctx->stats && !ctx->disable_rendering)
{
ctx->renderer->render(buffer->planes[0].fd);
}
if (ctx->conv->capture_plane.qBuffer(*v4l2_buf, NULL) < 0)
{
return false;
}
return true;
}
In this function, i modify the output data after write yuv data in file. But I find the yuv data in file is incorrect.
Is there any advice?