EGLStream State

After an EGLStream is created, at any given time, the EGLStream is in one of the following defined states:

  • EGL_STREAM_STATE_CREATED_KHR: The EGLStream has been created but not yet connected to a producer or a consumer.
  • EGL_STREAM_STATE_CONNECTING_KHR: The EGLStream has been connected to a consumer but not yet connected to a producer.
  • EGL_STREAM_STATE_EMPTY_KHR: The EGLStream has been connected to a consumer and a producer, but the producer has not yet posted any image frames.
  • EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR: The producer has posted at least one image frame that the consumer has not yet acquired.
  • EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR: The producer has posted at least one image frame, and the consumer has acquired the most recently posted image frame.
  • EGL_STREAM_STATE_DISCONNECTED_KHR: The producer, the consumer, or both, are no longer connected to the EGLStream (e.g., they have been destroyed). Once the EGLStream is in this state it remains in this state until the EGLStream is destroyed. In this state only eglQueryStreamKHR() and eglDestroyStreamKHR() are valid operations.

The EGLStream state is queried as follows:

EGLBoolean  eglQueryStreamKHR(
            EGLDisplay   dpy,
            EGLStreamKHR stream,
            EGLenum      attribute,
            EGLuint64KHR *value);

The following state transitions may occur:

  1. EGL_STREAM_STATE_CREATED_KHR: A new EGLStream is created in this state.
  2. EGL_STREAM_STATE_CREATED_KHR to EGL_STREAM_STATE_CONNECTING_KHR: Occurs when a consumer is connected to the EGLStream.
  3. EGL_STREAM_STATE_CONNECTING_KHR to EGL_STREAM_STATE_EMPTY_KHR: Occurs when a producer is connected to the EGLStream.
  4. EGL_STREAM_STATE_EMPTY_KHR to EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR: Occurs the first time the producer inserts an EGL image frame.
  5. EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR to EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR: Occurs when the consumer begins acquiring a newly posted EGL image frame.
  6. EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR to EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR: Occurs when the producer posts a new EGL image frame.
  7. Any state to EGL_STREAM_STATE_DISCONNECTED_KHR: Occurs when the producer or consumer is destroyed.