VisionWorks Toolkit Reference

December 18, 2015 | 1.2 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

This section demonstrates how to disconnect the CUDA consumer and release the EGL resources.

After working with EGL streams applications must disconnect the producer and the consumer from the EGL stream and release the EGL resources.

Note
Disconnecting of the producer is not covered by this tutorial.
To disconnect the consumer and release EGL resources
  1. Disconnect the CUDA consumer:

    void finalizeEGLResources(EGLDisplay & eglDisplay, EGLStreamKHR & eglStream, CUeglStreamConnection & cudaConsumer)
    {
    // disconnect CUDA consumer
    cuEGLStreamConsumerDisconnect(&cudaConsumer);
    cudaConsumer = NULL;
  2. Destroy KHR EGL stream:

    // destroy KHR EGL stream
    eglDestroyStreamKHR(eglDisplay, eglStream);
    eglStream = EGL_NO_STREAM_KHR;
  3. Terminate the EGL display instance:

    // terminate EGL display
    eglTerminate(eglDisplay);
    eglDisplay = EGL_NO_DISPLAY;
    }