• Home
  • Raw
  • Download

Lines Matching refs:resource

402   GstCudaGraphicsResource *resource;  in gst_cuda_graphics_resource_new()  local
408 resource = g_new0 (GstCudaGraphicsResource, 1); in gst_cuda_graphics_resource_new()
409 resource->cuda_context = gst_object_ref (context); in gst_cuda_graphics_resource_new()
411 resource->graphics_context = gst_object_ref (graphics_context); in gst_cuda_graphics_resource_new()
413 return resource; in gst_cuda_graphics_resource_new()
430 resource, guint buffer, CUgraphicsRegisterFlags flags) in gst_cuda_graphics_resource_register_gl_buffer()
434 g_return_val_if_fail (resource != NULL, FALSE); in gst_cuda_graphics_resource_register_gl_buffer()
435 g_return_val_if_fail (resource->registered == FALSE, FALSE); in gst_cuda_graphics_resource_register_gl_buffer()
439 cuda_ret = CuGraphicsGLRegisterBuffer (&resource->resource, buffer, flags); in gst_cuda_graphics_resource_register_gl_buffer()
444 resource->registered = TRUE; in gst_cuda_graphics_resource_register_gl_buffer()
445 resource->type = GST_CUDA_GRAPHICS_RESOURCE_GL_BUFFER; in gst_cuda_graphics_resource_register_gl_buffer()
446 resource->flags = flags; in gst_cuda_graphics_resource_register_gl_buffer()
461 gst_cuda_graphics_resource_unregister (GstCudaGraphicsResource * resource) in gst_cuda_graphics_resource_unregister() argument
463 g_return_if_fail (resource != NULL); in gst_cuda_graphics_resource_unregister()
467 if (!resource->registered) in gst_cuda_graphics_resource_unregister()
470 gst_cuda_result (CuGraphicsUnregisterResource (resource->resource)); in gst_cuda_graphics_resource_unregister()
471 resource->resource = NULL; in gst_cuda_graphics_resource_unregister()
472 resource->registered = FALSE; in gst_cuda_graphics_resource_unregister()
488 gst_cuda_graphics_resource_map (GstCudaGraphicsResource * resource, in gst_cuda_graphics_resource_map() argument
493 g_return_val_if_fail (resource != NULL, NULL); in gst_cuda_graphics_resource_map()
494 g_return_val_if_fail (resource->registered != FALSE, NULL); in gst_cuda_graphics_resource_map()
498 cuda_ret = CuGraphicsResourceSetMapFlags (resource->resource, flags); in gst_cuda_graphics_resource_map()
502 cuda_ret = CuGraphicsMapResources (1, &resource->resource, stream); in gst_cuda_graphics_resource_map()
506 resource->mapped = TRUE; in gst_cuda_graphics_resource_map()
508 return resource->resource; in gst_cuda_graphics_resource_map()
519 gst_cuda_graphics_resource_unmap (GstCudaGraphicsResource * resource, in gst_cuda_graphics_resource_unmap() argument
522 g_return_if_fail (resource != NULL); in gst_cuda_graphics_resource_unmap()
523 g_return_if_fail (resource->registered != FALSE); in gst_cuda_graphics_resource_unmap()
527 if (!resource->mapped) in gst_cuda_graphics_resource_unmap()
530 gst_cuda_result (CuGraphicsUnmapResources (1, &resource->resource, stream)); in gst_cuda_graphics_resource_unmap()
532 resource->mapped = FALSE; in gst_cuda_graphics_resource_unmap()
538 GstCudaGraphicsResource * resource) in unregister_resource_from_gl_thread() argument
540 GstCudaContext *cuda_context = resource->cuda_context; in unregister_resource_from_gl_thread()
547 gst_cuda_graphics_resource_unregister (resource); in unregister_resource_from_gl_thread()
562 gst_cuda_graphics_resource_free (GstCudaGraphicsResource * resource) in gst_cuda_graphics_resource_free() argument
564 g_return_if_fail (resource != NULL); in gst_cuda_graphics_resource_free()
566 if (resource->registered) { in gst_cuda_graphics_resource_free()
568 if (resource->type == GST_CUDA_GRAPHICS_RESOURCE_GL_BUFFER) { in gst_cuda_graphics_resource_free()
569 gst_gl_context_thread_add ((GstGLContext *) resource->graphics_context, in gst_cuda_graphics_resource_free()
571 resource); in gst_cuda_graphics_resource_free()
580 gst_object_unref (resource->cuda_context); in gst_cuda_graphics_resource_free()
581 if (resource->graphics_context) in gst_cuda_graphics_resource_free()
582 gst_object_unref (resource->graphics_context); in gst_cuda_graphics_resource_free()
583 g_free (resource); in gst_cuda_graphics_resource_free()