Class INTELVAAPIMediaSharing

The goal of this extension is to provide interoperability between OpenCL and the cross-platform Video Acceleration API (VA API). The extension
specifically enables sharing of VA API surfaces for media. It uses similar mechanisms and provides similar surface sharing capabilities for VA API that
are provided by the Khronos OpenCL 1.2 Media Surface Sharing extension for DX9.

Requires CL12 and a VA API implementation supporting sharing of surfaces with OpenCL.

devices - returns a list of OpenCL devices found. The cl_device_id values returned in devices can be used to identify a specific OpenCL
device. If devices is NULL, this argument is ignored. The number of OpenCL devices returned is the minimum of the value specified by
num_entries and the number of OpenCL devices corresponding to media_adapter.

num_devices - returns the number of OpenCL devices available that correspond to media_adapter. If num_devices is NULL, this argument is ignored.

nclCreateFromVA_APIMediaSurfaceINTEL

public static long nclCreateFromVA_APIMediaSurfaceINTEL​(long context,
long flags,
long surface,
int plane,
long errcode_ret)

clEnqueueAcquireVA_APIMediaSurfacesINTEL

Acquires OpenCL memory objects that have been created from VA API surfaces. The VA API surfaces are acquired by the OpenCL context associated with
command_queue and can therefore be used by all command- queues associated with the OpenCL context.

OpenCL memory objects created from VA API surfaces must be acquired before they can be used by any OpenCL commands queued to a command-queue. If an
OpenCL memory object created from a VA API surface is used while it is not acquired by OpenCL, the call attempting to use that OpenCL memory object
will return VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL.

If CONTEXT_INTEROP_USER_SYNC is not specified as TRUE during context creation, clEnqueueAcquireVA_APIMediaSurfacesINTEL provides the
synchronization guarantee that any VA API calls made before clEnqueueAcquireVA_APIMediaSurfacesINTEL is called will complete executing before
event reports completion and before the execution of any subsequent OpenCL work issued in command_queue begins. If the context was
created with properties specifying CONTEXT_INTEROP_USER_SYNC as TRUE, the user is responsible for guaranteeing that any VA API calls
involving the interop device(s) used in the OpenCL context made before clEnqueueAcquireVA_APIMediaSurfacesINTEL is called have completed before
calling clEnqueueAcquireVA_APIMediaSurfacesINTEL.

Parameters:

command_queue - a valid command-queue

mem_objects - a pointer to a list of OpenCL memory objects that were created from VA API surfaces

event_wait_list - a list of events that need to complete before this particular command can be executed. If event_wait_list is NULL, then this particular command
does not wait on any event to complete. The events specified in event_wait_list act as synchronization points. The context associated with events in
event_wait_list and command_queue must be the same.

event - Returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete.
event can be NULL in which case it will not be possible for the application to query the status of this command or queue a wait for this command to
complete. If the event_wait_list and the event arguments are not NULL, the event argument should not refer to an element of the
event_wait_list array.

clEnqueueReleaseVA_APIMediaSurfacesINTEL

Releases OpenCL memory objects that have been created from VA API surfaces. The VA API surfaces are released by the OpenCL context associated with
command_queue.

OpenCL memory objects created from VA API surfaces which have been acquired by OpenCL must be released by OpenCL before they may be accessed by VA API.
Accessing a VA API surface while its corresponding OpenCL memory object is acquired is in error and will result in undefined behavior, including but
not limited to possible OpenCL errors, data corruption, and program termination.

If CONTEXT_INTEROP_USER_SYNC is not specified as TRUE during context creation, clEnqueueReleaseVA_APIMediaSurfacesINTEL provides the
synchronization guarantee that any VA API calls made after clEnqueueReleaseVA_APIMediaSurfacesINTEL is called will not start executing until
after all events in event_wait_list are complete and all work already submitted to command_queue completes execution. If the context
was created with properties specifying CONTEXT_INTEROP_USER_SYNC specified as TRUE, the user is responsible for guaranteeing that any VA API
calls involving the interop device(s) used in the OpenCL context made after clEnqueueReleaseVA_APIMediaSurfacesINTEL is called will not start
executing until after the event returned by clEnqueueReleaseVA_APIMediaSurfacesINTEL reports completion.

Parameters:

command_queue - a valid OpenCL context created from a VA API display

mem_objects - a pointer to a list of OpenCL memory objects that were created from VA API surfaces

event_wait_list - a list of events that need to complete before this particular command can be executed. If event_wait_list is NULL, then this particular command
does not wait on any event to complete. The events specified in event_wait_list act as synchronization points. The context associated with events in
event_wait_list and command_queue must be the same.

event - Returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete.
event can be NULL in which case it will not be possible for the application to query the status of this command or queue a wait for this command to
complete. If the event_wait_list and the event arguments are not NULL, the event argument should not refer to an element of the
event_wait_list array.