Consumer-side steps:
- Create the stream and get the file descriptor of the stream (refer to
eglstreamcube.c
).client->stream = eglCreateStreamKHR(demoState.display, streamAttr); client->fd = eglGetStreamFileDescriptorKHR(demoState.display, client->stream);
- Share the file descriptor with the producer through the socket.
-
Bind the consumer end of the EGLStream with the GL texture (refer to
eglstreamcube.c
).glBindTexture(GL_TEXTURE_EXTERNAL_OES, texture); eglStreamConsumerGLTextureExternalKHR(demoState.display, client->stream)
-
Latch the recent image frame to the texture with
eglStreamConsumerAcquireKHR
:eglStreamConsumerAcquireKHR(demoState.display,stream)
- Render the texture as one face of the cube.