Gst::BufferList Class Reference

A grouped scatter data buffer type for data-passing. More...

Inheritance diagram for Gst::BufferList:
[legend]
Collaboration diagram for Gst::BufferList:
[legend]

## Public Types

typedef sigc::slot< bool, Glib::RefPtr< Gst::Buffer > &, guint > | SlotForeach
| For example, Gst::BufferListItem on_foreach(const Glib::RefPtr<Gst::Buffer>& buffer, guint group, guint idx);. More...

## Public Member Functions

void | reference () const
| Increment the reference count for this object. More...
void | unreference () const
| Decrement the reference count for this object. More...
GstBufferList* | gobj ()
| Provides access to the underlying C instance. More...
const GstBufferList* | gobj () const
| Provides access to the underlying C instance. More...
GstBufferList* | gobj_copy () const
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
void | remove (guint idx, guint length)
| Remove length buffers starting from idx in list. More...
Glib::RefPtr< Gst::Buffer > | remove (guint idx)
| Get the buffer at idx. More...
void | add (gint idx, const Glib::RefPtr< Gst::Buffer >& buffer)
| Insert buffer at idx in list. More...
bool | is_writable () const
| Tests if you can safely add buffers and groups into a buffer list. More...
Glib::RefPtr< BufferList > | create_writable ()
| Makes a writable buffer list from the buffer list. More...
void | foreach (const SlotForeach& slot)
| Call slot for each buffer in list. More...
Glib::RefPtr< Gst::Buffer > | get (guint idx)
| Get the buffer at idx. More...
Glib::RefPtr< const Gst::Buffer > | get (guint idx) const
| Get the buffer at idx. More...
Public Member Functions inherited from Gst::MiniObject
void | reference () const
| Increment the reference count for this object. More...
void | unreference () const
| Decrement the reference count for this object. More...
GstMiniObject* | gobj ()
| Provides access to the underlying C instance. More...
const GstMiniObject* | gobj () const
| Provides access to the underlying C instance. More...
GstMiniObject* | gobj_copy () const
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
| ~MiniObject ()
guint | get_flags () const
void | set_flags (const guint& value)
bool | lock (LockFlags flags)
| Lock the mini-object with the specified access mode in flags. More...
void | unlock (LockFlags flags)
| Unlock the mini-object with the specified access mode in flags. More...
bool | is_writable () const
| If mini_object has the LOCKABLE flag set, check if the current EXCLUSIVE lock on object is the only one, this means that changes to the object will not be visible to any other object. More...
Glib::RefPtr< MiniObject > | create_writable ()
| Checks if a mini-object is writable. More...

## Static Public Member Functions

static Glib::RefPtr< BufferList > | create ()

## Protected Member Functions

