Package ch.bailu.gtk.gst
Klasse Iterator
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.gst.Iterator
- Alle implementierten Schnittstellen:
PointerInterface
A GstIterator is used to retrieve multiple objects from another object in
a threadsafe way.
Various GStreamer objects provide access to their internal structures using
an iterator.
Note that if calling a GstIterator function results in your code receiving
a refcounted object (with, say, g_value_get_object()), the refcount for that
object will not be increased. Your code is responsible for taking a reference
if it wants to continue using it later.
The basic use pattern of an iterator is as follows:
a threadsafe way.
Various GStreamer objects provide access to their internal structures using
an iterator.
Note that if calling a GstIterator function results in your code receiving
a refcounted object (with, say, g_value_get_object()), the refcount for that
object will not be increased. Your code is responsible for taking a reference
if it wants to continue using it later.
The basic use pattern of an iterator is as follows:
<!-- language="C" --> GstIterator *it = _get_iterator(object); GValue item = G_VALUE_INIT; done = FALSE; while (!done) { switch (gst_iterator_next (it, &item)) { case GST_ITERATOR_OK: ...get/use/change item here... g_value_reset (&item); break; case GST_ITERATOR_RESYNC: ...rollback changes to items... gst_iterator_resync (it); break; case GST_ITERATOR_ERROR: ...wrong parameters were given... done = TRUE; break; case GST_ITERATOR_DONE: done = TRUE; break; } } g_value_unset (&item); gst_iterator_free (it);
https://gstreamer.freedesktop.org/documentation/gstreamer/gi-index.html
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final String
The cookie; the value of the master_cookie when this iterator was
created.static final String
The function to copy the iterator
SeeIterator.OnIteratorCopyFunction.onIteratorCopyFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator, ch.bailu.gtk.gst.Iterator)
static final String
The function to call when the iterator is freed
SeeIterator.OnIteratorFreeFunction.onIteratorFreeFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator)
static final String
The function to be called for each item retrieved
SeeIterator.OnIteratorItemFunction.onIteratorItemFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator, ch.bailu.gtk.gobject.Value)
static final String
The lock protecting the data structure and the cookie.static final String
A pointer to the master cookie.static final String
The function to get the next item in the iterator
SeeIterator.OnIteratorNextFunction.onIteratorNextFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator, ch.bailu.gtk.gobject.Value)
static final String
The iterator that is currently pushed with gst_iterator_push()static final String
The function to call when a resync is needed.static final String
the size of the iteratorstatic final String
The type of the object that this iterator will return -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungIterator
(int size, long type, Mutex lock, Int master_cookie, Iterator.OnIteratorCopyFunction copy, Iterator.OnIteratorNextFunction next, Iterator.OnIteratorItemFunction item, Iterator.OnIteratorResyncFunction resync, Iterator.OnIteratorFreeFunction free) Create a new iterator.Iterator
(PointerContainer pointer) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungcopy()
Copy the iterator and its state.filter
(Iterator.OnCompareFunc func, Value user_data) Create a new iterator from an existing iterator.boolean
findCustom
(Iterator.OnCompareFunc func, Value elem, Pointer user_data) Find the first element in @it that matches the compare function @func.int
fold
(Iterator.OnIteratorFoldFunction func, Value ret, Pointer user_data) Folds @func over the elements of @iter.int
foreach
(Iterator.OnIteratorForeachFunction func, Pointer user_data) Iterate over all element of @it and call the given function @func for
each element.void
free()
Free the iterator.static ClassHandler
int
The cookie; the value of the master_cookie when this iterator was
created.ch.bailu.gtk.gst.JnaIterator.OnIteratorCopyFunction
The function to copy the iterator
SeeIterator.OnIteratorCopyFunction.onIteratorCopyFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator, ch.bailu.gtk.gst.Iterator)
ch.bailu.gtk.gst.JnaIterator.OnIteratorFreeFunction
The function to call when the iterator is freed
SeeIterator.OnIteratorFreeFunction.onIteratorFreeFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator)
ch.bailu.gtk.gst.JnaIterator.OnIteratorItemFunction
The function to be called for each item retrieved
SeeIterator.OnIteratorItemFunction.onIteratorItemFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator, ch.bailu.gtk.gobject.Value)
The lock protecting the data structure and the cookie.A pointer to the master cookie.ch.bailu.gtk.gst.JnaIterator.OnIteratorNextFunction
The function to get the next item in the iterator
SeeIterator.OnIteratorNextFunction.onIteratorNextFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator, ch.bailu.gtk.gobject.Value)
The iterator that is currently pushed with gst_iterator_push()ch.bailu.gtk.gst.JnaIterator.OnIteratorResyncFunction
The function to call when a resync is needed.int
the size of the iteratorlong
The type of the object that this iterator will returnstatic int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
static Iterator
newSingleIterator
(long type, Value object) This #GstIterator is a convenient iterator for the common
case where a #GstIterator needs to be returned but only
a single object has to be considered.int
Get the next item from the iterator in @elem.void
Pushes @other iterator onto @it.void
resync()
Resync the iterator. this function is mostly called
after gst_iterator_next() returned %GST_ITERATOR_RESYNC.void
setFieldCookie
(int cookie) The cookie; the value of the master_cookie when this iterator was
created.void
The function to copy the iterator
SeeIterator.OnIteratorCopyFunction.onIteratorCopyFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator, ch.bailu.gtk.gst.Iterator)
void
The function to call when the iterator is freed
SeeIterator.OnIteratorFreeFunction.onIteratorFreeFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator)
void
The function to be called for each item retrieved
SeeIterator.OnIteratorItemFunction.onIteratorItemFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator, ch.bailu.gtk.gobject.Value)
void
setFieldLock
(Mutex lock) The lock protecting the data structure and the cookie.void
setFieldMasterCookie
(Int master_cookie) A pointer to the master cookie.void
The function to get the next item in the iterator
SeeIterator.OnIteratorNextFunction.onIteratorNextFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator, ch.bailu.gtk.gobject.Value)
void
setFieldPushed
(Iterator pushed) The iterator that is currently pushed with gst_iterator_push()void
The function to call when a resync is needed.void
setFieldSize
(int size) the size of the iteratorvoid
setFieldType
(long type) The type of the object that this iterator will returnVon Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
COPY
The function to copy the iterator
SeeIterator.OnIteratorCopyFunction.onIteratorCopyFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator, ch.bailu.gtk.gst.Iterator)
- Siehe auch:
-
NEXT
The function to get the next item in the iterator
SeeIterator.OnIteratorNextFunction.onIteratorNextFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator, ch.bailu.gtk.gobject.Value)
- Siehe auch:
-
ITEM
The function to be called for each item retrieved
SeeIterator.OnIteratorItemFunction.onIteratorItemFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator, ch.bailu.gtk.gobject.Value)
- Siehe auch:
-
RESYNC
The function to call when a resync is needed.
SeeIterator.OnIteratorResyncFunction.onIteratorResyncFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator)
- Siehe auch:
-
FREE
The function to call when the iterator is freed
SeeIterator.OnIteratorFreeFunction.onIteratorFreeFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator)
- Siehe auch:
-
PUSHED
The iterator that is currently pushed with gst_iterator_push()- Siehe auch:
-
TYPE
The type of the object that this iterator will return- Siehe auch:
-
LOCK
The lock protecting the data structure and the cookie.- Siehe auch:
-
COOKIE
The cookie; the value of the master_cookie when this iterator was
created.- Siehe auch:
-
MASTER_COOKIE
A pointer to the master cookie.- Siehe auch:
-
SIZE
the size of the iterator- Siehe auch:
-
-
Konstruktordetails
-
Iterator
-
Iterator
public Iterator(int size, long type, @Nonnull Mutex lock, @Nonnull Int master_cookie, Iterator.OnIteratorCopyFunction copy, Iterator.OnIteratorNextFunction next, Iterator.OnIteratorItemFunction item, Iterator.OnIteratorResyncFunction resync, Iterator.OnIteratorFreeFunction free) Create a new iterator. This function is mainly used for objects
implementing the next/resync/free function to iterate a data structure.
For each item retrieved, the @item function is called with the lock
held. The @free function is called when the iterator is freed.- Parameter:
size
- the size of the iterator structuretype
- #GType of childrenlock
- pointer to a #GMutex.master_cookie
- pointer to a guint32 that is changed when the items in the iterator changed.copy
- copy functionnext
- function to get next itemitem
- function to call on each item retrievedresync
- function to resync the iteratorfree
- function to free the iterator
-
-
Methodendetails
-
getClassHandler
-
setFieldCopy
The function to copy the iterator
SeeIterator.OnIteratorCopyFunction.onIteratorCopyFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator, ch.bailu.gtk.gst.Iterator)
-
getFieldCopy
public ch.bailu.gtk.gst.JnaIterator.OnIteratorCopyFunction getFieldCopy()The function to copy the iterator
SeeIterator.OnIteratorCopyFunction.onIteratorCopyFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator, ch.bailu.gtk.gst.Iterator)
-
setFieldNext
The function to get the next item in the iterator
SeeIterator.OnIteratorNextFunction.onIteratorNextFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator, ch.bailu.gtk.gobject.Value)
-
getFieldNext
public ch.bailu.gtk.gst.JnaIterator.OnIteratorNextFunction getFieldNext()The function to get the next item in the iterator
SeeIterator.OnIteratorNextFunction.onIteratorNextFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator, ch.bailu.gtk.gobject.Value)
-
setFieldItem
The function to be called for each item retrieved
SeeIterator.OnIteratorItemFunction.onIteratorItemFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator, ch.bailu.gtk.gobject.Value)
-
getFieldItem
public ch.bailu.gtk.gst.JnaIterator.OnIteratorItemFunction getFieldItem()The function to be called for each item retrieved
SeeIterator.OnIteratorItemFunction.onIteratorItemFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator, ch.bailu.gtk.gobject.Value)
-
setFieldResync
The function to call when a resync is needed.
SeeIterator.OnIteratorResyncFunction.onIteratorResyncFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator)
-
getFieldResync
public ch.bailu.gtk.gst.JnaIterator.OnIteratorResyncFunction getFieldResync()The function to call when a resync is needed.
SeeIterator.OnIteratorResyncFunction.onIteratorResyncFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator)
-
setFieldFree
The function to call when the iterator is freed
SeeIterator.OnIteratorFreeFunction.onIteratorFreeFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator)
-
getFieldFree
public ch.bailu.gtk.gst.JnaIterator.OnIteratorFreeFunction getFieldFree()The function to call when the iterator is freed
SeeIterator.OnIteratorFreeFunction.onIteratorFreeFunction(ch.bailu.gtk.lib.handler.CallbackHandler, ch.bailu.gtk.gst.Iterator)
-
setFieldPushed
The iterator that is currently pushed with gst_iterator_push() -
getFieldPushed
The iterator that is currently pushed with gst_iterator_push() -
setFieldType
public void setFieldType(long type) The type of the object that this iterator will return -
getFieldType
public long getFieldType()The type of the object that this iterator will return -
setFieldLock
The lock protecting the data structure and the cookie. -
getFieldLock
The lock protecting the data structure and the cookie. -
setFieldCookie
public void setFieldCookie(int cookie) The cookie; the value of the master_cookie when this iterator was
created. -
getFieldCookie
public int getFieldCookie()The cookie; the value of the master_cookie when this iterator was
created. -
setFieldMasterCookie
A pointer to the master cookie. -
getFieldMasterCookie
A pointer to the master cookie. -
setFieldSize
public void setFieldSize(int size) the size of the iterator -
getFieldSize
public int getFieldSize()the size of the iterator -
newSingleIterator
This #GstIterator is a convenient iterator for the common
case where a #GstIterator needs to be returned but only
a single object has to be considered. This happens often
for the #GstPadIterIntLinkFunction.- Parameter:
type
- #GType of the passed objectobject
- object that this iterator should return- Gibt zurück:
- the new #GstIterator for @object.
-
copy
Copy the iterator and its state.- Gibt zurück:
- a new copy of @it.
-
filter
Create a new iterator from an existing iterator. The new iterator
will only return those elements that match the given compare function @func.
The first parameter that is passed to @func is the #GValue of the current
iterator element and the second parameter is @user_data. @func should
return 0 for elements that should be included in the filtered iterator.
When this iterator is freed, @it will also be freed.- Parameter:
func
- the compare function to select elementsuser_data
- user data passed to the compare function- Gibt zurück:
- a new #GstIterator. MT safe.
-
findCustom
public boolean findCustom(Iterator.OnCompareFunc func, @Nonnull Value elem, @Nullable Pointer user_data) Find the first element in @it that matches the compare function @func.
@func should return 0 when the element is found. The first parameter
to @func will be the current element of the iterator and the
second parameter will be @user_data.
The result will be stored in @elem if a result is found.
The iterator will not be freed.
This function will return %FALSE if an error happened to the iterator
or if the element wasn't found.- Parameter:
func
- the compare function to useelem
- pointer to a #GValue where to store the resultuser_data
- user data passed to the compare function- Gibt zurück:
- Returns %TRUE if the element was found, else %FALSE. MT safe.
-
fold
public int fold(Iterator.OnIteratorFoldFunction func, @Nonnull Value ret, @Nullable Pointer user_data) Folds @func over the elements of @iter. That is to say, @func will be called
as @func (object, @ret, @user_data) for each object in @it. The normal use
of this procedure is to accumulate the results of operating on the objects in
@ret.
This procedure can be used (and is used internally) to implement the
gst_iterator_foreach() and gst_iterator_find_custom() operations.
The fold will proceed as long as @func returns %TRUE. When the iterator has no
more arguments, %GST_ITERATOR_DONE will be returned. If @func returns %FALSE,
the fold will stop, and %GST_ITERATOR_OK will be returned. Errors or resyncs
will cause fold to return %GST_ITERATOR_ERROR or %GST_ITERATOR_RESYNC as
appropriate.
The iterator will not be freed.- Parameter:
func
- the fold functionret
- the seed value passed to the fold functionuser_data
- user data passed to the fold function- Gibt zurück:
- A #GstIteratorResult, as described above. MT safe.
-
foreach
Iterate over all element of @it and call the given function @func for
each element.- Parameter:
func
- the function to call for each element.user_data
- user data passed to the function- Gibt zurück:
- the result call to gst_iterator_fold(). The iterator will not be freed. MT safe.
-
free
public void free()Free the iterator.
MT safe. -
next
Get the next item from the iterator in @elem.
Only when this function returns %GST_ITERATOR_OK, @elem will contain a valid
value. @elem must have been initialized to the type of the iterator or
initialized to zeroes with g_value_unset(). The caller is responsible for
unsetting or resetting @elem with g_value_unset() or g_value_reset()
after usage.
When this function returns %GST_ITERATOR_DONE, no more elements can be
retrieved from @it.
A return value of %GST_ITERATOR_RESYNC indicates that the element list was
concurrently updated. The user of @it should call gst_iterator_resync() to
get the newly updated list.
A return value of %GST_ITERATOR_ERROR indicates an unrecoverable fatal error.- Parameter:
elem
- pointer to hold next element- Gibt zurück:
- The result of the iteration. Unset @elem after usage. MT safe.
-
push
Pushes @other iterator onto @it. All calls performed on @it are
forwarded to @other. If @other returns %GST_ITERATOR_DONE, it is
popped again and calls are handled by @it again.
This function is mainly used by objects implementing the iterator
next function to recurse into substructures.
When gst_iterator_resync() is called on @it, @other will automatically be
popped.
MT safe.- Parameter:
other
- The #GstIterator to push
-
resync
public void resync()Resync the iterator. this function is mostly called
after gst_iterator_next() returned %GST_ITERATOR_RESYNC.
When an iterator was pushed on @it, it will automatically be popped again
with this function.
MT safe. -
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-