I’m using the Multimedia API on JetPack 4.2.2 and try to setup the NvVideoDecoder.
As I understood, the NvVideoDecoder can only be used (setup capture plane) after the application has dequed an V4L2_EVENT_RESOLUTION_CHANGE event. However, I never receive this event in my custom application. I studied the samples code (00_video_decode and 14_multivideo_decode) and copied the code into my own application.
- Create NvVideoDecoder in non-blocking mode
- Subscribe to V4L2_EVENT_RESOLUTION_CHANGE event
- Create and start device poll thread (why do I need an own thread for this?)
- In the main loop I call SetPollInterrupt, wait on the semaphores, and dqEvent:
dec->SetPollInterrupt();
decoderPollCtx.pollthread_sema);
sem_wait(&decoderPollCtx.decoderthread_sema);
v4l2_event ev = {};
int ret = dec->dqEvent(ev, 100);
if (ret == 0 && ev.type == V4L2_EVENT_RESOLUTION_CHANGE)
{
query_and_set_capture(&decCtx);
}
The event is never dequed and query_and_set_capture is never called, even after several minutes and hundreds of loop iterations.
What exactly has to be done to cause the kernel to emit a V4L2_EVENT_RESOLUTION_CHANGE event?
The 00_video_decode sample interestingly works, but only the version that was installed via the SDK in /usr/src. If I download the samples as part of the Multimedia-API package (L4T 32) from the download site and build them, it can’t decode and play the sample video.