Coverage for cuda / bindings / _lib / cyruntime / cyruntime.pxi: 1%

836 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2025-12-10 01:19 +0000

1# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 

2# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE 

3  

4# These graphics API are the reimplemented version of what's supported by CUDA Runtime. 

5# Issue https://github.com/NVIDIA/cuda-python/issues/488 will remove them by letting us 

6# use call into the static library directly. 

7  

8# This file is included from cuda/bindings/_bindings/cyruntime.pyx.in but kept in a 

9# separate file to keep it separated from the auto-generated code there. 

10  

11# Prior to https://github.com/NVIDIA/cuda-python/pull/914, this was two 

12# independent modules (c.b._lib.cyruntime.cyruntime and 

13# c.b._lib.cyruntime.utils), but was merged into one. 

14  

15from libc.string cimport memset 

16cimport cuda.bindings._bindings.cydriver as cydriver 

17  

18cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: 

19 cdef cudaError_t err = cudaSuccess 

20 # cudaFree(0) is a NOP operations that initializes the context state 

21 err = cudaFree(<void*>0) 

22 if err != cudaSuccess: 

23 return err 

24 cdef cydriver.CUeglFrame cueglFrame 

25 err = getDriverEglFrame(&cueglFrame, eglframe) 

26 if err != cudaSuccess: 

27 return err 

28 err = <cudaError_t>cydriver._cuEGLStreamProducerPresentFrame(<cydriver.CUeglStreamConnection*>conn, cueglFrame, pStream) 

29 return err 

30  

31cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: 

32 cdef cudaError_t err = cudaSuccess 

33 # cudaFree(0) is a NOP operations that initializes the context state 

34 err = cudaFree(<void*>0) 

35 if err != cudaSuccess: 

36 return err 

37 if eglframe == NULL: 

38 err = cudaErrorInvalidResourceHandle 

39 return err 

40 cdef cydriver.CUeglFrame cueglFrame 

41 err = <cudaError_t>cydriver._cuEGLStreamProducerReturnFrame(<cydriver.CUeglStreamConnection*>conn, &cueglFrame, pStream) 

42 if err != cudaSuccess: 

43 return err 

44 err = getRuntimeEglFrame(eglframe, cueglFrame) 

45 return err 

46  

47cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cyruntime.cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil: 

48 cdef cudaError_t err = cudaSuccess 

49 # cudaFree(0) is a NOP operations that initializes the context state 

50 err = cudaFree(<void*>0) 

51 if err != cudaSuccess: 

52 return err 

53 cdef cydriver.CUeglFrame cueglFrame 

54 memset(&cueglFrame, 0, sizeof(cueglFrame)) 

55 err = <cudaError_t>cydriver._cuGraphicsResourceGetMappedEglFrame(&cueglFrame, <cydriver.CUgraphicsResource>resource, index, mipLevel) 

56 if err != cudaSuccess: 

57 return err 

58 err = getRuntimeEglFrame(eglFrame, cueglFrame) 

59 return err 

60  

61cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, cyruntime.VdpDevice vdpDevice, cyruntime.VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil: 

62 return cudaErrorNotSupported 

63  

