GstCuda.CudaAllocator

g GObject.InitiallyUnowned GObject.InitiallyUnowned Gst.Object Gst.Object GObject.InitiallyUnowned->Gst.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gst.Allocator Gst.Allocator GstCuda.CudaAllocator GstCuda.CudaAllocator Gst.Allocator->GstCuda.CudaAllocator Gst.Object->Gst.Allocator

Subclasses:

GstCuda.CudaPoolAllocator

Methods

Inherited:

Gst.Allocator (5), Gst.Object (27), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

alloc (context, stream, info)

alloc_wrapped (context, stream, info, dev_ptr, user_data, notify)

set_active (active)

virtual_alloc (context, stream, info, prop, granularity_flags)

Virtual Methods

Inherited:

Gst.Allocator (2), Gst.Object (1), GObject.Object (7)

do_set_active (active)

Properties

Inherited:

Gst.Object (2)

Signals

Inherited:

Gst.Object (1), GObject.Object (1)

Fields

Inherited:

Gst.Object (1), GObject.Object (1)

Name

Type

Access

Description

parent

Gst.Allocator

r

Class Details

class GstCuda.CudaAllocator(**kwargs)
Bases:

Gst.Allocator

Abstract:

No

Structure:

GstCuda.CudaAllocatorClass

A Gst.Allocator subclass for cuda memory

New in version 1.22.

alloc(context, stream, info)
Parameters:
Returns:

a newly allocated GstCuda.CudaMemory

Return type:

Gst.Memory or None

New in version 1.22.

alloc_wrapped(context, stream, info, dev_ptr, user_data, notify)
Parameters:
Returns:

a new Gst.Memory

Return type:

Gst.Memory

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 is None. Otherwise, if caller sets notify, freeing dev_ptr is callers responsibility and default GstCuda.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:

bool

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:
Returns:

a newly allocated memory object or None if allocation is not supported

Return type:

Gst.Memory or None

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:

bool

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.