Trait gstreamer::prelude::AllocatorExt[][src]

pub trait AllocatorExt: 'static {
    fn alloc(
        &self,
        size: usize,
        params: Option<&AllocationParams>
    ) -> Result<Memory, BoolError>;
fn set_default(&self); }

Trait containing all Allocator methods.

Implementors

crate::Allocator

Required methods

fn alloc(
    &self,
    size: usize,
    params: Option<&AllocationParams>
) -> Result<Memory, BoolError>
[src]

Use self to allocate a new memory block with memory that is at least size big.

The optional params can specify the prefix and padding for the memory. If None is passed, no flags, no extra prefix/padding and a default alignment is used.

The prefix/padding will be filled with 0 if flags contains [crate::MemoryFlags::ZeroPrefixed] and [crate::MemoryFlags::ZeroPadded] respectively.

When self is None, the default allocator will be used.

The alignment in params is given as a bitmask so that align + 1 equals the amount of bytes to align to. For example, to align to 8 bytes, use an alignment of 7.

size

size of the visible memory area

params

optional parameters

Returns

a new crate::Memory.

fn set_default(&self)[src]

Set the default allocator. This function takes ownership of self.

Loading content...

Implementors

impl<O: IsA<Allocator>> AllocatorExt for O[src]

fn alloc(
    &self,
    size: usize,
    params: Option<&AllocationParams>
) -> Result<Memory, BoolError>
[src]

fn set_default(&self)[src]

Loading content...