Lines Matching refs:hwctx
84 AVCUDADeviceContext *hwctx = device_ctx->hwctx;
85 CudaFunctions *cu = hwctx->internal->cuda_dl;
89 CHECK_CU(cu->cuCtxPushCurrent(hwctx->cuda_ctx));
100 AVCUDADeviceContext *hwctx = device_ctx->hwctx;
101 CudaFunctions *cu = hwctx->internal->cuda_dl;
108 err = CHECK_CU(cu->cuCtxPushCurrent(hwctx->cuda_ctx));
130 AVCUDADeviceContext *hwctx = device_ctx->hwctx;
132 CudaFunctions *cu = hwctx->internal->cuda_dl;
147 hwctx->internal->cuda_device));
226 AVCUDADeviceContext *hwctx = device_ctx->hwctx;
227 CudaFunctions *cu = hwctx->internal->cuda_dl;
236 ret = CHECK_CU(cu->cuCtxPushCurrent(hwctx->cuda_ctx));
264 ret = CHECK_CU(cu->cuMemcpy2DAsync(&cpy, hwctx->stream));
270 ret = CHECK_CU(cu->cuStreamSynchronize(hwctx->stream));
283 AVCUDADeviceContext *hwctx = device_ctx->hwctx;
285 if (hwctx->internal) {
286 CudaFunctions *cu = hwctx->internal->cuda_dl;
288 if (hwctx->internal->is_allocated && hwctx->cuda_ctx) {
289 if (hwctx->internal->flags & AV_CUDA_USE_PRIMARY_CONTEXT)
290 CHECK_CU(cu->cuDevicePrimaryCtxRelease(hwctx->internal->cuda_device));
292 CHECK_CU(cu->cuCtxDestroy(hwctx->cuda_ctx));
294 hwctx->cuda_ctx = NULL;
297 cuda_free_functions(&hwctx->internal->cuda_dl);
300 av_freep(&hwctx->internal);
305 AVCUDADeviceContext *hwctx = ctx->hwctx;
308 if (!hwctx->internal) {
309 hwctx->internal = av_mallocz(sizeof(*hwctx->internal));
310 if (!hwctx->internal)
314 if (!hwctx->internal->cuda_dl) {
315 ret = cuda_load_functions(&hwctx->internal->cuda_dl, ctx);
330 AVCUDADeviceContext *hwctx = device_ctx->hwctx;
338 cu = hwctx->internal->cuda_dl;
340 hwctx->internal->flags = flags;
343 ret = CHECK_CU(cu->cuDevicePrimaryCtxGetState(hwctx->internal->cuda_device,
352 ret = CHECK_CU(cu->cuDevicePrimaryCtxSetFlags(hwctx->internal->cuda_device,
358 ret = CHECK_CU(cu->cuDevicePrimaryCtxRetain(&hwctx->cuda_ctx,
359 hwctx->internal->cuda_device));
363 ret = CHECK_CU(cu->cuCtxCreate(&hwctx->cuda_ctx, desired_flags,
364 hwctx->internal->cuda_device));
371 hwctx->internal->is_allocated = 1;
374 hwctx->stream = NULL;
399 AVCUDADeviceContext *hwctx = device_ctx->hwctx;
414 cu = hwctx->internal->cuda_dl;
420 ret = CHECK_CU(cu->cuDeviceGet(&hwctx->internal->cuda_device, device_idx));
438 AVCUDADeviceContext *hwctx = device_ctx->hwctx;
457 AVVulkanDeviceContext *vkctx = src_ctx->hwctx;
485 cu = hwctx->internal->cuda_dl;
495 hwctx->internal->cuda_device = -1;
509 hwctx->internal->cuda_device = dev;
514 if (hwctx->internal->cuda_device == -1) {