Hello,
I’m trying to build a system with where each CaptureSession will have multiple consumers as shown in the multiStream sample. In this sample, iCaptureSession->createOutputStream() creates several OutputStream that are passed to different FrameConsumers, one for JPEG encoding and another for preview.
In my application, I have a need for more types of consumers, for example, one to encode and save, one to stream, one to preview, one for additional CV processing, one for DL etc. If I create multiple consumers the application will hang during acquireFrame() in the FrameConsumer.
I’ve reproduced a minimal sample by taking the yuvJPEG sample and spawning multiple FrameConsumer threads. 6 consumers work with minimal latency and 7 consumers will completely hang the system. I’ve attached the snippet if anyone wants to reproduce. This is also with a single camera, I’m worried with additional cameras the number of outputstreams will overwhelm argus even faster.
What is the “intended” way to handle my situation? Based on the samples I should be able to spawn multiple consumers per CaptureSession. I can create a single consumer that will push to my own application queue, however that defeats the purpose of the zero-copy EGLStreams. NvMedia provides a way to handle multisend over an eglstream. Is there any way to do that here?
Pardon for making the failure case unclear, I should have changed the printfs before uploading the snippet.
If the consumer was working, it would print the raw bytes as in the original sample as such:
You can switch between the working/failing versions by toggling the flag up top #define ENABLE_THREAD_6 {0,1}
Your current output will only print if acquireFrame() will not return a frame. Without the status and timeout arguments the program will hang.
printf(“status %d; %d missed\n”, status, missedctr);
Status 6 == timeout, until the producer disconnects with status 8 == disconnected.