| BufferList ()
void | operator delete (void*, std::size_t)
Protected Member Functions inherited from Gst::MiniObject
| MiniObject ()
void | operator delete (void*, std::size_t)

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr< Gst::BufferList > | wrap (GstBufferList* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...
Related Functions inherited from Gst::MiniObject
Glib::RefPtr< Gst::MiniObject > | wrap (GstMiniObject* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Detailed Description

A grouped scatter data buffer type for data-passing.

Buffer lists are units of grouped scatter/gather data transfer in GStreamer.

Buffer lists are created with create() and filled with data using a Gst::BufferListIterator. The iterator has no current buffer; its cursor position lies between buffers, immediately before the buffer that would be returned by Gst::BufferListIterator::next(). After iterating to the end of a group the iterator must be advanced to the next group by a call to Gst::BufferListIterator::next_group() before any further calls to Gst::BufferListIterator::next() can return buffers again. The cursor position of a newly created iterator lies before the first group; a call to Gst::BufferListIterator::next_group() is necessary before calls to Gst::BufferListIterator::next() can return buffers.

For more details, see the C API docs.

## Member Typedef Documentation

typedef sigc::slot< bool, Glib::RefPtr<Gst::Buffer>&, guint> Gst::BufferList::SlotForeach

For example, Gst::BufferListItem on_foreach(const Glib::RefPtr<Gst::Buffer>& buffer, guint group, guint idx);.

A slot that will be called from foreach(). The buffer field will be a reference to the buffer at idx in group.

When this function returns Gst::BUFFER_LIST_CONTINUE, the next buffer will be returned. When Gst::BUFFER_LIST_SKIP_GROUP is returned, all remaining buffers in the current group will be skipped and the first buffer of the next group is returned (if any). When Gst::BUFFER_LIST_END is returned, foreach() will return.

When the buffer is set to 0, the item will be removed from the bufferlist. When the buffer has been made writable, the new buffer reference can be assigned to the buffer.

## Constructor & Destructor Documentation

Gst::BufferList::BufferList | ( |  | ) |

protected

## Member Function Documentation

void Gst::BufferList::add | ( | gint | idx,
|  | const Glib::RefPtr< Gst::Buffer >& | buffer
| ) |  |

Insert buffer at idx in list.

Other buffers are moved to make room for this new buffer.

A -1 value for idx will append the buffer at the end.

Parameters

  idx | The index.
  buffer | A Gst::Buffer.

static Glib::RefPtr<BufferList> Gst::BufferList::create | ( |  | ) |

static

Glib::RefPtr<BufferList> Gst::BufferList::create_writable | ( |  | ) |

Makes a writable buffer list from the buffer list.

If the buffer list is already writable, this will simply return the same buffer list. A copy will otherwise be made.

Returns
  The same buffer list if it is writable, otherwise a new copy.

Since 0.10.24

void Gst::BufferList::foreach | ( | const SlotForeach& | slot | ) |

Call slot for each buffer in list.

slot can modify the passed buffer pointer or its contents. The return value of slot define if this function returns or if the remaining buffers in a group should be skipped.

Parameters

  slot | A SlotForeach to call on each buffer.

Since 0.10.24

Glib::RefPtr<Gst::Buffer> Gst::BufferList::get | ( | guint | idx | ) |

Get the buffer at idx.

Parameters

  idx | The index.

Returns
  The buffer at idx in group or `0` when there is no buffer. The buffer remains valid as long as list is valid.

Glib::RefPtr<const Gst::Buffer> Gst::BufferList::get | ( | guint | idx | ) | const

Get the buffer at idx.

Parameters

  idx | The index.

Returns
  The buffer at idx in group or `0` when there is no buffer. The buffer remains valid as long as list is valid.

GstBufferList* Gst::BufferList::gobj | ( |  | ) |

Provides access to the underlying C instance.

const GstBufferList* Gst::BufferList::gobj | ( |  | ) | const

Provides access to the underlying C instance.

GstBufferList* Gst::BufferList::gobj_copy | ( |  | ) | const

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

bool Gst::BufferList::is_writable | ( |  | ) | const

Tests if you can safely add buffers and groups into a buffer list.

Returns
  `true` if the buffer list is writable, `false` otherwise.

Since 0.10.24

void Gst::BufferList::operator delete | ( | void * | ,
|  | std::size_t |
| ) |  |

protected

void Gst::BufferList::reference | ( |  | ) | const

Increment the reference count for this object.

You should never need to do this manually - use the object via a RefPtr instead.

void Gst::BufferList::remove | ( | guint | idx,
|  | guint | length
| ) |  |

Remove length buffers starting from idx in list.

The following buffers are moved to close the gap.

Parameters

  idx | The index.
  length | The amount to remove.

Glib::RefPtr<Gst::Buffer> Gst::BufferList::remove | ( | guint | idx | ) |

Get the buffer at idx.

Parameters

  idx | The index.

Returns
  The buffer at idx in group or `0` when there is no buffer. The buffer remains valid as long as list is valid.

void Gst::BufferList::unreference | ( |  | ) | const

Decrement the reference count for this object.

You should never need to do this manually - use the object via a RefPtr instead.

## Friends And Related Function Documentation

Glib::RefPtr< Gst::BufferList > wrap | ( | GstBufferList * | object,
|  | bool | take_copy = `false`
| ) |  |

related

A Glib::wrap() method for this object.

Parameters

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- gstreamermm/bufferlist.h