Class AppSink.Builder<B extends AppSink.Builder<B>>
- Type Parameters:
B- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Enclosing class:
AppSink
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Finish building theAppSinkobject.onEos(AppSink.EosCallback handler) Signal that the end-of-stream has been reached.onNewPreroll(AppSink.NewPrerollCallback handler) Signal that a new preroll sample is available.onNewSample(AppSink.NewSampleCallback handler) Signal that a new sample is available.Signal that a new downstream serialized event is available.Signal that a new propose_allocation query is available.onPullPreroll(AppSink.PullPrerollCallback handler) Get the last preroll sample inappsink.This was the sample that caused the appsink to preroll in the PAUSED state.onPullSample(AppSink.PullSampleCallback handler) This function blocks until a sample or EOS becomes available or the appsink element is set to the READY/NULL state.Get the last preroll sample inappsink.This was the sample that caused the appsink to preroll in the PAUSED state.This function blocks until a sample or EOS becomes available or the appsink element is set to the READY/NULL state or the timeout expires.setBufferList(boolean bufferList) setDrop(boolean drop) setEmitSignals(boolean emitSignals) setMaxBuffers(int maxBuffers) Maximum amount of buffers in the queue (0 = unlimited).setMaxBytes(long maxBytes) Maximum amount of bytes in the queue (0 = unlimited)setMaxTime(long maxTime) Maximum total duration of data in the queue (0 = unlimited)setWaitOnEos(boolean waitOnEos) Wait for all buffers to be processed after receiving an EOS.Methods inherited from class org.freedesktop.gstreamer.base.BaseSink.Builder
setAsync, setBlocksize, setEnableLastSample, setMaxBitrate, setMaxLateness, setProcessingDeadline, setQos, setRenderDelay, setSync, setThrottleTime, setTsOffsetMethods inherited from class org.freedesktop.gstreamer.gst.Element.Builder
onNoMorePads, onPadAdded, onPadRemovedMethods inherited from class org.freedesktop.gstreamer.gst.GstObject.Builder
onDeepNotify, setName, setParentMethods inherited from class org.gnome.gobject.GObject.Builder
onNotifyMethods inherited from class org.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilderobject.
-
-
Method Details
-
build
Finish building theAppSinkobject. This will callGObject.withProperties(org.gnome.glib.Type, java.lang.String[], org.gnome.gobject.Value[])to create a new GObject instance, which is then cast toAppSink.- Overrides:
buildin classBaseSink.Builder<B extends AppSink.Builder<B>>- Returns:
- a new instance of
AppSinkwith the properties that were set in the Builder object.
-
setBufferList
-
setCaps
-
setDrop
-
setEmitSignals
-
setMaxBuffers
Maximum amount of buffers in the queue (0 = unlimited).- Parameters:
maxBuffers- the value for themax-buffersproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setMaxBytes
Maximum amount of bytes in the queue (0 = unlimited)- Parameters:
maxBytes- the value for themax-bytesproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.24
-
setMaxTime
Maximum total duration of data in the queue (0 = unlimited)- Parameters:
maxTime- the value for themax-timeproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.24
-
setWaitOnEos
Wait for all buffers to be processed after receiving an EOS.In cases where it is uncertain if an
appsinkwill have a consumer for its buffers when it receives an EOS, set tofalseto ensure that theappsinkwill not hang.- Parameters:
waitOnEos- the value for thewait-on-eosproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.8
-
onEos
Signal that the end-of-stream has been reached. This signal is emitted from the streaming thread.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-
onNewPreroll
Signal that a new preroll sample is available.This signal is emitted from the streaming thread and only when the "emit-signals" property is
true.The new preroll sample can be retrieved with the "pull-preroll" action signal or gst_app_sink_pull_preroll() either from this signal callback or from any other thread.
Note that this signal is only emitted when the "emit-signals" property is set to
true, which it is not by default for performance reasons.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-
onNewSample
Signal that a new sample is available.This signal is emitted from the streaming thread and only when the "emit-signals" property is
true.The new sample can be retrieved with the "pull-sample" action signal or gst_app_sink_pull_sample() either from this signal callback or from any other thread.
Note that this signal is only emitted when the "emit-signals" property is set to
true, which it is not by default for performance reasons.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-
onNewSerializedEvent
Signal that a new downstream serialized event is available.This signal is emitted from the streaming thread and only when the "emit-signals" property is
true.The new event can be retrieved with the "try-pull-object" action signal or gst_app_sink_pull_object() either from this signal callback or from any other thread.
EOS will not be notified using this signal, use
GstAppSink::eos instead. EOS cannot be pulled either, use gst_app_sink_is_eos() to check for it.Note that this signal is only emitted when the "emit-signals" property is set to
true, which it is not by default for performance reasons.The callback should return
trueif the event has been handled, which will skip basesink handling of the event,falseotherwise.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.20
- See Also:
-
onProposeAllocation
Signal that a new propose_allocation query is available.This signal is emitted from the streaming thread and only when the "emit-signals" property is
true.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.24
- See Also:
-
onPullPreroll
Get the last preroll sample inappsink.This was the sample that caused the appsink to preroll in the PAUSED state.This function is typically used when dealing with a pipeline in the PAUSED state. Calling this function after doing a seek will give the sample right after the seek position.
Calling this function will clear the internal reference to the preroll buffer.
Note that the preroll sample will also be returned as the first sample when calling gst_app_sink_pull_sample() or the "pull-sample" action signal.
If an EOS event was received before any buffers, this function returns
null. Use gst_app_sink_is_eos () to check for the EOS condition.This function blocks until a preroll sample or EOS is received or the appsink element is set to the READY/NULL state.
- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-
onPullSample
This function blocks until a sample or EOS becomes available or the appsink element is set to the READY/NULL state.This function will only return samples when the appsink is in the PLAYING state. All rendered samples will be put in a queue so that the application can pull samples at its own rate.
Note that when the application does not pull samples fast enough, the queued samples could consume a lot of memory, especially when dealing with raw video frames. It's possible to control the behaviour of the queue with the "drop" and "max-buffers" / "max-bytes" / "max-time" set of properties.
If an EOS event was received before any buffers, this function returns
null. Use gst_app_sink_is_eos () to check for the EOS condition.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-
onTryPullPreroll
Get the last preroll sample inappsink.This was the sample that caused the appsink to preroll in the PAUSED state.This function is typically used when dealing with a pipeline in the PAUSED state. Calling this function after doing a seek will give the sample right after the seek position.
Calling this function will clear the internal reference to the preroll buffer.
Note that the preroll sample will also be returned as the first sample when calling gst_app_sink_pull_sample() or the "pull-sample" action signal.
If an EOS event was received before any buffers or the timeout expires, this function returns
null. Use gst_app_sink_is_eos () to check for the EOS condition.This function blocks until a preroll sample or EOS is received, the appsink element is set to the READY/NULL state, or the timeout expires.
- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.10
- See Also:
-
onTryPullSample
This function blocks until a sample or EOS becomes available or the appsink element is set to the READY/NULL state or the timeout expires.This function will only return samples when the appsink is in the PLAYING state. All rendered samples will be put in a queue so that the application can pull samples at its own rate.
Note that when the application does not pull samples fast enough, the queued samples could consume a lot of memory, especially when dealing with raw video frames. It's possible to control the behaviour of the queue with the "drop" and "max-buffers" / "max-bytes" / "max-time" set of properties.
If an EOS event was received before any buffers or the timeout expires, this function returns
null. Use gst_app_sink_is_eos () to check for the EOS condition.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 1.10
- See Also:
-