64cdef cudaError_t _cudaVDPAUGetDevice(int* device, cyruntime.VdpDevice vdpDevice, cyruntime.VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil: 

65 cdef cudaError_t err = cudaSuccess 

66 # cudaFree(0) is a NOP operations that initializes the context state 

67 err = cudaFree(<void*>0) 

68 if err != cudaSuccess: 

69 return err 

70 err = <cudaError_t>cydriver._cuVDPAUGetDevice(<cydriver.CUdevice*>device, vdpDevice, vdpGetProcAddress) 

71 return err 

72  

73cdef cudaError_t _cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, cyruntime.VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: 

74 cdef cudaError_t err = cudaSuccess 

75 # cudaFree(0) is a NOP operations that initializes the context state 

76 err = cudaFree(<void*>0) 

77 if err != cudaSuccess: 

78 return err 

79 err = <cudaError_t>cydriver._cuGraphicsVDPAURegisterVideoSurface(<cydriver.CUgraphicsResource*>resource, vdpSurface, flags) 

80 return err 

81  

82cdef cudaError_t _cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, cyruntime.VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: 

83 cdef cudaError_t err = cudaSuccess 

84 # cudaFree(0) is a NOP operations that initializes the context state 

85 err = cudaFree(<void*>0) 

86 if err != cudaSuccess: 

87 return err 

88 err = <cudaError_t>cydriver._cuGraphicsVDPAURegisterOutputSurface(<cydriver.CUgraphicsResource*>resource, vdpSurface, flags) 

89 return err 

90  

91cdef cudaError_t _cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cyruntime.cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil: 

92 cdef cudaError_t err = cudaSuccess 

93 # cudaFree(0) is a NOP operations that initializes the context state 

94 err = cudaFree(<void*>0) 

95 if err != cudaSuccess: 

96 return err 

97 err = <cudaError_t>cydriver._cuGLGetDevices_v2(pCudaDeviceCount, <cydriver.CUdevice*>pCudaDevices, cudaDeviceCount, <cydriver.CUGLDeviceList>deviceList) 

98 return err 

99  

100cdef cudaError_t _cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, cyruntime.GLuint image, cyruntime.GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: 

101 cdef cudaError_t err = cudaSuccess 

102 # cudaFree(0) is a NOP operations that initializes the context state 

103 err = cudaFree(<void*>0) 

104 if err != cudaSuccess: 

105 return err 

106 err = <cudaError_t>cydriver._cuGraphicsGLRegisterImage(<cydriver.CUgraphicsResource*>resource, image, target, flags) 

107 return err 

108  

109cdef cudaError_t _cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, cyruntime.GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: 

110 cdef cudaError_t err = cudaSuccess 

111 # cudaFree(0) is a NOP operations that initializes the context state 

112 err = cudaFree(<void*>0) 

113 if err != cudaSuccess: 

114 return err 

115 err = <cudaError_t>cydriver._cuGraphicsGLRegisterBuffer(<cydriver.CUgraphicsResource*>resource, buffer, flags) 

116 return err 

117  

118cdef cudaError_t _cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t* pCudaResource, cyruntime.EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: 

119 cdef cudaError_t err = cudaSuccess 

120 # cudaFree(0) is a NOP operations that initializes the context state 

121 err = cudaFree(<void*>0) 

122 if err != cudaSuccess: 

123 return err 

124 err = <cudaError_t>cydriver._cuGraphicsEGLRegisterImage(<cydriver.CUgraphicsResource*>pCudaResource, image, flags) 

125 return err 

126  

127cdef cudaError_t _cudaEGLStreamConsumerConnect(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil: 

128 cdef cudaError_t err = cudaSuccess 

129 # cudaFree(0) is a NOP operations that initializes the context state 

130 err = cudaFree(<void*>0) 

131 if err != cudaSuccess: 

132 return err 

133 err = <cudaError_t>cydriver._cuEGLStreamConsumerConnect(<cydriver.CUeglStreamConnection*>conn, eglStream) 

134 return err 

135  

136cdef cudaError_t _cudaEGLStreamConsumerConnectWithFlags(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: 

137 cdef cudaError_t err = cudaSuccess 

138 # cudaFree(0) is a NOP operations that initializes the context state 

139 err = cudaFree(<void*>0) 

140 if err != cudaSuccess: 

141 return err 

142 err = <cudaError_t>cydriver._cuEGLStreamConsumerConnectWithFlags(<cydriver.CUeglStreamConnection*>conn, eglStream, flags) 

143 return err 

144  

145cdef cudaError_t _cudaEGLStreamConsumerDisconnect(cyruntime.cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil: 

146 cdef cudaError_t err = cudaSuccess 

147 # cudaFree(0) is a NOP operations that initializes the context state 

148 err = cudaFree(<void*>0) 

149 if err != cudaSuccess: 

150 return err 

151 err = <cudaError_t>cydriver._cuEGLStreamConsumerDisconnect(<cydriver.CUeglStreamConnection*>conn) 

152 return err 

153  

154cdef cudaError_t _cudaEGLStreamConsumerAcquireFrame(cyruntime.cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil: 

155 cdef cudaError_t err = cudaSuccess 

156 # cudaFree(0) is a NOP operations that initializes the context state 

157 err = cudaFree(<void*>0) 

158 if err != cudaSuccess: 

159 return err 

160 err = <cudaError_t>cydriver._cuEGLStreamConsumerAcquireFrame(<cydriver.CUeglStreamConnection*>conn, <cydriver.CUgraphicsResource*>pCudaResource, <cydriver.CUstream*>pStream, timeout) 

161 return err 

162  

163cdef cudaError_t _cudaEGLStreamConsumerReleaseFrame(cyruntime.cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: 

164 cdef cudaError_t err = cudaSuccess 

165 # cudaFree(0) is a NOP operations that initializes the context state 

166 err = cudaFree(<void*>0) 

167 if err != cudaSuccess: 

168 return err 

169 err = <cudaError_t>cydriver._cuEGLStreamConsumerReleaseFrame(<cydriver.CUeglStreamConnection*>conn, <cydriver.CUgraphicsResource>pCudaResource, <cydriver.CUstream*>pStream) 

170 return err 

171  

172cdef cudaError_t _cudaEGLStreamProducerConnect(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream, cyruntime.EGLint width, cyruntime.EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil: 

173 cdef cudaError_t err = cudaSuccess 

174 # cudaFree(0) is a NOP operations that initializes the context state 

175 err = cudaFree(<void*>0) 

176 if err != cudaSuccess: 

177 return err 

178 err = <cudaError_t>cydriver._cuEGLStreamProducerConnect(<cydriver.CUeglStreamConnection*>conn, eglStream, width, height) 

179 return err 

180  

181cdef cudaError_t _cudaEGLStreamProducerDisconnect(cyruntime.cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil: 

182 cdef cudaError_t err = cudaSuccess 

183 # cudaFree(0) is a NOP operations that initializes the context state 

184 err = cudaFree(<void*>0) 

185 if err != cudaSuccess: 

186 return err 

187 err = <cudaError_t>cydriver._cuEGLStreamProducerDisconnect(<cydriver.CUeglStreamConnection*>conn) 

188 return err 

189  

190cdef cudaError_t _cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, cyruntime.EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: 

191 cdef cudaError_t err = cudaSuccess 

192 # cudaFree(0) is a NOP operations that initializes the context state 

193 err = cudaFree(<void*>0) 

194 if err != cudaSuccess: 

195 return err 

196 err = <cudaError_t>cydriver._cuEventCreateFromEGLSync(<cydriver.CUevent*>phEvent, eglSync, flags) 

197 return err 

198  

199## utility functions 

200  

201cdef int case_desc(const cudaChannelFormatDesc* d, int x, int y, int z, int w, int f) except ?cudaErrorCallRequiresNewerDriver nogil: 

202 return d[0].x == x and d[0].y == y and d[0].z == z and d[0].w == w and d[0].f == f 

203  

204  

205cdef cudaError_t getDescInfo(const cudaChannelFormatDesc* d, int *numberOfChannels, cydriver.CUarray_format *format) except ?cudaErrorCallRequiresNewerDriver nogil: 

206 # Check validity 

207 if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSigned, 

208 cudaChannelFormatKind.cudaChannelFormatKindUnsigned): 

209 if (d[0].x != 8) and (d[0].x != 16) and (d[0].x != 32): 

210 return cudaErrorInvalidChannelDescriptor 

211 elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindFloat,): 

212 if (d[0].x != 16) and (d[0].x != 32): 

213 return cudaErrorInvalidChannelDescriptor 

214 elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12,): 

215 if (d[0].x != 8) or (d[0].y != 8) or (d[0].z != 8) or (d[0].w != 0): 

216 return cudaErrorInvalidChannelDescriptor 

217 elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1, 

218 cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2, 

219 cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4, 

220 cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1, 

221 cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2, 

222 cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4,): 

223 if (d[0].x != 8): 

224 return cudaErrorInvalidChannelDescriptor 

225 elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1, 

226 cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2, 

227 cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4, 

228 cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1, 

229 cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2, 

230 cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4,): 

231 if (d[0].x != 16): 

232 return cudaErrorInvalidChannelDescriptor 

233 elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1, 

234 cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB, 

235 cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2, 

236 cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB, 

237 cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3, 

238 cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB, 

239 cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4, 

240 cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4, 

241 cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5, 

242 cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5, 

243 cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7, 

244 cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB,): 

245 if (d[0].x != 8): 

246 return cudaErrorInvalidChannelDescriptor 

247 elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H, 

248 cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,): 

249 if (d[0].x != 16) or (d[0].y != 16) or (d[0].z != 16) or (d[0].w != 0): 

250 return cudaErrorInvalidChannelDescriptor 

251 elif d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized1010102,): 

