Documentation
¶
Index ¶
- Constants
- Variables
- func DmaBufAllocatorAlloc(allocator gst.Allocatorrer, fd int, size uint) *gst.Memory
- func DmaBufAllocatorAllocWithFlags(allocator gst.Allocatorrer, fd int, size uint, flags FdMemoryFlags) *gst.Memory
- func DmabufMemoryGetFd(mem *gst.Memory) int
- func FdAllocatorAlloc(allocator gst.Allocatorrer, fd int, size uint, flags FdMemoryFlags) *gst.Memory
- func FdMemoryGetFd(mem *gst.Memory) int
- func IsDmabufMemory(mem *gst.Memory) bool
- func IsFdMemory(mem *gst.Memory) bool
- func IsPhysMemory(mem *gst.Memory) bool
- func PhysMemoryGetPhysAddr(mem *gst.Memory) uintptr
- type DmaBufAllocator
- type DmaBufAllocatorClass
- type DmaBufAllocatorOverrides
- type FdAllocator
- type FdAllocatorClass
- type FdAllocatorOverrides
- type FdMemoryFlags
- type PhysMemoryAllocator
- type PhysMemoryAllocatorInterface
- type PhysMemoryAllocatorrer
Constants ¶
const ALLOCATOR_DMABUF = "dmabuf"
const ALLOCATOR_FD = "fd"
const CAPS_FEATURE_MEMORY_DMABUF = "memory:DMABuf"
CAPS_FEATURE_MEMORY_DMABUF: constant that defines the caps feature name for DMA buffer sharing.
It has to be used for non-mappable dma-buf only, i.e. when the underlying memory is not mappable to user space. Or when the mapped memory contains non meaningful data. It can be the case for protected content or when the user wants explicitly avoid any software post processing.
In these cases all elements between the exported and the importer has to work in passthrough mode. This is done by adding this caps feature.
When the memory is mappable for read and write requests then it is assumes to be a fast path and so this caps feature should not be used. Though according to the dma-buf protocol, while it is mapped it prevents the exporter to migrate the buffer.
This caps feature should not serve at all the purpose of selecting the GST_ALLOCATOR_DMABUF allocator during caps negotiation. When the exporter is the upstream element from the importer point of view, the exporter should try to map the dma buffer at runtime (preferably during decide_allocation phase). When it succeeds for T_MAP_READWRITE this caps feature should not be used. This allows scalers, color converts and any image processing filters to work directly on the dma buffer. In this case the importer element should check all incoming memory using gst_is_dmabuf_memory().
Variables ¶
var (
GTypeDmaBufAllocator = coreglib.Type(C.gst_dmabuf_allocator_get_type())
)
GType values.
var (
GTypeFdAllocator = coreglib.Type(C.gst_fd_allocator_get_type())
)
GType values.
var (
GTypePhysMemoryAllocator = coreglib.Type(C.gst_phys_memory_allocator_get_type())
)
GType values.
Functions ¶
func DmaBufAllocatorAlloc ¶
DmaBufAllocatorAlloc: return a GstMemory that wraps a dmabuf file descriptor.
The function takes the following parameters:
- allocator to be used for this memory.
- fd: dmabuf file descriptor.
- size: memory size.
The function returns the following values:
- memory: gstMemory based on allocator. When the buffer will be released dmabuf allocator will close the fd. The memory is only mmapped on gst_buffer_map() request.
func DmaBufAllocatorAllocWithFlags ¶
func DmaBufAllocatorAllocWithFlags(allocator gst.Allocatorrer, fd int, size uint, flags FdMemoryFlags) *gst.Memory
DmaBufAllocatorAllocWithFlags: return a GstMemory that wraps a dmabuf file descriptor.
The function takes the following parameters:
- allocator to be used for this memory.
- fd: dmabuf file descriptor.
- size: memory size.
- flags: extra FdMemoryFlags.
The function returns the following values:
memory: gstMemory based on allocator.
When the buffer will be released the allocator will close the fd unless the GST_FD_MEMORY_FLAG_DONT_CLOSE flag is specified. The memory is only mmapped on gst_buffer_mmap() request.
func DmabufMemoryGetFd ¶
DmabufMemoryGetFd: return the file descriptor associated with mem.
The function takes the following parameters:
- mem: memory to get the file descriptor.
The function returns the following values:
- gint: file descriptor associated with the memory, or -1. The file descriptor is still owned by the GstMemory. Use dup to take a copy if you intend to use it beyond the lifetime of this GstMemory.
func FdAllocatorAlloc ¶
func FdAllocatorAlloc(allocator gst.Allocatorrer, fd int, size uint, flags FdMemoryFlags) *gst.Memory
FdAllocatorAlloc: return a GstMemory that wraps a generic file descriptor.
The function takes the following parameters:
- allocator to be used for this memory.
- fd: file descriptor.
- size: memory size.
- flags: extra FdMemoryFlags.
The function returns the following values:
- memory: gstMemory based on allocator. When the buffer will be released the allocator will close the fd unless the GST_FD_MEMORY_FLAG_DONT_CLOSE flag is specified. The memory is only mmapped on gst_buffer_map() request.
func FdMemoryGetFd ¶
FdMemoryGetFd: get the fd from mem. Call gst_is_fd_memory() to check if mem has an fd.
The function takes the following parameters:
- mem: Memory.
The function returns the following values:
- gint: fd of mem or -1 when there is no fd on mem.
func IsDmabufMemory ¶
IsDmabufMemory: check if mem is dmabuf memory.
The function takes the following parameters:
- mem: memory to be check.
The function returns the following values:
- ok: TRUE if mem is dmabuf memory, otherwise FALSE.
func IsFdMemory ¶
IsFdMemory: check if mem is memory backed by an fd.
The function takes the following parameters:
- mem: Memory.
The function returns the following values:
- ok: TRUE when mem has an fd that can be retrieved with gst_fd_memory_get_fd().
func IsPhysMemory ¶
The function takes the following parameters:
- mem: Memory.
The function returns the following values:
- ok: whether the memory at mem is backed by physical memory.
func PhysMemoryGetPhysAddr ¶
The function takes the following parameters:
- mem: Memory.
The function returns the following values:
- guintptr: physical memory address that is backing mem, or 0 if none.
Types ¶
type DmaBufAllocator ¶
type DmaBufAllocator struct { FdAllocator // contains filtered or unexported fields }
DmaBufAllocator: base class for allocators with dmabuf-backed memory.
func NewDmaBufAllocator ¶
func NewDmaBufAllocator() *DmaBufAllocator
NewDmaBufAllocator: return a new dmabuf allocator.
The function returns the following values:
- dmaBufAllocator: new dmabuf allocator, or NULL if the allocator isn't available. Use gst_object_unref() to release the allocator after usage.
type DmaBufAllocatorClass ¶
type DmaBufAllocatorClass struct {
// contains filtered or unexported fields
}
DmaBufAllocatorClass: instance of this type is always passed by reference.
func (*DmaBufAllocatorClass) ParentClass ¶
func (d *DmaBufAllocatorClass) ParentClass() *FdAllocatorClass
type DmaBufAllocatorOverrides ¶
type DmaBufAllocatorOverrides struct { }
DmaBufAllocatorOverrides contains methods that are overridable.
type FdAllocator ¶
FdAllocator: base class for allocators with fd-backed memory.
func NewFdAllocator ¶
func NewFdAllocator() *FdAllocator
NewFdAllocator: return a new fd allocator.
The function returns the following values:
- fdAllocator: new fd allocator, or NULL if the allocator isn't available. Use gst_object_unref() to release the allocator after usage.
type FdAllocatorClass ¶
type FdAllocatorClass struct {
// contains filtered or unexported fields
}
FdAllocatorClass: instance of this type is always passed by reference.
func (*FdAllocatorClass) ParentClass ¶
func (f *FdAllocatorClass) ParentClass() *gst.AllocatorClass
type FdAllocatorOverrides ¶
type FdAllocatorOverrides struct { }
FdAllocatorOverrides contains methods that are overridable.
type FdMemoryFlags ¶
FdMemoryFlags various flags to control the operation of the fd backed memory.
const ( // FdMemoryFlagNone: no flag. FdMemoryFlagNone FdMemoryFlags = 0b0 // FdMemoryFlagKeepMapped: once the memory is mapped, keep it mapped until // the memory is destroyed. FdMemoryFlagKeepMapped FdMemoryFlags = 0b1 // FdMemoryFlagMapPrivate: do a private mapping instead of the default // shared mapping. FdMemoryFlagMapPrivate FdMemoryFlags = 0b10 // FdMemoryFlagDontClose: don't close the file descriptor when the memory is // freed. Since: 1.10. FdMemoryFlagDontClose FdMemoryFlags = 0b100 )
func (FdMemoryFlags) Has ¶
func (f FdMemoryFlags) Has(other FdMemoryFlags) bool
Has returns true if f contains other.
func (FdMemoryFlags) String ¶
func (f FdMemoryFlags) String() string
String returns the names in string for FdMemoryFlags.
type PhysMemoryAllocator ¶
PhysMemoryAllocator wraps an interface. This means the user can get the underlying type by calling Cast().
func BasePhysMemoryAllocator ¶
func BasePhysMemoryAllocator(obj PhysMemoryAllocatorrer) *PhysMemoryAllocator
BasePhysMemoryAllocator returns the underlying base object.
type PhysMemoryAllocatorInterface ¶
type PhysMemoryAllocatorInterface struct {
// contains filtered or unexported fields
}
PhysMemoryAllocatorInterface: marker interface for allocators with physical address backed memory
An instance of this type is always passed by reference.
type PhysMemoryAllocatorrer ¶
type PhysMemoryAllocatorrer interface { coreglib.Objector // contains filtered or unexported methods }
PhysMemoryAllocatorrer describes PhysMemoryAllocator's interface methods.