gstreamermm
0.10.11
|
An opaque iterator for a Gst::BufferList. More...
Public Types | |
typedef sigc::slot < Glib::RefPtr< Gst::Buffer > , const Glib::RefPtr < Gst::Buffer >& > | SlotProcess |
For example, Glib::RefPtr<Gst::Buffer> on_process(const Glib::RefPtr<Gst::Buffer>& buffer);. | |
Public Member Functions | |
BufferListIterator () | |
Default constructor. | |
BufferListIterator (GstBufferListIterator* castitem, bool take_ownership=true) | |
C object constructor. | |
virtual | ~BufferListIterator () |
Destructor. | |
GstBufferListIterator* | gobj () |
Provides access to the underlying C object. | |
const GstBufferListIterator* | gobj () const |
Provides access to the underlying C object. | |
guint | n_buffers () const |
Returns the number of buffers left to iterate in the current group. | |
void | add (const Glib::RefPtr< Gst::Buffer >& buffer) |
Inserts buffer into the Gst::BufferList iterated with it. | |
void | add_group () |
Inserts a new, empty group into the Gst::BufferList iterated with it. | |
Glib::RefPtr< Gst::Buffer > | next () |
Returns the next buffer in the list iterated with it. | |
Glib::RefPtr< const Gst::Buffer > | next () const |
Returns the next buffer in the list iterated with it. | |
bool | next_group () |
Advance the iterator it to the first buffer in the next group. | |
void | remove () |
Removes the last buffer returned by next() from the Gst::BufferList iterated with it. | |
Glib::RefPtr< Gst::Buffer > | steal () |
Returns the last buffer returned by next() without modifying the refcount of the buffer. | |
void | take (const Glib::RefPtr< Gst::Buffer >& buffer) |
Replaces the last buffer returned by next() with buffer in the Gst::BufferList iterated with it and takes ownership of buffer. | |
Glib::RefPtr< Gst::Buffer > | process (const SlotProcess& slot) |
Calls the given function for the last buffer returned by next(). | |
Glib::RefPtr< Gst::Buffer > | merge_group () |
Merge a buffer list group into a normal Gst::Buffer by copying its metadata and memcpying its data into consecutive memory. | |
Protected Member Functions | |
void | set_gobject (GstBufferListIterator* castitem, bool take_ownership=true) |
Protected Attributes | |
GstBufferListIterator* | gobject_ |
bool | take_ownership |
An opaque iterator for a Gst::BufferList.
typedef sigc::slot< Glib::RefPtr<Gst::Buffer>, const Glib::RefPtr<Gst::Buffer>& > Gst::BufferListIterator::SlotProcess |
For example, Glib::RefPtr<Gst::Buffer> on_process(const Glib::RefPtr<Gst::Buffer>& buffer);.
A slot for processing the last buffer returned by Gst::BufferListIterator::next(). The slot can leave the buffer in the list, replace the buffer in the list or remove the buffer from the list, depending on the return value. If the slot returns 0, the buffer will be removed from the list, otherwise the buffer will be replaced with the returned buffer.
The last buffer returned by Gst::BufferListIterator::next() will be replaced with the buffer returned from the function. If 0 is returned, the buffer will be removed from the list. The list must be writable.
Default constructor.
Gst::BufferListIterator::BufferListIterator | ( | GstBufferListIterator * | castitem, |
bool | take_ownership = true |
||
) | [explicit] |
C object constructor.
castitem | The C object. |
take_ownership | Whether to destroy the C object with the wrapper or not. |
virtual Gst::BufferListIterator::~BufferListIterator | ( | ) | [virtual] |
Destructor.
void Gst::BufferListIterator::add | ( | const Glib::RefPtr< Gst::Buffer >& | buffer | ) |
Inserts buffer into the Gst::BufferList iterated with it.
The buffer is inserted into the current group, immediately before the buffer that would be returned by next(). The buffer is inserted before the implicit cursor, a subsequent call to next() will return the buffer after the inserted buffer, if any.
This function takes ownership of buffer.
buffer | A Gst::Buffer. |
void Gst::BufferListIterator::add_group | ( | ) |
Inserts a new, empty group into the Gst::BufferList iterated with it.
The group is inserted immediately before the group that would be returned by next_group(). A subsequent call to next_group() will advance the iterator to the group after the inserted group, if any.
GstBufferListIterator* Gst::BufferListIterator::gobj | ( | ) | [inline] |
Provides access to the underlying C object.
const GstBufferListIterator* Gst::BufferListIterator::gobj | ( | ) | const [inline] |
Provides access to the underlying C object.
Merge a buffer list group into a normal Gst::Buffer by copying its metadata and memcpying its data into consecutive memory.
All buffers in the current group after the implicit cursor will be merged into one new buffer. The metadata of the new buffer will be a copy of the metadata of the buffer that would be returned by next(). If there is no buffer in the current group after the implicit cursor, 0
will be returned.
This function will not move the implicit cursor or in any other way affect the state of the iterator it or the list.
0
. guint Gst::BufferListIterator::n_buffers | ( | ) | const |
Returns the number of buffers left to iterate in the current group.
I.e. the number of calls that can be made to next() before it returns 0
.
This function will not move the implicit cursor or in any other way affect the state of the iterator it.
Returns the next buffer in the list iterated with it.
If the iterator is at the end of a group, 0
will be returned. This function may be called repeatedly to iterate through the current group.
The caller will not get a new ref to the returned Gst::Buffer and must not unref it.
0
. Glib::RefPtr<const Gst::Buffer> Gst::BufferListIterator::next | ( | ) | const |
Returns the next buffer in the list iterated with it.
If the iterator is at the end of a group, 0
will be returned. This function may be called repeatedly to iterate through the current group.
The caller will not get a new ref to the returned Gst::Buffer and must not unref it.
0
. bool Gst::BufferListIterator::next_group | ( | ) |
Advance the iterator it to the first buffer in the next group.
If the iterator is at the last group, false
will be returned. This function may be called repeatedly to iterate through the groups in a buffer list.
true
if the iterator could be advanced to the next group, false
if the iterator was already at the last group. Glib::RefPtr<Gst::Buffer> Gst::BufferListIterator::process | ( | const SlotProcess& | slot | ) |
Calls the given function for the last buffer returned by next().
next() must have been called on it before this function is called. remove() and steal() must not have been called since the last call to next().
See the SlotProcess docs for more details.
slot | The slot to be called. |
void Gst::BufferListIterator::remove | ( | ) |
Removes the last buffer returned by next() from the Gst::BufferList iterated with it.
next() must have been called on it before this function is called. This function can only be called once per call to next().
The removed buffer is unreffed.
void Gst::BufferListIterator::set_gobject | ( | GstBufferListIterator * | castitem, |
bool | take_ownership = true |
||
) | [protected] |
void Gst::BufferListIterator::take | ( | const Glib::RefPtr< Gst::Buffer >& | buffer | ) |
Replaces the last buffer returned by next() with buffer in the Gst::BufferList iterated with it and takes ownership of buffer.
next() must have been called on it before this function is called. remove() must not have been called since the last call to next().
This function unrefs the replaced buffer if it has not been stolen with steal() and takes ownership of buffer (i.e. the refcount of buffer is not increased).
FIXME 0.11: this conditional taking-ownership is not good for bindings
buffer | A Gst::Buffer. |
GstBufferListIterator* Gst::BufferListIterator::gobject_ [protected] |
bool Gst::BufferListIterator::take_ownership [protected] |