252 if (d[0].x != 10) or (d[0].y != 10) or (d[0].z != 10) or (d[0].w != 2): 

253 return cudaErrorInvalidChannelDescriptor 

254 else: 

255 return cudaErrorInvalidChannelDescriptor 

256  

257 # If Y is non-zero, it must match X 

258 # If Z is non-zero, it must match Y 

259 # If W is non-zero, it must match Z 

260 if (((d[0].y != 0) and (d[0].y != d[0].x)) or 

261 ((d[0].z != 0) and (d[0].z != d[0].y)) or 

262 ((d[0].w != 0) and (d[0].w != d[0].z))): 

263 if d[0].f != cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized1010102: 

264 return cudaErrorInvalidChannelDescriptor 

265 if case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): 

266 numberOfChannels[0] = 1 

267 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8 

268 elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): 

269 numberOfChannels[0] = 2 

270 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8 

271 elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): 

272 numberOfChannels[0] = 3 

273 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8 

274 elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindSigned): 

275 numberOfChannels[0] = 4 

276 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8 

277 elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): 

278 numberOfChannels[0] = 1 

279 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8 

280 elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): 

281 numberOfChannels[0] = 2 

282 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8 

283 elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): 

284 numberOfChannels[0] = 3 

285 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8 

286 elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): 

287 numberOfChannels[0] = 4 

288 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8 

289 elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): 

290 numberOfChannels[0] = 1 

291 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16 

292 elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): 

293 numberOfChannels[0] = 2 

294 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16 

295 elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): 

296 numberOfChannels[0] = 3 

297 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16 

298 elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindSigned): 

299 numberOfChannels[0] = 4 

300 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16 

301 elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): 

302 numberOfChannels[0] = 1 

303 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16 

304 elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): 

305 numberOfChannels[0] = 2 

306 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16 

307 elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): 

308 numberOfChannels[0] = 3 

309 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16 

310 elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): 

311 numberOfChannels[0] = 4 

312 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16 

313 elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): 

314 numberOfChannels[0] = 1 

315 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32 

316 elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): 

317 numberOfChannels[0] = 2 

318 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32 

319 elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindSigned): 

320 numberOfChannels[0] = 3 

321 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32 

322 elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindSigned): 

323 numberOfChannels[0] = 4 

324 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32 

325 elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): 

326 numberOfChannels[0] = 1 

327 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32 

328 elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): 

329 numberOfChannels[0] = 2 

330 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32 

331 elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): 

332 numberOfChannels[0] = 3 

333 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32 

334 elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindUnsigned): 

335 numberOfChannels[0] = 4 

336 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32 

337 elif case_desc(d, 16, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat): 

