EGLStream Application

The NvMedia EGLStream sample application demonstrates how to:

  • Create and initialize EGLStream, NvMedia EGLStream producers, NvMedia EGLStream consumers.
  • Get the EGLStreams to work together to post and acquire video or image surfaces.
  • Make the code modular so that the producers and consumers are running in their own threads in the same or different partitions.

Two types of NvMedia producers and two types of NvMedia consumers are supported:

  • For the NvMedia video producer, video decoder is used to generate video frames. Then the video producer posts the video surface, in the form of an NvMediaVideoSurface, to the EGLStream.
  • On the NvMedia video consumer side, after the video consumer acquires the video surface, it uses the video encoder to encode them.
  • For the NvMedia image producer, the image data is read from the YUV file to generate image surfaces in the form of NvMediaImage. Then the image producer posts the image surfaces to the EGLStream.

To demonstrate NvMedia/GL/CUDA/EGLOut EGLStream interoperability, the application includes sample code for creating and using a GL producer, GL consumer, CUDA producer, CUDA consumer, and EGLOut consumer.

  • For a GL producer, the Gear application is used to generate graphic frames.
  • For a GL consumer, graphic display is used.
  • For a CUDA producer, the image is read from the YUV or RGB file and is copied to a CUDA array or CUDA device pointer. The producer posts it to the EGLStream.
  • For a CUDA consumer, after the consumer acquires the frame, the data is saved to a file.
  • For an EGLOut consumer, the received frames are rendered directly to the display in the egldevice window interface.