OLD | NEW |
(Empty) | |
| 1 #ifndef _VA_EGL_H_ |
| 2 #define _VA_EGL_H_ |
| 3 |
| 4 #include <va/va.h> |
| 5 #include <EGL/egl.h> |
| 6 #include <EGL/eglext.h> |
| 7 |
| 8 #ifdef __cplusplus |
| 9 extern "C" { |
| 10 #endif |
| 11 |
| 12 typedef void *VASurfaceEGL; |
| 13 |
| 14 /*This function is used to get EGLClientBuffer |
| 15 * (lower 16bits is buffer index, upper 16bits |
| 16 * is BC device id.) from surface id. Application |
| 17 * should maintain EGLClientBuffer itself.*/ |
| 18 |
| 19 VAStatus vaGetEGLClientBufferFromSurface ( |
| 20 VADisplay dpy, |
| 21 VASurfaceID surface, |
| 22 EGLClientBuffer *buffer /* out*/ |
| 23 ); |
| 24 |
| 25 /** |
| 26 * Return a suitable VADisplay for VA API |
| 27 * |
| 28 * @param[in] native_dpy the native display |
| 29 * @param[in] egl_dpy the EGL display |
| 30 * @return a VADisplay |
| 31 */ |
| 32 VADisplay vaGetDisplayEGL( |
| 33 VANativeDisplay native_dpy, |
| 34 EGLDisplay egl_dpy |
| 35 ); |
| 36 |
| 37 /** |
| 38 * Return maximum number of EGL targets supported by the implementation |
| 39 * |
| 40 * @param[in] dpy the VADisplay |
| 41 * @return the maximum number of EGL Target |
| 42 */ |
| 43 int vaMaxNumSurfaceTargetsEGL( |
| 44 VADisplay dpy |
| 45 ); |
| 46 |
| 47 /** |
| 48 * Return maximum number of EGL surface attributes supported by the implementati
on |
| 49 * |
| 50 * @param[in] dpy the VADisplay |
| 51 * @return the maximum number of EGL surface attributes |
| 52 */ |
| 53 int vaMaxNumSurfaceAttributesEGL( |
| 54 VADisplay dpy |
| 55 ); |
| 56 |
| 57 /** |
| 58 * Query supported EGL targets for eglCreateImageKHR(). |
| 59 * |
| 60 * The caller must provide a "target_list" array that can hold at |
| 61 * least vaMaxNumSurfaceTargetsEGL() entries. The actual number of |
| 62 * targets returned in "target_list" is returned in "num_targets". |
| 63 * |
| 64 * @param[in]] dpy the VADisplay |
| 65 * @param[out] target_list the array to hold target entries |
| 66 * @param[out] num_targets the actual number of targets |
| 67 * @return VA_STATUS_SUCCESS if successful |
| 68 */ |
| 69 VAStatus vaQuerySurfaceTargetsEGL( |
| 70 VADisplay dpy, |
| 71 EGLenum *target_list, /* out */ |
| 72 int *num_targets /* out */ |
| 73 ); |
| 74 |
| 75 /** |
| 76 * Creates a VA/EGL surface with the specified target |
| 77 * |
| 78 * If target is 0, this means the best efficient target by default. |
| 79 * |
| 80 * @param[in] dpy the VADisplay |
| 81 * @param[in] target the specified EGL target |
| 82 * @param[in] width the surface width |
| 83 * @param[in] height the surface height |
| 84 * @param[out] gl_surface the VA/EGL surface |
| 85 * @return VA_STATUS_SUCCESS if successful |
| 86 */ |
| 87 VAStatus vaCreateSurfaceEGL( |
| 88 VADisplay dpy, |
| 89 EGLenum target, |
| 90 unsigned int width, |
| 91 unsigned int height, |
| 92 VASurfaceEGL *gl_surface |
| 93 ); |
| 94 |
| 95 /** |
| 96 * Destroy a VA/EGL surface |
| 97 * |
| 98 * The application shall maintain the live EGL context itself. |
| 99 * |
| 100 * @param[in] dpy the VA display |
| 101 * @param[in] gl_surface the VA surface |
| 102 * @return VA_STATUS_SUCCESS if successful |
| 103 */ |
| 104 VAStatus vaDestroySurfaceEGL( |
| 105 VADisplay dpy, |
| 106 VASurfaceEGL gl_surface |
| 107 ); |
| 108 |
| 109 /** |
| 110 * Associate a EGL surface with a VA surface |
| 111 * |
| 112 * @param[in] dpy the VA display |
| 113 * @param[in] egl_surface the VA/EGL destination surface |
| 114 * @param[in] surface the VA surface |
| 115 * @param[in] flags the flags to PutSurface |
| 116 * @return VA_STATUS_SUCCESS if successful |
| 117 */ |
| 118 VAStatus vaAssociateSurfaceEGL( |
| 119 VADisplay dpy, |
| 120 VASurfaceEGL egl_surface, |
| 121 VASurfaceID surface, |
| 122 unsigned int flags |
| 123 ); |
| 124 |
| 125 /** |
| 126 * Update the content of a VA/EGL surface |
| 127 * |
| 128 * Changes to VA surface are committed to VA/EGL surface at this point. |
| 129 * |
| 130 * @param[in] dpy the VA display |
| 131 * @param[in] egl_surface the VA/EGL surface that has been associated with a VA
surface |
| 132 * @return VA_STATUS_SUCCESS if successful |
| 133 */ |
| 134 VAStatus vaSyncSurfaceEGL( |
| 135 VADisplay dpy, |
| 136 VASurfaceEGL egl_surface |
| 137 ); |
| 138 |
| 139 /** |
| 140 * Get the necessary information for eglCreateImageKHR() |
| 141 * |
| 142 * The caller must provide a "attrib_list" array that can hold at |
| 143 * least (2 * vaMaxNumSurfaceAttributesEGL()) entries. The last attribute |
| 144 * specified in attrib_list must be EGL_NONE |
| 145 * |
| 146 * @param[in] dpy the VA display |
| 147 * @param[in] egl_surface the VA/EGL surface that has been associated with a VA
surface |
| 148 * @param[out] target the type of <buffer> for eglCreateImageKHR() |
| 149 * @param[out] buffer the EGLClientBuffer for eglCreateImageKHR() |
| 150 * @param[out] attrib_list the list of attribute-value pairs for eglCreateImageK
HR() |
| 151 * @param[in/out] num_attribs input: the number of allocated attribute-value pai
rs in attrib_list; output: the actual number of attribute-value pairs |
| 152 * @return VA_STATUS_SUCCESS if successful |
| 153 */ |
| 154 VAStatus vaGetSurfaceInfoEGL( |
| 155 VADisplay dpy, |
| 156 VASurfaceEGL egl_surface, |
| 157 EGLenum *target, /* out, the type of <buffer> */ |
| 158 EGLClientBuffer *buffer, /* out */ |
| 159 EGLint *attrib_list, /* out, the last attribute must be EGL_NONE */ |
| 160 int *num_attribs /* in/out, the number of attribute-value pairs *
/ |
| 161 ); |
| 162 |
| 163 /** |
| 164 * Deassociate a EGL surface |
| 165 * |
| 166 * @param[in] dpy the VA display |
| 167 * @param[in] egl_surface the VA/EGL destination surface |
| 168 * @return VA_STATUS_SUCCESS if successful |
| 169 */ |
| 170 VAStatus vaDeassociateSurfaceEGL( |
| 171 VADisplay dpy, |
| 172 VASurfaceEGL egl_surface |
| 173 ); |
| 174 |
| 175 #ifdef __cplusplus |
| 176 } |
| 177 #endif |
| 178 |
| 179 #endif /* _VA_EGL_H_ */ |
OLD | NEW |