338 numberOfChannels[0] = 1 

339 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_HALF 

340 elif case_desc(d, 16, 16, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat): 

341 numberOfChannels[0] = 2 

342 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_HALF 

343 elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat): 

344 numberOfChannels[0] = 3 

345 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_HALF 

346 elif case_desc(d, 16, 16, 16, 16, cudaChannelFormatKind.cudaChannelFormatKindFloat): 

347 numberOfChannels[0] = 4 

348 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_HALF 

349 elif case_desc(d, 32, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat): 

350 numberOfChannels[0] = 1 

351 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_FLOAT 

352 elif case_desc(d, 32, 32, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat): 

353 numberOfChannels[0] = 2 

354 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_FLOAT 

355 elif case_desc(d, 32, 32, 32, 0, cudaChannelFormatKind.cudaChannelFormatKindFloat): 

356 numberOfChannels[0] = 3 

357 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_FLOAT 

358 elif case_desc(d, 32, 32, 32, 32, cudaChannelFormatKind.cudaChannelFormatKindFloat): 

359 numberOfChannels[0] = 4 

360 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_FLOAT 

361 elif case_desc(d, 8, 8, 8, 0, cudaChannelFormatKind.cudaChannelFormatKindNV12): 

362 numberOfChannels[0] = 3 

363 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_NV12 

364 elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1): 

365 numberOfChannels[0] = 4 

366 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM 

367 elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB): 

368 numberOfChannels[0] = 4 

369 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM_SRGB 

370 elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2): 

371 numberOfChannels[0] = 4 

372 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM 

373 elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB): 

374 numberOfChannels[0] = 4 

375 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM_SRGB 

376 elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3): 

377 numberOfChannels[0] = 4 

378 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM 

379 elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB): 

380 numberOfChannels[0] = 4 

381 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM_SRGB 

382 elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4): 

383 numberOfChannels[0] = 1 

384 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC4_UNORM 

385 elif case_desc(d, 8, 0, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4): 

386 numberOfChannels[0] = 1 

387 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC4_SNORM 

388 elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5): 

389 numberOfChannels[0] = 2 

390 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC5_UNORM 

391 elif case_desc(d, 8, 8, 0, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5): 

392 numberOfChannels[0] = 2 

393 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC5_SNORM 

394 elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H): 

395 numberOfChannels[0] = 3 

396 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC6H_UF16 

397 elif case_desc(d, 16, 16, 16, 0, cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H): 

398 numberOfChannels[0] = 3 

399 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC6H_SF16 

400 elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7): 

401 numberOfChannels[0] = 4 

402 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM 

403 elif case_desc(d, 8, 8, 8, 8, cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB): 

404 numberOfChannels[0] = 4 

405 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM_SRGB 

406 elif case_desc(d, 10, 10, 10, 2, cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized1010102): 

407 numberOfChannels[0] = 4 

408 format[0] = cydriver.CUarray_format_enum.CU_AD_FORMAT_UNORM_INT_101010_2 

409 else: 

410 return cudaErrorInvalidChannelDescriptor 

411  

412 if d[0].f in (cudaChannelFormatKind.cudaChannelFormatKindNV12, 

413 cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H, 

414 cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H,): 

415 if numberOfChannels[0] != 3: 

416 return cudaErrorInvalidChannelDescriptor 

417 else: 

418 if (numberOfChannels[0] != 1) and (numberOfChannels[0] != 2) and (numberOfChannels[0] != 4): 

419 return cudaErrorInvalidChannelDescriptor 

420 return cudaSuccess 

421  

422cdef cudaError_t getChannelFormatDescFromDriverDesc(cudaChannelFormatDesc* pRuntimeDesc, size_t* pDepth, size_t* pHeight, size_t* pWidth, const cydriver.CUDA_ARRAY3D_DESCRIPTOR_v2* pDriverDesc) except ?cudaErrorCallRequiresNewerDriver nogil: 

423 cdef int channel_size = 0 

424 if pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNSIGNED_INT8: 

425 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned 

426 channel_size = 8 

427 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNSIGNED_INT16: 

428 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned 

429 channel_size = 16 

430 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNSIGNED_INT32: 

431 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned 

432 channel_size = 32 

433 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SIGNED_INT8: 

434 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned 

435 channel_size = 8 

436 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SIGNED_INT16: 

437 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned 

438 channel_size = 16 

439 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SIGNED_INT32: 

440 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSigned 

441 channel_size = 32 

442 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_HALF: 

443 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindFloat 

444 channel_size = 16 

445 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_FLOAT: 

446 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindFloat 

447 channel_size = 32 

448 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_NV12: 

449 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindNV12 

450 channel_size = 8 

451 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT8X1: 

452 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1 

453 channel_size = 8 

454 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT8X2: 

455 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2 

456 channel_size = 8 

457 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT8X4: 

458 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4 

459 channel_size = 8 

460 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SNORM_INT8X1: 

461 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1 

462 channel_size = 8 

463 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SNORM_INT8X2: 

464 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2 

465 channel_size = 8 

466 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SNORM_INT8X4: 

467 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4 

468 channel_size = 8 

469 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT16X1: 

470 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1 

471 channel_size = 16 

472 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT16X2: 

