Top Description Fields Constructors Methods
org.lwjgl.opencl

public Class INTELVAAPIMediaSharing

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

Native bindings to the intel_va_api_media_sharing extension.

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.

Field Summary

Modifier and TypeField and Description
public static final int
CL_ALL_DEVICES_FOR_VA_API_INTEL

Accepted as a set of VA API devices in the media_adapter_set parameter of GetDeviceIDsFromVA_APIMediaAdapterINTEL.

public static final int
CL_COMMAND_ACQUIRE_VA_API_MEDIA_SURFACES_INTEL

Returned in the param_value parameter of GetEventInfo when param_name is EVENT_COMMAND_TYPE.

public static final int
CL_COMMAND_RELEASE_VA_API_MEDIA_SURFACES_INTEL

Returned in the param_value parameter of GetEventInfo when param_name is EVENT_COMMAND_TYPE.

public static final int
CL_CONTEXT_VA_API_DISPLAY_INTEL

Accepted as a property name in the properties parameter of CreateContext and CreateContextFromType.

public static final int
CL_IMAGE_VA_API_PLANE_INTEL

Accepted as the property being queried in the param_name parameter of GetImageInfo.

public static final int
CL_INVALID_VA_API_MEDIA_ADAPTER_INTEL

Returned by CreateContext and CreateContextFromType if the VA API display specified for interoperability is not compatible with the devices against which the context is to be created.

public static final int
CL_INVALID_VA_API_MEDIA_SURFACE_INTEL

Returned by CreateFromVA_APIMediaSurfaceINTEL when surface is not a VA API surface of the required type, by GetMemObjectInfo when param_name is MEM_VA_API_MEDIA_SURFACE_INTEL when memobj was not created from a VA API surface, and from GetImageInfo when param_name is IMAGE_VA_API_PLANE_INTEL and image was not created from a VA API surface.

public static final int
CL_MEM_VA_API_MEDIA_SURFACE_INTEL

Accepted as the property being queried in the param_name parameter of GetMemObjectInfo.

public static final int
CL_PREFERRED_DEVICES_FOR_VA_API_INTEL

Accepted as a set of VA API devices in the media_adapter_set parameter of GetDeviceIDsFromVA_APIMediaAdapterINTEL.

public static final int
CL_VA_API_DISPLAY_INTEL

Accepted as a VA API device source in the media_adapter_type parameter of GetDeviceIDsFromVA_APIMediaAdapterINTEL.

public static final int
CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL

Returned by EnqueueAcquireVA_APIMediaSurfacesINTEL when any of mem_objects are currently acquired by OpenCL.

public static final int
CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL

Returned by EnqueueReleaseVA_APIMediaSurfacesINTEL when any of mem_objects are not currently acquired by OpenCL.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static long
clCreateFromVA_APIMediaSurfaceINTEL(long
a valid OpenCL context created from a VA API display
context
,
long
a bit-field that is used to specify usage information. One of:
MEM_READ_ONLYMEM_WRITE_ONLYMEM_READ_WRITE
flags
,
IntBuffer
a pointer to the VA API surface to share
surface
,
int
the plane of surface to share, for planar formats. For non-planar formats, plane must be 0.
plane
,
IntBuffer
will return an appropriate error code. If errcode_ret is NULL, no error code is returned.
errcode_ret
)

Creates an OpenCL 2D image object from a VA API media surface or a plane of a VA API media surface.

public static long
clCreateFromVA_APIMediaSurfaceINTEL(long context, long flags, int[] surface, int plane, int[] errcode_ret)

Array version of: CreateFromVA_APIMediaSurfaceINTEL

public static int
clEnqueueAcquireVA_APIMediaSurfacesINTEL(long
a valid command-queue
command_queue
,
PointerBuffer
a pointer to a list of OpenCL memory objects that were created from VA API surfaces
mem_objects
,
PointerBuffer
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_wait_list
,
PointerBuffer
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.
event
)

Acquires OpenCL memory objects that have been created from VA API surfaces.

public static int
clEnqueueReleaseVA_APIMediaSurfacesINTEL(long
a valid OpenCL context created from a VA API display
command_queue
,
PointerBuffer
a pointer to a list of OpenCL memory objects that were created from VA API surfaces
mem_objects
,
PointerBuffer
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_wait_list
,
PointerBuffer
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.
event
)

Releases OpenCL memory objects that have been created from VA API surfaces.

public static int
clGetDeviceIDsFromVA_APIMediaAdapterINTEL(long
the platform ID returned by GetPlatformIDs
platform
,
int
the type of media_adapter. Must be:
VA_API_DISPLAY_INTEL
media_adapter_type
,
long
the media adapter whose corresponding OpenCL devices are being queried
media_adapter
,
int media_adapter_set, PointerBuffer
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.
devices
,
IntBuffer
returns the number of OpenCL devices available that correspond to media_adapter. If num_devices is NULL, this argument is ignored.
num_devices
)

Queries the OpenCL devices corresponding to a VA API display.

