gstapp.app_sink
Module for [AppSink] class
Types 3
Appsink is a sink plugin that supports many different methods for making the application get a handle on the GStreamer data in a pipeline. Unlike most GStreamer elements, Appsink provides external API functions.
appsink can be used by linking to the gstappsink.h header file to access the methods or by using the appsink action signals and properties.
The normal way of retrieving samples from appsink is by using the gstapp.app_sink.AppSink.pullSample and gstapp.app_sink.AppSink.pullPreroll methods. These methods block until a sample becomes available in the sink or when the sink is shut down or reaches EOS. There are also timed variants of these methods, gstapp.app_sink.AppSink.tryPullSample and gstapp.app_sink.AppSink.tryPullPreroll, which accept a timeout parameter to limit the amount of time to wait.
Appsink will internally use a queue to collect buffers from the streaming thread. If the application is not pulling samples fast enough, this queue will consume a lot of memory over time. The "max-buffers", "max-time" and "max-bytes" properties can be used to limit the queue size. The "drop" property controls whether the streaming thread blocks or if older buffers are dropped when the maximum queue size is reached. Note that blocking the streaming thread can negatively affect real-time performance and should be avoided.
If a blocking behaviour is not desirable, setting the "emit-signals" property to true will make appsink emit the "new-sample" and "new-preroll" signals when a sample can be pulled without blocking.
The "caps" property on appsink can be used to control the formats that appsink can receive. This property can contain non-fixed caps, the format of the pulled samples can be obtained by getting the sample caps.
If one of the pull-preroll or pull-sample methods return null, the appsink is stopped or in the EOS state. You can check for the EOS state with the "eos" property or with the gstapp.app_sink.AppSink.isEos method.
The eos signal can also be used to be informed when the EOS state is reached to avoid polling.
AppSinkGidBuilder builder() static nothrowGet builder for [gstapp.app_sink.AppSink] Returns: New builder objectuint maxBuffers() @property nothrowGet `maxBuffers` property. Returns: Maximum amount of buffers in the queue (0 = unlimited).void maxBuffers(uint propval) @property nothrowSet `maxBuffers` property. Params: propval = Maximum amount of buffers in the queue (0 = unlimited).ulong maxBytes() @property nothrowGet `maxBytes` property. Returns: Maximum amount of bytes in the queue (0 = unlimited)void maxBytes(ulong propval) @property nothrowSet `maxBytes` property. Params: propval = Maximum amount of bytes in the queue (0 = unlimited)ulong maxTime() @property nothrowGet `maxTime` property. Returns: Maximum total duration of data in the queue (0 = unlimited)void maxTime(ulong propval) @property nothrowSet `maxTime` property. Params: propval = Maximum total duration of data in the queue (0 = unlimited)bool waitOnEos() @property nothrowGet `waitOnEos` property. Returns: Wait for all buffers to be processed after receiving an EOS.void waitOnEos(bool propval) @property nothrowSet `waitOnEos` property. Params: propval = Wait for all buffers to be processed after receiving an EOS.bool getBufferListSupport() nothrowCheck if appsink supports buffer lists. Returns: true if appsink supports buffer lists.gst.caps.Caps getCaps() nothrowGet the configured caps on appsink. Returns: the #GstCaps accepted by the sink. gst_caps_unref() after usage.bool getDrop() nothrowCheck if appsink will drop old buffers when the maximum amount of queued data is reached (meaning max buffers, time or bytes limit, whichever is hit first). Returns: true if appsink is dropping old...bool getEmitSignals() nothrowCheck if appsink will emit the "new-preroll" and "new-sample" signals. Returns: true if appsink is emitting the "new-preroll" and "new-sample" signals.uint getMaxBuffers() nothrowGet the maximum amount of buffers that can be queued in appsink. Returns: The maximum amount of buffers that can be queued.ulong getMaxBytes() nothrowGet the maximum total size, in bytes, that can be queued in appsink. Returns: The maximum amount of bytes that can be queuedgst.types.ClockTime getMaxTime() nothrowGet the maximum total duration that can be queued in appsink. Returns: The maximum total duration that can be queued.bool getWaitOnEos() nothrowCheck if appsink will wait for all buffers to be consumed when an EOS is received. Returns: true if appsink will wait for all buffers to be consumed when an EOS is received.bool isEos() nothrowCheck if appsink is EOS, which is when no more samples can be pulled because an EOS event was received.gst.sample.Sample pullPreroll() nothrowGet the last preroll sample in appsink. This was the sample that caused the appsink to preroll in the PAUSED state.gst.sample.Sample pullSample() nothrowThis function blocks until a sample or EOS becomes available or the appsink element is set to the READY/NULL state.void setBufferListSupport(bool enableLists) nothrowInstruct appsink to enable or disable buffer list support.void setCaps(gst.caps.Caps caps = null) nothrowSet the capabilities on the appsink element. This function takes a copy of the caps structure. After calling this method, the sink will only accept caps that match caps. If caps is non-fixed, or i...void setDrop(bool drop) nothrowInstruct appsink to drop old buffers when the maximum amount of queued data is reached, that is, when any configured limit is hit (max-buffers, max-time or max-bytes).void setEmitSignals(bool emit) nothrowMake appsink emit the "new-preroll" and "new-sample" signals. This option is by default disabled because signal emission is expensive and unneeded when the application prefers to operate in pull mode.void setMaxBuffers(uint max) nothrowSet the maximum amount of buffers that can be queued in appsink. After this amount of buffers are queued in appsink, any more buffers will block upstream elements until a sample is pulled from apps...void setMaxBytes(ulong max) nothrowSet the maximum total size that can be queued in appsink. After this amount of buffers are queued in appsink, any more buffers will block upstream elements until a sample is pulled from appsink, un...void setMaxTime(gst.types.ClockTime max) nothrowSet the maximum total duration that can be queued in appsink. After this amount of buffers are queued in appsink, any more buffers will block upstream elements until a sample is pulled from appsink...void setWaitOnEos(bool wait) nothrowInstruct appsink to wait for all buffers to be consumed when an EOS is received.gst.sample.Sample tryPullPreroll(gst.types.ClockTime timeout) nothrowGet the last preroll sample in appsink. This was the sample that caused the appsink to preroll in the PAUSED state.gst.sample.Sample tryPullSample(gst.types.ClockTime timeout) nothrowThis function blocks until a sample or EOS becomes available or the appsink element is set to the READY/NULL state or the timeout expires.gulong connectEos(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gstapp.app_sink.AppSink)))
&& Parameters!T.length < 2) nothrowConnect to `Eos` signal.gulong connectNewPreroll(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == gst.types.FlowReturn)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gstapp.app_sink.AppSink)))
&& Parameters!T.length < 2) nothrowConnect to `NewPreroll` signal.gulong connectNewSample(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == gst.types.FlowReturn)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gstapp.app_sink.AppSink)))
&& Parameters!T.length < 2) nothrowConnect to `NewSample` signal.gulong connectNewSerializedEvent(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == bool)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gstapp.app_sink.AppSink)))
&& Parameters!T.length < 2) nothrowConnect to `NewSerializedEvent` signal.gulong connectProposeAllocation(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == bool)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == gst.query.Query)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gstapp.app_sink.AppSink)))
&& Parameters!T.length < 3) nothrowConnect to `ProposeAllocation` signal.gulong connectPullPreroll(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == gst.sample.Sample)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gstapp.app_sink.AppSink)))
&& Parameters!T.length < 2) nothrowConnect to `PullPreroll` signal.gulong connectPullSample(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == gst.sample.Sample)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gstapp.app_sink.AppSink)))
&& Parameters!T.length < 2) nothrowConnect to `PullSample` signal.gulong connectTryPullObject(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == gst.mini_object.MiniObject)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == ulong)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gstapp.app_sink.AppSink)))
&& Parameters!T.length < 3) nothrowConnect to `TryPullObject` signal.gulong connectTryPullPreroll(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == gst.sample.Sample)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == ulong)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gstapp.app_sink.AppSink)))
&& Parameters!T.length < 3) nothrowConnect to `TryPullPreroll` signal.gulong connectTryPullSample(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == gst.sample.Sample)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == ulong)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gstapp.app_sink.AppSink)))
&& Parameters!T.length < 3) nothrowConnect to `TryPullSample` signal.Fluent builder implementation template for gstapp.app_sink.AppSink
T bufferList(bool propval) nothrowT caps(gst.caps.Caps propval) nothrowT drop(bool propval) nothrowT emitSignals(bool propval) nothrowT maxBuffers(uint propval) nothrowSet `maxBuffers` property. Params: propval = Maximum amount of buffers in the queue (0 = unlimited). Returns: Builder instance for fluent chainingT maxBytes(ulong propval) nothrowSet `maxBytes` property. Params: propval = Maximum amount of bytes in the queue (0 = unlimited) Returns: Builder instance for fluent chainingT maxTime(ulong propval) nothrowSet `maxTime` property. Params: propval = Maximum total duration of data in the queue (0 = unlimited) Returns: Builder instance for fluent chainingT waitOnEos(bool propval) nothrowSet `waitOnEos` property. Params: propval = Wait for all buffers to be processed after receiving an EOS.Fluent builder for gstapp.app_sink.AppSink