Functions

dmabuf_memory_get_fd (mem)

drm_dumb_memory_export_dmabuf (mem)

drm_dumb_memory_get_handle (mem)

fd_memory_get_fd (mem)

is_dmabuf_memory (mem)

is_drm_dumb_memory (mem)

is_fd_memory (mem)

is_phys_memory (mem)

phys_memory_get_phys_addr (mem)

Details

GstAllocators.dmabuf_memory_get_fd(mem)[source]
Parameters:

mem (Gst.Memory) – the memory to get the file descriptor

Returns:

the file descriptor associated with the memory, or -1. The file descriptor is still owned by the Gst.Memory. Use dup to take a copy if you intend to use it beyond the lifetime of this Gst.Memory.

Return type:

int

Return the file descriptor associated with mem.

New in version 1.2.

GstAllocators.drm_dumb_memory_export_dmabuf(mem)[source]
Parameters:

mem (Gst.Memory) – the memory to export from

Returns:

a Gst.Memory from GstAllocators.DmaBufAllocator wrapping the exported dma-buf file descriptor.

Return type:

Gst.Memory

Exports a DMABuf from the DRM Bumb buffer object. One can check if this feature is supported using GstAllocators.DRMDumbAllocator.has_prime_export();

New in version 1.24.

GstAllocators.drm_dumb_memory_get_handle(mem)[source]
Parameters:

mem (Gst.Memory) – the memory to get the handle from

Returns:

the DRM buffer object handle associated with the memory, or 0. The handle is still owned by the Gst.Memory and cannot be used beyond the lifetime of this Gst.Memory unless it is being passed to DRM driver, which does handle a refcount internally.

Return type:

int

Return the DRM buffer object handle associated with mem.

New in version 1.24.

GstAllocators.fd_memory_get_fd(mem)[source]
Parameters:

mem (Gst.Memory) – Gst.Memory

Returns:

the fd of mem or -1 when there is no fd on mem

Return type:

int

Get the fd from mem. Call GstAllocators.is_fd_memory() to check if mem has an fd.

New in version 1.6.

GstAllocators.is_dmabuf_memory(mem)[source]
Parameters:

mem (Gst.Memory) – the memory to be check

Returns:

True if mem is dmabuf memory, otherwise False

Return type:

bool

Check if mem is dmabuf memory.

New in version 1.2.

GstAllocators.is_drm_dumb_memory(mem)[source]
Parameters:

mem (Gst.Memory) – the memory to be checked

Returns:

True if mem is DRM Dumb memory, otherwise False

Return type:

bool

New in version 1.24.

GstAllocators.is_fd_memory(mem)[source]
Parameters:

mem (Gst.Memory) – Gst.Memory

Returns:

True when mem has an fd that can be retrieved with GstAllocators.fd_memory_get_fd().

Return type:

bool

Check if mem is memory backed by an fd

New in version 1.6.

GstAllocators.is_phys_memory(mem)[source]
Parameters:

mem (Gst.Memory) – a Gst.Memory

Returns:

whether the memory at mem is backed by physical memory

Return type:

bool

New in version 1.14.

GstAllocators.phys_memory_get_phys_addr(mem)[source]
Parameters:

mem (Gst.Memory) – a Gst.Memory

Returns:

Physical memory address that is backing mem, or 0 if none

Return type:

int

New in version 1.14.