public static int
clGetDeviceIDsFromVA_APIMediaAdapterINTEL(long platform, int media_adapter_type, long media_adapter, int media_adapter_set, PointerBuffer devices, int[] num_devices)

Array version of: GetDeviceIDsFromVA_APIMediaAdapterINTEL

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

Unsafe version of: CreateFromVA_APIMediaSurfaceINTEL

public static int
nclEnqueueAcquireVA_APIMediaSurfacesINTEL(long command_queue, int
the number of memory objects to be acquired in mem_objects.
num_objects
,
long mem_objects, int
the number of events in event_wait_list
num_events_in_wait_list
,
long event_wait_list, long event)

Unsafe version of: EnqueueAcquireVA_APIMediaSurfacesINTEL

public static int
nclEnqueueReleaseVA_APIMediaSurfacesINTEL(long command_queue, int
the number of memory objects to be released in mem_objects
num_objects
,
long mem_objects, int
the number of events in event_wait_list
num_events_in_wait_list
,
long event_wait_list, long event)

Unsafe version of: EnqueueReleaseVA_APIMediaSurfacesINTEL

public static int
nclGetDeviceIDsFromVA_APIMediaAdapterINTEL(long platform, int media_adapter_type, long media_adapter, int media_adapter_set, int
the number of cl_device_id entries that can be added to devices. If devices is not NULL then num_entries must be greater than zero.
num_entries
,
long devices, long num_devices)

Unsafe version of: GetDeviceIDsFromVA_APIMediaAdapterINTEL

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CL_ALL_DEVICES_FOR_VA_API_INTELback to summary
public static final int CL_ALL_DEVICES_FOR_VA_API_INTEL

Accepted as a set of VA API devices in the media_adapter_set parameter of GetDeviceIDsFromVA_APIMediaAdapterINTEL.

CL_COMMAND_ACQUIRE_VA_API_MEDIA_SURFACES_INTELback to summary
public static final int CL_COMMAND_ACQUIRE_VA_API_MEDIA_SURFACES_INTEL

Returned in the param_value parameter of GetEventInfo when param_name is EVENT_COMMAND_TYPE.

CL_COMMAND_RELEASE_VA_API_MEDIA_SURFACES_INTELback to summary
public static final int CL_COMMAND_RELEASE_VA_API_MEDIA_SURFACES_INTEL

Returned in the param_value parameter of GetEventInfo when param_name is EVENT_COMMAND_TYPE.

CL_CONTEXT_VA_API_DISPLAY_INTELback to summary
public static final int CL_CONTEXT_VA_API_DISPLAY_INTEL

Accepted as a property name in the properties parameter of CreateContext and CreateContextFromType.

CL_IMAGE_VA_API_PLANE_INTELback to summary
public static final int CL_IMAGE_VA_API_PLANE_INTEL

Accepted as the property being queried in the param_name parameter of GetImageInfo.

CL_INVALID_VA_API_MEDIA_ADAPTER_INTELback to summary
public static final int CL_INVALID_VA_API_MEDIA_ADAPTER_INTEL

Returned by CreateContext and CreateContextFromType if the VA API display specified for interoperability is not compatible with the devices against which the context is to be created.

CL_INVALID_VA_API_MEDIA_SURFACE_INTELback to summary
public static final int CL_INVALID_VA_API_MEDIA_SURFACE_INTEL

Returned by CreateFromVA_APIMediaSurfaceINTEL when surface is not a VA API surface of the required type, by GetMemObjectInfo when param_name is MEM_VA_API_MEDIA_SURFACE_INTEL when memobj was not created from a VA API surface, and from GetImageInfo when param_name is IMAGE_VA_API_PLANE_INTEL and image was not created from a VA API surface.

CL_MEM_VA_API_MEDIA_SURFACE_INTELback to summary
public static final int CL_MEM_VA_API_MEDIA_SURFACE_INTEL

Accepted as the property being queried in the param_name parameter of GetMemObjectInfo.

CL_PREFERRED_DEVICES_FOR_VA_API_INTELback to summary
public static final int CL_PREFERRED_DEVICES_FOR_VA_API_INTEL

Accepted as a set of VA API devices in the media_adapter_set parameter of GetDeviceIDsFromVA_APIMediaAdapterINTEL.

CL_VA_API_DISPLAY_INTELback to summary
public static final int CL_VA_API_DISPLAY_INTEL

Accepted as a VA API device source in the media_adapter_type parameter of GetDeviceIDsFromVA_APIMediaAdapterINTEL.

CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTELback to summary
public static final int CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL

Returned by EnqueueAcquireVA_APIMediaSurfacesINTEL when any of mem_objects are currently acquired by OpenCL.

CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTELback to summary
public static final int CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL

Returned by EnqueueReleaseVA_APIMediaSurfacesINTEL when any of mem_objects are not currently acquired by OpenCL.

Constructor Detail

INTELVAAPIMediaSharingback to summary
protected INTELVAAPIMediaSharing()

Method Detail

