GstCuda.CudaAllocator¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class GstCuda.CudaAllocator(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A
Gst.Allocator
subclass for cuda memoryNew in version 1.22.
- alloc(context, stream, info)¶
- Parameters:
context (
GstCuda.CudaContext
) – aGstCuda.CudaContext
stream (
GstCuda.CudaStream
orNone
) – aGstCuda.CudaStream
info (
GstVideo.VideoInfo
) – aGstVideo.VideoInfo
- Returns:
a newly allocated
GstCuda.CudaMemory
- Return type:
Gst.Memory
orNone
New in version 1.22.
- alloc_wrapped(context, stream, info, dev_ptr, user_data, notify)¶
- Parameters:
context (
GstCuda.CudaContext
) – aGstCuda.CudaContext
stream (
GstCuda.CudaStream
orNone
) – aGstCuda.CudaStream
info (
GstVideo.VideoInfo
) – aGstVideo.VideoInfo
dev_ptr (
int
) – a CUdeviceptr CUDA device memorynotify (
GLib.DestroyNotify
orNone
) – Called with user_data when the memory is freed
- Returns:
a new
Gst.Memory
- Return type:
Allocates a new memory that wraps the given CUDA device memory.
info must represent actual memory layout, in other words, offset, stride and size fields of info should be matched with memory layout of dev_ptr
By default, wrapped dev_ptr will be freed at the time when
Gst.Memory
is freed if notify isNone
. Otherwise, if caller sets notify, freeing dev_ptr is callers responsibility and defaultGstCuda.CudaAllocator
will not free it.New in version 1.24.
- set_active(active)¶
- Parameters:
active (
bool
) – the new active state- Returns:
True
if active state of self was successfully updated.- Return type:
Controls the active state of self. Default
GstCuda.CudaAllocator
is stateless and therefore active state is ignored, but subclass implementation (e.g.,GstCuda.CudaPoolAllocator
) will require explicit active state control for its internal resource management.This method is conceptually identical to
Gst.BufferPool.set_active
method.New in version 1.24.
- virtual_alloc(context, stream, info, prop, granularity_flags)¶
- Parameters:
context (
GstCuda.CudaContext
) – aGstCuda.CudaContext
stream (
GstCuda.CudaStream
) – aGstCuda.CudaStream
info (
GstVideo.VideoInfo
) – aGstVideo.VideoInfo
prop (
CudaGst.memAllocationProp
) – allocation propertygranularity_flags (
CudaGst.memAllocationGranularity_flags
) – allocation flags
- Returns:
a newly allocated memory object or
None
if allocation is not supported- Return type:
Gst.Memory
orNone
Allocates new
Gst.Memory
object with CUDA virtual memory.New in version 1.24.
- do_set_active(active) virtual¶
- Parameters:
active (
bool
) – the new active state- Returns:
True
if active state of allocator was successfully updated.- Return type:
Controls the active state of allocator. Default
GstCuda.CudaAllocator
is stateless and therefore active state is ignored, but subclass implementation (e.g.,GstCuda.CudaPoolAllocator
) will require explicit active state control for its internal resource management.This method is conceptually identical to
Gst.BufferPool.set_active
method.New in version 1.24.