Class StreamCollection
- All Implemented Interfaces:
Proxy
A collection of GstStream that are available.
A GstStreamCollection will be provided by elements that can make those
streams available. Applications can use the collection to show the user
what streams are available by using org.freedesktop.gstreamer.gst.StreamCollectiongetStream
Once posted, a GstStreamCollection is immutable. Updates are made by sending
a new GstStreamCollection message, which may or may not share some of
the GstStream objects from the collection it replaces. The receiver can check
the sender of a stream collection message to know which collection is
obsoleted.
Several elements in a pipeline can provide GstStreamCollection.
Applications can activate streams from a collection by using the
GST_EVENT_SELECT_STREAMS event on a pipeline, bin or element.
- Since:
- 1.10
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classStreamCollection.Builder<B extends StreamCollection.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classGstStreamCollection class structurestatic interfaceFunctional interface declaration of theStreamNotifyCallbackcallback.Nested classes/interfaces inherited from class GstObject
GstObject.DeepNotifyCallback, GstObject.Object$Impl, GstObject.ObjectClassNested classes/interfaces inherited from class InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClassNested classes/interfaces inherited from class GObject
GObject.NotifyCallback -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new StreamCollection.StreamCollection(@Nullable String upstreamId) Create a newGstStreamCollection.StreamCollection(MemorySegment address) Create a StreamCollection instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdd the givenstreamto thecollection.protected StreamCollectionasParent()Return this instance as if it were its parent type.static StreamCollection.Builder<? extends StreamCollection.Builder> builder()AStreamCollection.Builderobject constructs aStreamCollectionwith the specified properties.voidemitStreamNotify(@Nullable String detail, @Nullable Stream propStream, @Nullable ParamSpec prop) Emits the "stream-notify" signal.static MemoryLayoutThe memory layout of the native struct.intgetSize()Get the number of streams this collection contains@Nullable StreamgetStream(int index) Retrieve theGstStreamwith indexindexfrom the collection.static @Nullable TypegetType()Get the GType of the StreamCollection class.@Nullable StringReturns the upstream id of thecollection.onStreamNotify(@Nullable String detail, StreamCollection.StreamNotifyCallback handler) The stream notify signal is used to be notified of property changes to streams within the collection.protected voidstreamNotify(Stream stream, ParamSpec pspec) default signal handler for the stream-notify signalMethods inherited from class GstObject
addControlBinding, checkUniqueness, deepNotify, defaultDeepNotify, defaultError, emitDeepNotify, getControlBinding, getControlRate, getGValueArray, getName, getParent, getPathString, getValue, getValueArray, hasActiveControlBindings, hasAncestor, hasAsAncestor, hasAsParent, onDeepNotify, ref, refSink, removeControlBinding, replace, setControlBindingDisabled, setControlBindingsDisabled, setControlRate, setName, setParent, suggestNextSync, syncValues, unparent, unrefMethods inherited from class GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
StreamCollection
Create a StreamCollection instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
StreamCollection
Create a newGstStreamCollection.- Parameters:
upstreamId- The stream id of the parent stream- Since:
- 1.10
-
StreamCollection
public StreamCollection()Create a new StreamCollection.
-
-
Method Details
-
getType
Get the GType of the StreamCollection class.- Returns:
- the GType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code. -
addStream
Add the givenstreamto thecollection.- Parameters:
stream- theGstStreamto add- Returns:
trueif thestreamwas properly added, elsefalse- Since:
- 1.10
-
getSize
public int getSize()Get the number of streams this collection contains- Returns:
- The number of streams that this StreamCollection contains
- Since:
- 1.10
-
getStream
Retrieve the
GstStreamwith indexindexfrom the collection.The caller should not modify the returned
GstStream- Parameters:
index- Index of the stream to retrieve- Returns:
- A
GstStream - Since:
- 1.10
-
getUpstreamId
Returns the upstream id of thecollection.- Returns:
- The upstream id
- Since:
- 1.10
-
streamNotify
-
onStreamNotify
public SignalConnection<StreamCollection.StreamNotifyCallback> onStreamNotify(@Nullable String detail, StreamCollection.StreamNotifyCallback handler) The stream notify signal is used to be notified of property changes to streams within the collection.- Parameters:
detail- the signal detailhandler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitStreamNotify
public void emitStreamNotify(@Nullable String detail, @Nullable Stream propStream, @Nullable ParamSpec prop) Emits the "stream-notify" signal. SeeonStreamNotify(String, StreamCollection.StreamNotifyCallback). -
builder
AStreamCollection.Builderobject constructs aStreamCollectionwith the specified properties. Use the variousset...()methods to set properties, and finish construction withStreamCollection.Builder.build().- Returns:
- the builder object
-