473 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2 

474 channel_size = 16 

475 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT16X4: 

476 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4 

477 channel_size = 16 

478 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SNORM_INT16X1: 

479 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1 

480 channel_size = 16 

481 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SNORM_INT16X2: 

482 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2 

483 channel_size = 16 

484 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_SNORM_INT16X4: 

485 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4 

486 channel_size = 16 

487 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC1_UNORM: 

488 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1 

489 channel_size = 8 

490 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC1_UNORM_SRGB: 

491 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB 

492 channel_size = 8 

493 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC2_UNORM: 

494 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2 

495 channel_size = 8 

496 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC2_UNORM_SRGB: 

497 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB 

498 channel_size = 8 

499 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC3_UNORM: 

500 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3 

501 channel_size = 8 

502 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC3_UNORM_SRGB: 

503 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB 

504 channel_size = 8 

505 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC4_UNORM: 

506 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4 

507 channel_size = 8 

508 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC4_SNORM: 

509 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4 

510 channel_size = 8 

511 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC5_UNORM: 

512 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5 

513 channel_size = 8 

514 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC5_SNORM: 

515 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5 

516 channel_size = 8 

517 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC6H_UF16: 

518 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H 

519 channel_size = 16 

520 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC6H_SF16: 

521 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H 

522 channel_size = 16 

523 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC7_UNORM: 

524 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7 

525 channel_size = 8 

526 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_BC7_UNORM_SRGB: 

527 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB 

528 channel_size = 8 

529 elif pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT_101010_2: 

530 pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized1010102 

531 else: 

532 return cudaErrorInvalidChannelDescriptor 

533  

534 # populate bits per channel 

535 pRuntimeDesc[0].x = 0 

536 pRuntimeDesc[0].y = 0 

537 pRuntimeDesc[0].z = 0 

538 pRuntimeDesc[0].w = 0 

539  

540 if pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNORM_INT_101010_2 and pDriverDesc[0].NumChannels == 4: 

541 pRuntimeDesc[0].w = 2 

542 pRuntimeDesc[0].z = 10 

543 pRuntimeDesc[0].y = 10 

544 pRuntimeDesc[0].x = 10 

545 else: 

546 if pDriverDesc[0].NumChannels >= 4: 

547 pRuntimeDesc[0].w = channel_size 

548 if pDriverDesc[0].NumChannels >= 3: 

549 pRuntimeDesc[0].z = channel_size 

550 if pDriverDesc[0].NumChannels >= 2: 

551 pRuntimeDesc[0].y = channel_size 

552 if pDriverDesc[0].NumChannels >= 1: 

553 pRuntimeDesc[0].x = channel_size 

554  

555 if pDriverDesc[0].NumChannels not in (4, 3, 2, 1): 

556 return cudaErrorInvalidChannelDescriptor 

557  

558 # populate dimensions 

559 if pDepth != NULL: 

560 pDepth[0] = pDriverDesc[0].Depth 

561 if pHeight != NULL: 

562 pHeight[0] = pDriverDesc[0].Height 

563 if pWidth != NULL: 

564 pWidth[0] = pDriverDesc[0].Width 

565 return cudaSuccess 

566  

567cdef cudaError_t getDriverEglFrame(cydriver.CUeglFrame *cuEglFrame, cyruntime.cudaEglFrame eglFrame) except ?cudaErrorCallRequiresNewerDriver nogil: 

568 cdef cudaError_t err = cudaSuccess 

569 cdef unsigned int i = 0 

570  

571 err = getDescInfo(&eglFrame.planeDesc[0].channelDesc, <int*>&cuEglFrame[0].numChannels, &cuEglFrame[0].cuFormat) 

572 if err != cudaSuccess: 

573 return err 

574 for i in range(eglFrame.planeCount): 

575 if eglFrame.frameType == cyruntime.cudaEglFrameTypeArray: 

576 cuEglFrame[0].frame.pArray[i] = <cydriver.CUarray>eglFrame.frame.pArray[i] 

577 else: 

578 cuEglFrame[0].frame.pPitch[i] = eglFrame.frame.pPitch[i].ptr 

579 cuEglFrame[0].width = eglFrame.planeDesc[0].width 

580 cuEglFrame[0].height = eglFrame.planeDesc[0].height 

581 cuEglFrame[0].depth = eglFrame.planeDesc[0].depth 

582 cuEglFrame[0].pitch = eglFrame.planeDesc[0].pitch 

583 cuEglFrame[0].planeCount = eglFrame.planeCount 

584 if eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420Planar: 

585 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR 

586 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420SemiPlanar: 

587 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR 

588 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV422Planar: 

589 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR 

590 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV422SemiPlanar: 

591 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR 

592 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV444Planar: 

593 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR 

594 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV444SemiPlanar: 

595 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR 

596 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUYV422: 

597 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422 

598 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY422: 

599 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422 

600 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY709: 

601 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709 

602 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY709_ER: 

603 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709_ER 

604 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY2020: 

605 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_2020 

606 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatARGB: 

607 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB 

608 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatRGBA: 

609 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA 

610 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatABGR: 

611 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR 

612 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBGRA: 

613 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA 

614 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatL: 

615 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L 

616 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatR: 

