Public Member Functions | |
virtual Status | getAcquireSync (EGLDisplay eglDisplay, EGLSyncKHR *eglSync)=0 |
Creates and returns a new EGLSync object that is signalled when all operations on the Buffer from the previous libargus capture request have completed. More... | |
virtual Status | setReleaseSync (EGLDisplay eglDisplay, EGLSyncKHR eglSync)=0 |
Sets the client-provided EGLSync for a Buffer prior to its release. More... | |
Static Public Member Functions | |
static const InterfaceID & | id () |
Protected Member Functions | |
~IEGLSync () | |
|
pure virtual |
Creates and returns a new EGLSync object that is signalled when all operations on the Buffer from the previous libargus capture request have completed.
When sync support is enabled for a Stream, libargus may output Buffers to that stream even if hardware operations are still pending on the Buffer's image data. In this case, libargus will attach sync information to the Buffer when it is acquired by the client that must be used to block any client operations on the image data until all preceeding libargus operations have completed. Failure to block on this sync information may lead to undefined buffer contents.
This method will create and output a new EGLSync object that will be signalled once all libargus operations on the Buffer have completed. Ownership of this EGLSync object is given to the caller, who must then wait on the sync object as needed before destroying it using eglDestroySyncKHR. Calling this method more than once is allowed, and each call will create and return a new EGLSync object.
This method should only ever be called while the Buffer is in an acquired state; ie. the time between when the Buffer was acquired by IBufferOutputStream::acquireBuffer and when it was released by IBufferOutputStream::releaseBuffer. If called outside of the acquired state, STATUS_UNAVAILABLE will be returned.
When successful, STATUS_OK will be returned and 'eglSync' will be written with the new EGLSync object. Note that EGL_NO_SYNC_KHR is still a valid output for the 'eglSync' even when STATUS_OK is returned; this implies that libargus does not have any pending operations to the Buffer and so the client need not take any sync precautions before accessing the image data. Thus, the returned Status code should be used for detecting failures rather than checking for an EGL_NO_SYNC_KHR output.
[in] | eglDisplay | The EGLDisplay that shall own the returned EGLSync object. |
[out] | eglSync | Output for the newly created EGLSync object. Ownership of this object is given to the client. |
|
inlinestatic |
|
pure virtual |
Sets the client-provided EGLSync for a Buffer prior to its release.
When sync support is enabled for a Stream, the client may release Buffers back to libargus for future capture use even if the client has hardware operations pending on the Buffer's image data. In this case, the client must provide an EGLSync object to libargus that will be signalled by the completion of the client's pending operations. This sync object will then be waited on by libargus to prevent any buffer operations from occuring before the client sync has been signalled.
This method should only ever be called while the Buffer is in an acquired state; ie. the time between when the Buffer was acquired by IBufferOutputStream::acquireBuffer and when it was released by IBufferOutputStream::releaseBuffer. If called outside of this period, STATUS_UNAVAILBLE will be returned and no object updates will be made. Otherwise, when called in the acquired state, this method will set the EGLSync that will be provided to libargus at the time that the Buffer is released by IBufferOutputStream::releaseBuffer and STATUS_OK will be returned. On success, ownership of the EGLSync object will be passed to libargus; further use of the EGLSync by the client after this point may lead to undefined results or abnormal termination. If called more than once when in the acquired state, any previously set EGLSync will be replaced; only the last set EGLSync before calling releaseBuffer will be waited on by libargus.
If the client does not have any pending operations on the Buffer at the time that releaseBuffer is called, it is allowed for the client to either skip calling this method or to call it using EGL_NO_DISPLAY and EGL_NO_SYNC_KHR such that libargus will not have to consider any sync requirements and may use the Buffer immediately.
[in] | eglDisplay | The EGLDisplay that created the EGLSync object being provided. |
[in] | eglSync | The EGLSync that libargus must wait on before accessing the buffer. |