HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cl_dx9_media_sharing.h
Go to the documentation of this file.
1 /**********************************************************************************
2  * Copyright (c) 2008-2015 The Khronos Group Inc.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and/or associated documentation files (the
6  * "Materials"), to deal in the Materials without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sublicense, and/or sell copies of the Materials, and to
9  * permit persons to whom the Materials are furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included
13  * in all copies or substantial portions of the Materials.
14  *
15  * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
16  * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
17  * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
18  * https://www.khronos.org/registry/
19  *
20  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
27  **********************************************************************************/
28 
29 /* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
30 
31 #ifndef __OPENCL_CL_DX9_MEDIA_SHARING_H
32 #define __OPENCL_CL_DX9_MEDIA_SHARING_H
33 
34 #include <CL/cl.h>
35 #include <CL/cl_platform.h>
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 /******************************************************************************/
42 /* cl_khr_dx9_media_sharing */
43 #define cl_khr_dx9_media_sharing 1
44 
47 
48 #if defined(_WIN32)
49 #include <d3d9.h>
50 typedef struct _cl_dx9_surface_info_khr
51 {
52  IDirect3DSurface9 *resource;
53  HANDLE shared_handle;
54 } cl_dx9_surface_info_khr;
55 #endif
56 
57 
58 /******************************************************************************/
59 
60 /* Error Codes */
61 #define CL_INVALID_DX9_MEDIA_ADAPTER_KHR -1010
62 #define CL_INVALID_DX9_MEDIA_SURFACE_KHR -1011
63 #define CL_DX9_MEDIA_SURFACE_ALREADY_ACQUIRED_KHR -1012
64 #define CL_DX9_MEDIA_SURFACE_NOT_ACQUIRED_KHR -1013
65 
66 /* cl_media_adapter_type_khr */
67 #define CL_ADAPTER_D3D9_KHR 0x2020
68 #define CL_ADAPTER_D3D9EX_KHR 0x2021
69 #define CL_ADAPTER_DXVA_KHR 0x2022
70 
71 /* cl_media_adapter_set_khr */
72 #define CL_PREFERRED_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2023
73 #define CL_ALL_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2024
74 
75 /* cl_context_info */
76 #define CL_CONTEXT_ADAPTER_D3D9_KHR 0x2025
77 #define CL_CONTEXT_ADAPTER_D3D9EX_KHR 0x2026
78 #define CL_CONTEXT_ADAPTER_DXVA_KHR 0x2027
79 
80 /* cl_mem_info */
81 #define CL_MEM_DX9_MEDIA_ADAPTER_TYPE_KHR 0x2028
82 #define CL_MEM_DX9_MEDIA_SURFACE_INFO_KHR 0x2029
83 
84 /* cl_image_info */
85 #define CL_IMAGE_DX9_MEDIA_PLANE_KHR 0x202A
86 
87 /* cl_command_type */
88 #define CL_COMMAND_ACQUIRE_DX9_MEDIA_SURFACES_KHR 0x202B
89 #define CL_COMMAND_RELEASE_DX9_MEDIA_SURFACES_KHR 0x202C
90 
91 /******************************************************************************/
92 
94  cl_platform_id platform,
95  cl_uint num_media_adapters,
96  cl_dx9_media_adapter_type_khr * media_adapter_type,
97  void * media_adapters,
98  cl_dx9_media_adapter_set_khr media_adapter_set,
99  cl_uint num_entries,
100  cl_device_id * devices,
101  cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2;
102 
106  cl_dx9_media_adapter_type_khr adapter_type,
107  void * surface_info,
108  cl_uint plane,
109  cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
110 
112  cl_command_queue command_queue,
113  cl_uint num_objects,
114  const cl_mem * mem_objects,
115  cl_uint num_events_in_wait_list,
116  const cl_event * event_wait_list,
118 
120  cl_command_queue command_queue,
121  cl_uint num_objects,
122  const cl_mem * mem_objects,
123  cl_uint num_events_in_wait_list,
124  const cl_event * event_wait_list,
126 
127 #ifdef __cplusplus
128 }
129 #endif
130 
131 #endif /* __OPENCL_CL_DX9_MEDIA_SHARING_H */
132 
struct _cl_device_id * cl_device_id
Definition: cl.h:42
CL_API_ENTRY cl_int(CL_API_CALL * clEnqueueReleaseDX9MediaSurfacesKHR_fn)(cl_command_queue command_queue, cl_uint num_objects, const cl_mem *mem_objects, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event) CL_API_SUFFIX__VERSION_1_2
struct _cl_context * cl_context
Definition: cl.h:43
GLenum GLsizei GLsizei GLsizei GLsizei GLbitfield flags
Definition: glew.h:2864
CL_API_ENTRY cl_int(CL_API_CALL * clGetDeviceIDsFromDX9MediaAdapterKHR_fn)(cl_platform_id platform, cl_uint num_media_adapters, cl_dx9_media_adapter_type_khr *media_adapter_type, void *media_adapters, cl_dx9_media_adapter_set_khr media_adapter_set, cl_uint num_entries, cl_device_id *devices, cl_uint *num_devices) CL_API_SUFFIX__VERSION_1_2
#define CL_API_SUFFIX__VERSION_1_2
Definition: cl_platform.h:61
struct _cl_platform_id * cl_platform_id
Definition: cl.h:41
#define CL_API_ENTRY
Definition: cl_platform.h:43
CL_API_ENTRY cl_mem(CL_API_CALL * clCreateFromDX9MediaSurfaceKHR_fn)(cl_context context, cl_mem_flags flags, cl_dx9_media_adapter_type_khr adapter_type, void *surface_info, cl_uint plane, cl_int *errcode_ret) CL_API_SUFFIX__VERSION_1_2
struct _cl_mem * cl_mem
Definition: cl.h:45
cl_uint cl_dx9_media_adapter_type_khr
cl_event event
Definition: glew.h:3695
basic_printf_context_t< buffer >::type context
Definition: printf.h:631
struct _cl_event * cl_event
Definition: cl.h:48
CL_API_ENTRY cl_int(CL_API_CALL * clEnqueueAcquireDX9MediaSurfacesKHR_fn)(cl_command_queue command_queue, cl_uint num_objects, const cl_mem *mem_objects, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event) CL_API_SUFFIX__VERSION_1_2
struct _cl_command_queue * cl_command_queue
Definition: cl.h:44
cl_uint cl_dx9_media_adapter_set_khr
#define CL_API_CALL
Definition: cl_platform.h:44
cl_bitfield cl_mem_flags
Definition: cl.h:77
typedef HANDLE(WINAPI *PFNWGLCREATEBUFFERREGIONARBPROC)(HDC hDC