Class INTELVAAPIMediaSharing
- java.lang.Object
-
- org.lwjgl.opencl.INTELVAAPIMediaSharing
-
public class INTELVAAPIMediaSharing extends java.lang.ObjectNative 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
CL12and a VA API implementation supporting sharing of surfaces with OpenCL.
-
-
Field Summary
Fields Modifier and Type Field and Description static intCL_ALL_DEVICES_FOR_VA_API_INTELAccepted as a set of VA API devices in themedia_adapter_setparameter ofGetDeviceIDsFromVA_APIMediaAdapterINTEL.static intCL_COMMAND_ACQUIRE_VA_API_MEDIA_SURFACES_INTEL
CL_COMMAND_RELEASE_VA_API_MEDIA_SURFACES_INTELstatic intCL_CONTEXT_VA_API_DISPLAY_INTELstatic intCL_IMAGE_VA_API_PLANE_INTELAccepted as the property being queried in theparam_nameparameter ofGetImageInfo.static intCL_INVALID_VA_API_MEDIA_ADAPTER_INTELReturned byCreateContextandCreateContextFromTypeif the VA API display specified for interoperability is not compatible with the devices against which the context is to be created.static intCL_INVALID_VA_API_MEDIA_SURFACE_INTELReturned byCreateFromVA_APIMediaSurfaceINTELwhensurfaceis not a VA API surface of the required type, byGetMemObjectInfowhenparam_nameisMEM_VA_API_MEDIA_SURFACE_INTELwhenmemobjwas not created from a VA API surface, and fromGetImageInfowhenparam_nameisIMAGE_VA_API_PLANE_INTELandimagewas not created from a VA API surface.static intCL_MEM_VA_API_MEDIA_SURFACE_INTELAccepted as the property being queried in theparam_nameparameter ofGetMemObjectInfo.static intCL_PREFERRED_DEVICES_FOR_VA_API_INTELAccepted as a set of VA API devices in themedia_adapter_setparameter ofGetDeviceIDsFromVA_APIMediaAdapterINTEL.static intCL_VA_API_DISPLAY_INTELAccepted as a VA API device source in themedia_adapter_typeparameter ofGetDeviceIDsFromVA_APIMediaAdapterINTEL.static intCL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTELReturned byEnqueueAcquireVA_APIMediaSurfacesINTELwhen any ofmem_objectsare currently acquired by OpenCL.static intCL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTELReturned byEnqueueReleaseVA_APIMediaSurfacesINTELwhen any ofmem_objectsare not currently acquired by OpenCL.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static longclCreateFromVA_APIMediaSurfaceINTEL(long context, long flags, int[] surface, int plane, int[] errcode_ret)Array version of:CreateFromVA_APIMediaSurfaceINTELstatic longclCreateFromVA_APIMediaSurfaceINTEL(long context, long flags, java.nio.IntBuffer surface, int plane, java.nio.IntBuffer errcode_ret)Creates an OpenCL 2D image object from a VA API media surface or a plane of a VA API media surface.static intclEnqueueAcquireVA_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.static intclEnqueueReleaseVA_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.static intclGetDeviceIDsFromVA_APIMediaAdapterINTEL(long platform, int media_adapter_type, long media_adapter, int media_adapter_set, PointerBuffer devices, int[] num_devices)Array version of:GetDeviceIDsFromVA_APIMediaAdapterINTELstatic intclGetDeviceIDsFromVA_APIMediaAdapterINTEL(long platform, int media_adapter_type, long media_adapter, int media_adapter_set, PointerBuffer devices, java.nio.IntBuffer num_devices)Queries the OpenCL devices corresponding to a VA API display.
-
-
-
Field Detail
-
CL_VA_API_DISPLAY_INTEL
public static final int CL_VA_API_DISPLAY_INTEL
Accepted as a VA API device source in themedia_adapter_typeparameter ofGetDeviceIDsFromVA_APIMediaAdapterINTEL.- See Also:
- Constant Field Values
-
CL_PREFERRED_DEVICES_FOR_VA_API_INTEL
public static final int CL_PREFERRED_DEVICES_FOR_VA_API_INTEL
Accepted as a set of VA API devices in themedia_adapter_setparameter ofGetDeviceIDsFromVA_APIMediaAdapterINTEL.- See Also:
- Constant Field Values
-
CL_ALL_DEVICES_FOR_VA_API_INTEL
public static final int CL_ALL_DEVICES_FOR_VA_API_INTEL
Accepted as a set of VA API devices in themedia_adapter_setparameter ofGetDeviceIDsFromVA_APIMediaAdapterINTEL.- See Also:
- Constant Field Values
-
CL_CONTEXT_VA_API_DISPLAY_INTEL
public static final int CL_CONTEXT_VA_API_DISPLAY_INTEL
- See Also:
- Constant Field Values
-
CL_MEM_VA_API_MEDIA_SURFACE_INTEL
public static final int CL_MEM_VA_API_MEDIA_SURFACE_INTEL
Accepted as the property being queried in theparam_nameparameter ofGetMemObjectInfo.- See Also:
- Constant Field Values
-
CL_IMAGE_VA_API_PLANE_INTEL
public static final int CL_IMAGE_VA_API_PLANE_INTEL
Accepted as the property being queried in theparam_nameparameter ofGetImageInfo.- See Also:
- Constant Field Values
-
CL_COMMAND_ACQUIRE_VA_API_MEDIA_SURFACES_INTEL
public static final int CL_COMMAND_ACQUIRE_VA_API_MEDIA_SURFACES_INTEL
- See Also:
- Constant Field Values
-
CL_COMMAND_RELEASE_VA_API_MEDIA_SURFACES_INTEL
public static final int CL_COMMAND_RELEASE_VA_API_MEDIA_SURFACES_INTEL
- See Also:
- Constant Field Values
-
CL_INVALID_VA_API_MEDIA_ADAPTER_INTEL
public static final int CL_INVALID_VA_API_MEDIA_ADAPTER_INTEL
Returned byCreateContextandCreateContextFromTypeif the VA API display specified for interoperability is not compatible with the devices against which the context is to be created.- See Also:
- Constant Field Values
-
CL_INVALID_VA_API_MEDIA_SURFACE_INTEL
public static final int CL_INVALID_VA_API_MEDIA_SURFACE_INTEL
Returned byCreateFromVA_APIMediaSurfaceINTELwhensurfaceis not a VA API surface of the required type, byGetMemObjectInfowhenparam_nameisMEM_VA_API_MEDIA_SURFACE_INTELwhenmemobjwas not created from a VA API surface, and fromGetImageInfowhenparam_nameisIMAGE_VA_API_PLANE_INTELandimagewas not created from a VA API surface.- See Also:
- Constant Field Values
-
CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL
public static final int CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL
Returned byEnqueueAcquireVA_APIMediaSurfacesINTELwhen any ofmem_objectsare currently acquired by OpenCL.- See Also:
- Constant Field Values
-
CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL
public static final int CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL
Returned byEnqueueReleaseVA_APIMediaSurfacesINTELwhen any ofmem_objectsare not currently acquired by OpenCL.- See Also:
- Constant Field Values
-
-
Method Detail
-
clGetDeviceIDsFromVA_APIMediaAdapterINTEL
public static int clGetDeviceIDsFromVA_APIMediaAdapterINTEL(long platform, int media_adapter_type, long media_adapter, int media_adapter_set, PointerBuffer devices, java.nio.IntBuffer num_devices)Queries the OpenCL devices corresponding to a VA API display.- Parameters:
platform- the platform ID returned byGetPlatformIDsmedia_adapter_type- the type ofmedia_adapter. Must be:VA_API_DISPLAY_INTELmedia_adapter- the media adapter whose corresponding OpenCL devices are being queriedmedia_adapter_set- one of:PREFERRED_DEVICES_FOR_VA_API_INTELALL_DEVICES_FOR_VA_API_INTELdevices- returns a list of OpenCL devices found. Thecl_device_idvalues returned indevicescan be used to identify a specific OpenCL device. IfdevicesisNULL, this argument is ignored. The number of OpenCL devices returned is the minimum of the value specified bynum_entriesand the number of OpenCL devices corresponding tomedia_adapter.num_devices- returns the number of OpenCL devices available that correspond tomedia_adapter. Ifnum_devicesisNULL, this argument is ignored.
-
clCreateFromVA_APIMediaSurfaceINTEL
public static long clCreateFromVA_APIMediaSurfaceINTEL(long context, long flags, java.nio.IntBuffer surface, int plane, java.nio.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- a valid OpenCL context created from a VA API displayflags- a bit-field that is used to specify usage information. One of:MEM_READ_ONLYMEM_WRITE_ONLYMEM_READ_WRITEsurface- a pointer to the VA API surface to shareplane- the plane ofsurfaceto share, for planar formats. For non-planar formats,planemust be 0.errcode_ret- will return an appropriate error code. Iferrcode_retisNULL, no error code is returned.
-
clEnqueueAcquireVA_APIMediaSurfacesINTEL
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 withcommand_queueand 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_SYNCis not specified asTRUEduring context creation,clEnqueueAcquireVA_APIMediaSurfacesINTELprovides the synchronization guarantee that any VA API calls made beforeclEnqueueAcquireVA_APIMediaSurfacesINTELis called will complete executing beforeeventreports completion and before the execution of any subsequent OpenCL work issued incommand_queuebegins. If the context was created with properties specifyingCONTEXT_INTEROP_USER_SYNCasTRUE, the user is responsible for guaranteeing that any VA API calls involving the interop device(s) used in the OpenCL context made beforeclEnqueueAcquireVA_APIMediaSurfacesINTELis called have completed before callingclEnqueueAcquireVA_APIMediaSurfacesINTEL.- Parameters:
command_queue- a valid command-queuemem_objects- a pointer to a list of OpenCL memory objects that were created from VA API surfacesevent_wait_list- a list of events that need to complete before this particular command can be executed. Ifevent_wait_listisNULL, then this particular command does not wait on any event to complete. The events specified inevent_wait_listact as synchronization points. The context associated with events inevent_wait_listandcommand_queuemust 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.eventcan beNULLin 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 theevent_wait_listand theeventarguments are notNULL, the event argument should not refer to an element of theevent_wait_listarray.
-
clEnqueueReleaseVA_APIMediaSurfacesINTEL
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 withcommand_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_SYNCis not specified asTRUEduring context creation,clEnqueueReleaseVA_APIMediaSurfacesINTELprovides the synchronization guarantee that any VA API calls made afterclEnqueueReleaseVA_APIMediaSurfacesINTELis called will not start executing until after all events inevent_wait_listare complete and all work already submitted tocommand_queuecompletes execution. If the context was created with properties specifyingCONTEXT_INTEROP_USER_SYNCspecified asTRUE, the user is responsible for guaranteeing that any VA API calls involving the interop device(s) used in the OpenCL context made afterclEnqueueReleaseVA_APIMediaSurfacesINTELis called will not start executing until after the event returned byclEnqueueReleaseVA_APIMediaSurfacesINTELreports completion.- Parameters:
command_queue- a valid OpenCL context created from a VA API displaymem_objects- a pointer to a list of OpenCL memory objects that were created from VA API surfacesevent_wait_list- a list of events that need to complete before this particular command can be executed. Ifevent_wait_listisNULL, then this particular command does not wait on any event to complete. The events specified inevent_wait_listact as synchronization points. The context associated with events inevent_wait_listandcommand_queuemust 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.eventcan beNULLin 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 theevent_wait_listand theeventarguments are notNULL, the event argument should not refer to an element of theevent_wait_listarray.
-
clGetDeviceIDsFromVA_APIMediaAdapterINTEL
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
-
clCreateFromVA_APIMediaSurfaceINTEL
public static long clCreateFromVA_APIMediaSurfaceINTEL(long context, long flags, int[] surface, int plane, int[] errcode_ret)Array version of:CreateFromVA_APIMediaSurfaceINTEL
-
-