In our application, we would like to get the ‘fd’ of EGL OutputStream of the libargus producer.
With libargus, the EGL outputStream is created by producer (by calling libargus API, ICaptureSession::createOutputStream()). We would like to get its ‘fd’ (e.g, by calling eglGetStreamFileDescriptorKHR()), and send this ‘fd’ to another consumer process via unix domain socket. So that the consumer can recover the same EGL stream by calling eglCreateStreamFromFileDescriptorKHR() with the ‘fd’ sent by the producer, and the acquire frames from this EGLStream.
However, 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 most likely that the ‘fd’ of the EGL outputstream of libargus producer 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 producer? E.g, adding new libargus API to export this ‘fd’ to libargus client application?