The proposed demonstration of producer/consumer in graphics_demos work as expected.
However, in this demonstration, the EGLStream is firstly created by consumer, and the corresponding ‘fd’ of this EGL stream is obtained and sent via unix domain socket to producer from the consumer.
Here, we need to firstly create the EGL outputStream by producer (by calling libargus API, ICaptureSession::createOutputStream()), and get its ‘fd’ (by calling eglGetStreamFileDescriptorKHR()), and send this ‘fd’ to consumer (also via unix domain socket). Then the consumer tries to recover the same EGL stream by calling eglCreateStreamFromFileDescriptorKHR() with the ‘fd’ sent by the producer.
So the procedure is a little bit different from that in the producer / consumer demonstration in graphics_demos.
The problem is that, when tying to get the ‘fd’ of the EGL outputstream, eglGetStreamFileDescriptorKHR() returns EGL_NO_FILE_DESCRIPTOR_KHR and generates an error “EGL_BAD_STATE_KHR”. Also we can confirm the EGL stream state is ‘STREAM_STATE_CREATED_KHR’. According to KHR official document, it is highly possible that the ‘fd’ of the ARGUS EGL outputstream has already been obtained by calling eglGetStreamFileDescriptorKHR() inside the libargus implementation, and this will cause the eglGetStreamFileDescriptorKHR() call in our application fail to obtain the fd.
Is it possible for the application to obtain the fd of the EGL outputstream of libargus?
E.g, adding new libargus API to export this ‘fd’ to libargus client application?