617 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R 

618 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatA: 

619 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A 

620 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatRG: 

621 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG 

622 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatAYUV: 

623 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV 

624 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU444SemiPlanar: 

625 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR 

626 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU422SemiPlanar: 

627 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR 

628 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420SemiPlanar: 

629 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR 

630 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar: 

631 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR 

632 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar: 

633 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR 

634 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar: 

635 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR 

636 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar: 

637 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR 

638 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatVYUY_ER: 

639 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER 

640 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY_ER: 

641 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER 

642 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUYV_ER: 

643 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER 

644 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVYU_ER: 

645 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER 

646 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUVA_ER: 

647 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER 

648 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatAYUV_ER: 

649 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER 

650 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV444Planar_ER: 

651 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER 

652 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV422Planar_ER: 

653 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER 

654 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420Planar_ER: 

655 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER 

656 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV444SemiPlanar_ER: 

657 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER 

658 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV422SemiPlanar_ER: 

659 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER 

660 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420SemiPlanar_ER: 

661 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER 

662 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU444Planar_ER: 

663 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER 

664 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU422Planar_ER: 

665 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER 

666 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420Planar_ER: 

667 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER 

668 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU444SemiPlanar_ER: 

669 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER 

670 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU422SemiPlanar_ER: 

671 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER 

672 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420SemiPlanar_ER: 

673 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER 

674 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerRGGB: 

675 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB 

676 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerBGGR: 

677 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR 

678 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerGRBG: 

679 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG 

680 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerGBRG: 

681 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG 

682 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10RGGB: 

683 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB 

684 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10BGGR: 

685 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR 

686 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10GRBG: 

687 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG 

688 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10GBRG: 

689 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG 

690 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12RGGB: 

691 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB 

692 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12BGGR: 

693 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR 

694 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12GRBG: 

695 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG 

696 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12GBRG: 

697 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG 

698 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer14RGGB: 

699 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB 

700 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer14BGGR: 

701 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR 

702 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer14GRBG: 

703 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG 

704 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer14GBRG: 

705 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG 

706 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer20RGGB: 

707 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB 

708 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer20BGGR: 

709 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR 

710 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer20GRBG: 

711 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG 

712 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer20GBRG: 

713 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG 

714 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerIspRGGB: 

715 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB 

716 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerIspBGGR: 

717 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR 

718 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerIspGRBG: 

719 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG 

720 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerIspGBRG: 

721 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG 

722 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU444Planar: 

723 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR 

724 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU422Planar: 

725 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR 

726 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420Planar: 

727 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR 

728 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerBCCR: 

729 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR 

730 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerRCCB: 

731 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB 

732 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerCRBC: 

733 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC 

734 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerCBRC: 

735 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC 

736 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10CCCC: 

737 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC 

738 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12BCCR: 

739 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR 

740 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12RCCB: 

741 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB 

742 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12CRBC: 

743 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC 

744 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12CBRC: 

745 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC 

746 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12CCCC: 

747 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC 

748 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY: 

749 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y 

750 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420SemiPlanar_2020: 

751 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 

752 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420SemiPlanar_2020: 

753 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 

754 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420Planar_2020: 

755 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020 

756 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420Planar_2020: 

757 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020 

758 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420SemiPlanar_709: 

759 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 

760 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420SemiPlanar_709: 

761 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 

762 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420Planar_709: 

763 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709 

764 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420Planar_709: 

765 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709 

766 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_709: 

767 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 

768 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_2020: 

769 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 

770 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar_2020: 

771 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 

772 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar: 

773 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR 

774 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar_709: 

775 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709 

776 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY_ER: 

777 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER 

778 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY_709_ER: 

779 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER 

780 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10_ER: 

781 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER 

782 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10_709_ER: 

783 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER 

784 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12_ER: 

785 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER 

786 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12_709_ER: 

787 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER 

788 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUVA: 

789 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA 

790 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVYU: 

791 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU 

792 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatVYUY: 

793 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY 

794 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_ER: 

795 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER 

796 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER: 

797 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER 

798 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar_ER: 

799 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER 

800 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER: 

801 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER 

802 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar_ER: 

803 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER 

804 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER: 

805 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER 

806 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar_ER: 

807 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER 

808 elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER: 

809 cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER 

810 else: 

811 return cudaErrorInvalidValue 

812 if eglFrame.frameType == cyruntime.cudaEglFrameTypeArray: 

813 cuEglFrame[0].frameType = cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY 

814 elif eglFrame.frameType == cyruntime.cudaEglFrameTypePitch: 

815 cuEglFrame[0].frameType = cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH 

816 else: 

817 return cudaErrorInvalidValue 

818  

819@cython.show_performance_hints(False) 

820cdef cudaError_t getRuntimeEglFrame(cyruntime.cudaEglFrame *eglFrame, cydriver.CUeglFrame cueglFrame) except ?cudaErrorCallRequiresNewerDriver nogil: 

821 cdef cudaError_t err = cudaSuccess 

822 cdef unsigned int i 

823 cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR_v2 ad 

824 cdef cudaPitchedPtr pPtr 

