[MMAPI] Block at stop and release the encoder

Hi,

My problem is raised at https://devtalk.nvidia.com/default/topic/1006857/jetson-tx1/-mmapi-under-what-conditions-lsquo-conv-gt-capture_plane-qbuffer-rsquo-will-block/?offset=12#5145680

Hi DaneLLL,

Thank you for your reply.

It not failing at second time, often fails at the the stop and release.

When stop and release, the program is as follows.

dec->output_plane.setStreamStatus(false);
dec->capture_plane.setStreamStatus(false);
dec->output_plane.stopDQThread();

conv->output_plane.setStreamStatus(false);
conv->capture_plane.setStreamStatus(false);
enc->output_plane.setStreamStatus(false);
enc->capture_plane.setStreamStatus(false);

conv->output_plane.stopDQThread();
conv->capture_plane.stopDQThread();
enc->output_plane.stopDQThread();
enc->capture_plane.stopDQThread();

delete conv;
delete enc;
delete dec;

It will block at “enc->capture_plane.stopDQThread()”, I debug it by gdb, then I see it block at wait the exit of “dqThread”, and the “dqThread” is block at “plane->dqBuffer”. dec/enc/conv is created with “O_NONBLOCK”.

Sometimes it will encounter a segment fault at “delete enc”.

Thank you!

Hi zcs, could you share a sample to reproduce the issue?

Hi DaneLLL,

Sorry for late reply. I will attempt to reproduce the issue by the sample of MMAPI.

Thanks!