Functions

buffer_pool_config_get_cuda_alloc_method (config)

buffer_pool_config_get_cuda_stream (config)

buffer_pool_config_set_cuda_alloc_method (config, method)

buffer_pool_config_set_cuda_stream (config, stream)

context_new_cuda_context (cuda_ctx)

cuda_create_user_token ()

cuda_ensure_element_context (element, device_id, cuda_ctx)

cuda_handle_context_query (element, query, cuda_ctx)

cuda_handle_set_context (element, context, device_id, cuda_ctx)

cuda_load_library ()

cuda_memory_init_once ()

cuda_nvrtc_compile (source)

cuda_nvrtc_compile_cubin (source, device)

cuda_nvrtc_load_library ()

is_cuda_memory (mem)

Details

GstCuda.buffer_pool_config_get_cuda_alloc_method(config)
Parameters:

config (Gst.Structure) – a buffer pool config

Return type:

GstCuda.CudaMemoryAllocMethod

Gets configured allocation method

New in version 1.24.

GstCuda.buffer_pool_config_get_cuda_stream(config)
Parameters:

config (Gst.Structure) – a buffer pool config

Returns:

the currently configured GstCuda.CudaStream on config or None if config doesn’t hold GstCuda.CudaStream

Return type:

GstCuda.CudaStream or None

New in version 1.24.

GstCuda.buffer_pool_config_set_cuda_alloc_method(config, method)
Parameters:

Sets allocation method

New in version 1.24.

GstCuda.buffer_pool_config_set_cuda_stream(config, stream)
Parameters:

Sets stream on config

New in version 1.24.

GstCuda.context_new_cuda_context(cuda_ctx)
Parameters:

cuda_ctx (GstCuda.CudaContext) – a GstCuda.CudaContext

Returns:

a new Gst.Context embedding the cuda_ctx

Return type:

Gst.Context

New in version 1.22.

GstCuda.cuda_create_user_token()
Returns:

user token value

Return type:

int

Creates new user token value

New in version 1.24.

GstCuda.cuda_ensure_element_context(element, device_id, cuda_ctx)
Parameters:
Returns:

whether a GstCuda.CudaContext exists in cuda_ctx

cuda_ctx:

the resulting GstCuda.CudaContext

Return type:

(bool, cuda_ctx: GstCuda.CudaContext)

Perform the steps necessary for retrieving a GstCuda.CudaContext from the surrounding elements or from the application using the Gst.Context mechanism.

If the content of cuda_ctx is not None, then no Gst.Context query is necessary for GstCuda.CudaContext.

New in version 1.22.

GstCuda.cuda_handle_context_query(element, query, cuda_ctx)
Parameters:
Returns:

Whether the query was successfully responded to from the passed context.

Return type:

bool

New in version 1.22.

GstCuda.cuda_handle_set_context(element, context, device_id, cuda_ctx)
Parameters:
Returns:

whether the cuda_ctx could be set successfully

cuda_ctx:

location of a GstCuda.CudaContext

Return type:

(bool, cuda_ctx: GstCuda.CudaContext)

Helper function for implementing Gst.Element.do_set_context() in CUDA capable elements.

Retrieves the GstCuda.CudaContext in context and places the result in cuda_ctx.

New in version 1.22.

GstCuda.cuda_load_library()
Returns:

True if the libcuda could be loaded False otherwise

Return type:

bool

Loads the cuda library

New in version 1.22.

GstCuda.cuda_memory_init_once()

Ensures that the GstCuda.CudaAllocator is initialized and ready to be used.

New in version 1.22.

GstCuda.cuda_nvrtc_compile(source)
Parameters:

source (str) – Source code to compile

Return type:

str

New in version 1.22.

GstCuda.cuda_nvrtc_compile_cubin(source, device)
Parameters:
  • source (str) – Source code to compile

  • device (int) – CUDA device

Returns:

Compiled CUDA assembly code if successful, otherwise None

Return type:

str

New in version 1.24.

GstCuda.cuda_nvrtc_load_library()
Returns:

True if the library could be loaded, False otherwise

Return type:

bool

Loads the nvrtc library.

New in version 1.22.

GstCuda.is_cuda_memory(mem)
Parameters:

mem (Gst.Memory) – A Gst.Memory

Return type:

bool

Check if mem is a cuda memory

New in version 1.22.