825 memset(eglFrame, 0, sizeof(eglFrame[0])) 

826 memset(&ad, 0, sizeof(ad)) 

827 for i in range(cueglFrame.planeCount): 

828 ad.Depth = cueglFrame.depth 

829 ad.Flags = 0 

830 ad.Format = cueglFrame.cuFormat 

831 ad.Height = cueglFrame.height 

832 ad.NumChannels = cueglFrame.numChannels 

833 ad.Width = cueglFrame.width 

834  

835 err = getChannelFormatDescFromDriverDesc(&eglFrame[0].planeDesc[i].channelDesc, NULL, NULL, NULL, &ad) 

836 if err != cudaSuccess: 

837 return err 

838  

839 eglFrame[0].planeDesc[i].depth = cueglFrame.depth 

840 eglFrame[0].planeDesc[i].numChannels = cueglFrame.numChannels 

841 if i == 0: 

842 eglFrame[0].planeDesc[i].width = cueglFrame.width 

843 eglFrame[0].planeDesc[i].height = cueglFrame.height 

844 eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch 

845 elif (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR or 

846 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER or 

847 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR or 

848 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER or 

849 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020 or 

850 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020 or 

851 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709 or 

852 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709): 

853 eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2) 

854 eglFrame[0].planeDesc[i].height = <unsigned int>(cueglFrame.height / 2) 

855 eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2) 

856 elif (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR or 

857 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER or 

858 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR or 

859 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER or 

860 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR or 

861 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR or 

862 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 or 

863 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 or 

864 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 or 

865 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 or 

866 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 or 

867 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 or 

868 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER or 

869 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER or 

870 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER or 

871 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER): 

872 eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2) 

873 eglFrame[0].planeDesc[i].height = <unsigned int>(cueglFrame.height / 2) 

874 eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2) 

875 eglFrame[0].planeDesc[1].channelDesc.y = 8 

876 if (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR or 

877 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR or 

878 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 or 

879 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 or 

880 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER or 

881 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER or 

882 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER or 

883 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER): 

884 eglFrame[0].planeDesc[1].channelDesc.y = 16 

885 elif (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR or 

886 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER or 

887 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR or 

888 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER): 

889 eglFrame[0].planeDesc[i].height = cueglFrame.height 

890 eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2) 

891 eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2) 

892 elif (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR or 

893 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER or 

894 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR or 

895 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER or 

896 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 or 

897 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR or 

898 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709): 

899 eglFrame[0].planeDesc[i].width = <unsigned int>(cueglFrame.width / 2) 

900 eglFrame[0].planeDesc[i].height = cueglFrame.height 

901 eglFrame[0].planeDesc[i].pitch = <unsigned int>(cueglFrame.pitch / 2) 

902 eglFrame[0].planeDesc[1].channelDesc.y = 8 

903 if (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 or 

904 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR or 

905 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709): 

906 eglFrame[0].planeDesc[1].channelDesc.y = 16 

907 elif (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR or 

908 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER or 

909 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR or 

910 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER): 

911 eglFrame[0].planeDesc[i].height = cueglFrame.height 

912 eglFrame[0].planeDesc[i].width = cueglFrame.width 

913 eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch 

914 elif (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR or 

915 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER or 

916 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR or 

917 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER or 

918 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR or 

919 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR or 

920 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER or 

921 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER or 

922 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER or 

923 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER): 

924 eglFrame[0].planeDesc[i].height = cueglFrame.height 

925 eglFrame[0].planeDesc[i].width = cueglFrame.width 

926 eglFrame[0].planeDesc[i].pitch = cueglFrame.pitch 

927 eglFrame[0].planeDesc[1].channelDesc.y = 8 

928 if (cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR or 

929 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR or 

930 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER or 

931 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER or 

932 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER or 

933 cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER): 

934 eglFrame[0].planeDesc[1].channelDesc.y = 16 

935 if cueglFrame.frameType == cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY: 

936 eglFrame[0].frame.pArray[i] = <cudaArray_t>cueglFrame.frame.pArray[i] 

937 else: 

938 pPtr = make_cudaPitchedPtr(cueglFrame.frame.pPitch[i], eglFrame[0].planeDesc[i].pitch, 

939 eglFrame[0].planeDesc[i].width, eglFrame[0].planeDesc[i].height) 

940 eglFrame[0].frame.pPitch[i] = pPtr 

941  

942 eglFrame[0].planeCount = cueglFrame.planeCount 

943 if cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR: 

944 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420Planar 

945 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR: 

946 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420SemiPlanar 

947 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR: 

948 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV422Planar 

949 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR: 

950 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV422SemiPlanar 

951 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR: 

952 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV444Planar 

953 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR: 

954 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV444SemiPlanar 

955 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422: 

956 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUYV422 

957 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422: 

958 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY422 

959 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709: 

960 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY709 

961 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709_ER: 

962 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY709_ER 

963 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_2020: 

964 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY2020 

965 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB: 

966 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatARGB 

967 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA: 

968 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatRGBA 

969 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR: 

970 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatABGR 

971 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA: 

972 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBGRA 

973 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L: 

974 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatL 

975 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R: 

