Class: Gst::Allocator

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Overview

The Gst::Allocator is used to create new memory.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Object

#add_control_binding, check_uniqueness, #control_bindings_disabled=, #control_rate, #control_rate=, default_deep_notify, #default_error, #get_control_binding, #get_g_value_array, #get_value, #get_value_array, #has_active_control_bindings, #has_ancestor, #has_as_ancestor, #has_as_parent, #name, #name=, #parent, #parent=, #path_string, #ref, ref_sink, #remove_control_binding, replace, #set_control_binding_disabled, #suggest_next_sync, #sync_values, #unparent, #unref

Class Method Details

.find(name) ⇒ Gst::Allocator

Find a previously registered allocator with name. When name is nil, the default allocator will be returned. the allocator with name was not registered.

Parameters:

  • name (String)

    the name of the allocator

Returns:

.register(name, allocator) ⇒ nil

Registers the memory allocator with name.

Parameters:

  • name (String)

    the name of the allocator

  • allocator (Gst::Allocator)

    Gst::Allocator

Returns:

  • (nil)

Instance Method Details

#alloc(size, params) ⇒ Gst::Memory

Use allocator 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 nil 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 #GST_MEMORY_FLAG_ZERO_PREFIXED and #GST_MEMORY_FLAG_ZERO_PADDED respectively.

When allocator is nil, 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.

Parameters:

  • size (Integer)

    size of the visible memory area

  • params (Gst::AllocationParams)

    optional parameters

Returns:

  • (Gst::Memory)

    a new Gst::Memory.

#free(memory) ⇒ nil

Free memory that was previously allocated with gst_allocator_alloc().

Parameters:

  • memory (Gst::Memory)

    the memory to free

Returns:

  • (nil)

#set_defaultnil

Set the default allocator.

Returns:

  • (nil)