clCreateFromVA_APIMediaSurfaceINTELback to summary
public static long clCreateFromVA_APIMediaSurfaceINTEL(long context, long flags, IntBuffer surface, int plane, IntBuffer errcode_ret)

Creates an OpenCL 2D image object from a VA API media surface or a plane of a VA API media surface.

Parameters
context:long

a valid OpenCL context created from a VA API display

flags:long

a bit-field that is used to specify usage information. One of:

MEM_READ_ONLYMEM_WRITE_ONLYMEM_READ_WRITE
surface:IntBuffer

a pointer to the VA API surface to share

plane:int

the plane of surface to share, for planar formats. For non-planar formats, plane must be 0.

errcode_ret:IntBuffer

will return an appropriate error code. If errcode_ret is NULL, no error code is returned.

Annotations
@NativeType:cl_mem
clCreateFromVA_APIMediaSurfaceINTELback to summary
public static long clCreateFromVA_APIMediaSurfaceINTEL(long context, long flags, int[] surface, int plane, int[] errcode_ret)

Array version of: CreateFromVA_APIMediaSurfaceINTEL

Annotations
@NativeType:cl_mem
clEnqueueAcquireVA_APIMediaSurfacesINTELback to summary
public static int clEnqueueAcquireVA_APIMediaSurfacesINTEL(long command_queue, PointerBuffer mem_objects, PointerBuffer event_wait_list, PointerBuffer event)

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:long

a valid command-queue

mem_objects:PointerBuffer

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

event_wait_list:PointerBuffer

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:PointerBuffer

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.

Annotations
@NativeType:cl_int
clEnqueueReleaseVA_APIMediaSurfacesINTELback to summary
public static int clEnqueueReleaseVA_APIMediaSurfacesINTEL(long command_queue, PointerBuffer mem_objects, PointerBuffer event_wait_list, PointerBuffer event)

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:long

a valid OpenCL context created from a VA API display

mem_objects:PointerBuffer

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

event_wait_list:PointerBuffer

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:PointerBuffer

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.

Annotations
@NativeType:cl_int
clGetDeviceIDsFromVA_APIMediaAdapterINTELback to summary
public static int clGetDeviceIDsFromVA_APIMediaAdapterINTEL(long platform, int media_adapter_type, long media_adapter, int media_adapter_set, PointerBuffer devices, IntBuffer num_devices)

Queries the OpenCL devices corresponding to a VA API display.

Parameters
platform:long

the platform ID returned by GetPlatformIDs

media_adapter_type:int

the type of media_adapter. Must be:

VA_API_DISPLAY_INTEL
media_adapter:long

the media adapter whose corresponding OpenCL devices are being queried

media_adapter_set:int

one of:

PREFERRED_DEVICES_FOR_VA_API_INTELALL_DEVICES_FOR_VA_API_INTEL
devices:PointerBuffer

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:IntBuffer

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

Annotations
@NativeType:cl_int
clGetDeviceIDsFromVA_APIMediaAdapterINTELback to summary
public static int clGetDeviceIDsFromVA_APIMediaAdapterINTEL(long platform, int media_adapter_type, long media_adapter, int media_adapter_set, PointerBuffer devices, int[] num_devices)

Array version of: GetDeviceIDsFromVA_APIMediaAdapterINTEL

Annotations
@NativeType:cl_int
nclCreateFromVA_APIMediaSurfaceINTELback to summary
public static long nclCreateFromVA_APIMediaSurfaceINTEL(long context, long flags, long surface, int plane, long errcode_ret)

Unsafe version of: CreateFromVA_APIMediaSurfaceINTEL

nclEnqueueAcquireVA_APIMediaSurfacesINTELback to summary
public static int nclEnqueueAcquireVA_APIMediaSurfacesINTEL(long command_queue, int num_objects, long mem_objects, int num_events_in_wait_list, long event_wait_list, long event)

Unsafe version of: EnqueueAcquireVA_APIMediaSurfacesINTEL

Parameters
num_objects:int

the number of memory objects to be acquired in mem_objects.

num_events_in_wait_list:int

the number of events in event_wait_list

nclEnqueueReleaseVA_APIMediaSurfacesINTELback to summary
public static int nclEnqueueReleaseVA_APIMediaSurfacesINTEL(long command_queue, int num_objects, long mem_objects, int num_events_in_wait_list, long event_wait_list, long event)

Unsafe version of: EnqueueReleaseVA_APIMediaSurfacesINTEL

Parameters
num_objects:int

the number of memory objects to be released in mem_objects

num_events_in_wait_list:int

the number of events in event_wait_list

nclGetDeviceIDsFromVA_APIMediaAdapterINTELback to summary
public static int nclGetDeviceIDsFromVA_APIMediaAdapterINTEL(long platform, int media_adapter_type, long media_adapter, int media_adapter_set, int num_entries, long devices, long num_devices)

Unsafe version of: GetDeviceIDsFromVA_APIMediaAdapterINTEL

Parameters
num_entries:int

the number of cl_device_id entries that can be added to devices. If devices is not NULL then num_entries must be greater than zero.