976 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatR 

977 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A: 

978 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatA 

979 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG: 

980 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatRG 

981 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV: 

982 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatAYUV 

983 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR: 

984 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU444SemiPlanar 

985 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR: 

986 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU422SemiPlanar 

987 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR: 

988 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420SemiPlanar 

989 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR: 

990 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar 

991 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR: 

992 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar 

993 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR: 

994 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar 

995 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR: 

996 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar 

997 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER: 

998 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatVYUY_ER 

999 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER: 

1000 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY_ER 

1001 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER: 

1002 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUYV_ER 

1003 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER: 

1004 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVYU_ER 

1005 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER: 

1006 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUVA_ER 

1007 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER: 

1008 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatAYUV_ER 

1009 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER: 

1010 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV444Planar_ER 

1011 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER: 

1012 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV422Planar_ER 

1013 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER: 

1014 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420Planar_ER 

1015 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER: 

1016 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV444SemiPlanar_ER 

1017 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER: 

1018 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV422SemiPlanar_ER 

1019 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER: 

1020 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420SemiPlanar_ER 

1021 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER: 

1022 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU444Planar_ER 

1023 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER: 

1024 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU422Planar_ER 

1025 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER: 

1026 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420Planar_ER 

1027 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER: 

1028 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU444SemiPlanar_ER 

1029 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER: 

1030 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU422SemiPlanar_ER 

1031 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER: 

1032 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420SemiPlanar_ER 

1033 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB: 

1034 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerRGGB 

1035 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR: 

1036 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerBGGR 

1037 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG: 

1038 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerGRBG 

1039 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG: 

1040 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerGBRG 

1041 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB: 

1042 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10RGGB 

1043 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR: 

1044 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10BGGR 

1045 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG: 

1046 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10GRBG 

1047 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG: 

1048 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10GBRG 

1049 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB: 

1050 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12RGGB 

1051 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR: 

1052 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12BGGR 

1053 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG: 

1054 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12GRBG 

1055 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG: 

1056 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12GBRG 

1057 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB: 

1058 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer14RGGB 

1059 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR: 

1060 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer14BGGR 

1061 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG: 

1062 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer14GRBG 

1063 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG: 

1064 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer14GBRG 

1065 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB: 

1066 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer20RGGB 

1067 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR: 

1068 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer20BGGR 

1069 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG: 

1070 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer20GRBG 

1071 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG: 

1072 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer20GBRG 

1073 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB: 

1074 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerIspRGGB 

1075 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR: 

1076 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerIspBGGR 

1077 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG: 

1078 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerIspGRBG 

1079 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG: 

1080 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerIspGBRG 

1081 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR: 

1082 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU444Planar 

1083 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR: 

1084 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU422Planar 

1085 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR: 

1086 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420Planar 

1087 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR: 

1088 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerBCCR 

1089 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB: 

1090 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerRCCB 

1091 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC: 

1092 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerCRBC 

1093 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC: 

1094 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerCBRC 

1095 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC: 

1096 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10CCCC 

1097 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR: 

1098 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12BCCR 

1099 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB: 

1100 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12RCCB 

1101 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC: 

1102 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12CRBC 

1103 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC: 

1104 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12CBRC 

1105 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC: 

1106 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12CCCC 

1107 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y: 

1108 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY 

1109 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020: 

1110 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420SemiPlanar_2020 

1111 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020: 

1112 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420SemiPlanar_2020 

1113 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020: 

1114 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420Planar_2020 

1115 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020: 

1116 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420Planar_2020 

1117 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709: 

1118 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420SemiPlanar_709 

1119 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709: 

1120 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420SemiPlanar_709 

1121 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709: 

1122 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420Planar_709 

1123 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709: 

1124 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420Planar_709 

1125 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709: 

1126 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_709 

1127 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020: 

1128 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_2020 

1129 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020: 

1130 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar_2020 

1131 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR: 

1132 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar 

1133 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709: 

1134 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar_709 

1135 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER: 

1136 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY_ER 

1137 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER: 

1138 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY_709_ER 

1139 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER: 

1140 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10_ER 

1141 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER: 

1142 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10_709_ER 

1143 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER: 

1144 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12_ER 

1145 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER: 

1146 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12_709_ER 

1147 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA: 

1148 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUVA 

1149 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU: 

1150 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVYU 

1151 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY: 

1152 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatVYUY 

1153 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER: 

1154 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_ER 

1155 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER: 

1156 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER 

1157 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER: 

1158 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar_ER 

1159 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER: 

1160 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER 

1161 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER: 

1162 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar_ER 

1163 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER: 

1164 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER 

1165 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER: 

1166 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar_ER 

1167 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER: 

1168 eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER 

1169 else: 

1170 return cudaErrorInvalidValue 

1171 if cueglFrame.frameType == cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY: 

1172 eglFrame[0].frameType = cyruntime.cudaEglFrameTypeArray 

1173 elif cueglFrame.frameType == cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH: 

1174 eglFrame[0].frameType = cyruntime.cudaEglFrameTypePitch 

1175 else: 

1176 return cudaErrorInvalidValue