Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
appSinkPullSample
and appSinkPullPreroll
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, appSinkTryPullSample
and appSinkTryPullPreroll
,
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" property 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 Nothing
, the appsink
is stopped or in the EOS state. You can check for the EOS state with the
"eos" property or with the appSinkIsEos
method.
The eos signal can also be used to be informed when the EOS state is reached to avoid polling.
Synopsis
- newtype AppSink = AppSink (ManagedPtr AppSink)
- class (GObject o, IsDescendantOf AppSink o) => IsAppSink o
- toAppSink :: (MonadIO m, IsAppSink o) => o -> m AppSink
- appSinkGetBufferListSupport :: (HasCallStack, MonadIO m, IsAppSink a) => a -> m Bool
- appSinkGetCaps :: (HasCallStack, MonadIO m, IsAppSink a) => a -> m (Maybe Caps)
- appSinkGetDrop :: (HasCallStack, MonadIO m, IsAppSink a) => a -> m Bool
- appSinkGetEmitSignals :: (HasCallStack, MonadIO m, IsAppSink a) => a -> m Bool
- appSinkGetMaxBuffers :: (HasCallStack, MonadIO m, IsAppSink a) => a -> m Word32
- appSinkGetWaitOnEos :: (HasCallStack, MonadIO m, IsAppSink a) => a -> m Bool
- appSinkIsEos :: (HasCallStack, MonadIO m, IsAppSink a) => a -> m Bool
- appSinkPullPreroll :: (HasCallStack, MonadIO m, IsAppSink a) => a -> m (Maybe Sample)
- appSinkPullSample :: (HasCallStack, MonadIO m, IsAppSink a) => a -> m (Maybe Sample)
- appSinkSetBufferListSupport :: (HasCallStack, MonadIO m, IsAppSink a) => a -> Bool -> m ()
- appSinkSetCaps :: (HasCallStack, MonadIO m, IsAppSink a) => a -> Maybe Caps -> m ()
- appSinkSetDrop :: (HasCallStack, MonadIO m, IsAppSink a) => a -> Bool -> m ()
- appSinkSetEmitSignals :: (HasCallStack, MonadIO m, IsAppSink a) => a -> Bool -> m ()
- appSinkSetMaxBuffers :: (HasCallStack, MonadIO m, IsAppSink a) => a -> Word32 -> m ()
- appSinkSetWaitOnEos :: (HasCallStack, MonadIO m, IsAppSink a) => a -> Bool -> m ()
- appSinkTryPullPreroll :: (HasCallStack, MonadIO m, IsAppSink a) => a -> Word64 -> m (Maybe Sample)
- appSinkTryPullSample :: (HasCallStack, MonadIO m, IsAppSink a) => a -> Word64 -> m (Maybe Sample)
- constructAppSinkBufferList :: (IsAppSink o, MonadIO m) => Bool -> m (GValueConstruct o)
- getAppSinkBufferList :: (MonadIO m, IsAppSink o) => o -> m Bool
- setAppSinkBufferList :: (MonadIO m, IsAppSink o) => o -> Bool -> m ()
- clearAppSinkCaps :: (MonadIO m, IsAppSink o) => o -> m ()
- constructAppSinkCaps :: (IsAppSink o, MonadIO m) => Caps -> m (GValueConstruct o)
- getAppSinkCaps :: (MonadIO m, IsAppSink o) => o -> m (Maybe Caps)
- setAppSinkCaps :: (MonadIO m, IsAppSink o) => o -> Caps -> m ()
- constructAppSinkDrop :: (IsAppSink o, MonadIO m) => Bool -> m (GValueConstruct o)
- getAppSinkDrop :: (MonadIO m, IsAppSink o) => o -> m Bool
- setAppSinkDrop :: (MonadIO m, IsAppSink o) => o -> Bool -> m ()
- constructAppSinkEmitSignals :: (IsAppSink o, MonadIO m) => Bool -> m (GValueConstruct o)
- getAppSinkEmitSignals :: (MonadIO m, IsAppSink o) => o -> m Bool
- setAppSinkEmitSignals :: (MonadIO m, IsAppSink o) => o -> Bool -> m ()
- getAppSinkEos :: (MonadIO m, IsAppSink o) => o -> m Bool
- constructAppSinkMaxBuffers :: (IsAppSink o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getAppSinkMaxBuffers :: (MonadIO m, IsAppSink o) => o -> m Word32
- setAppSinkMaxBuffers :: (MonadIO m, IsAppSink o) => o -> Word32 -> m ()
- constructAppSinkWaitOnEos :: (IsAppSink o, MonadIO m) => Bool -> m (GValueConstruct o)
- getAppSinkWaitOnEos :: (MonadIO m, IsAppSink o) => o -> m Bool
- setAppSinkWaitOnEos :: (MonadIO m, IsAppSink o) => o -> Bool -> m ()
- type AppSinkEosCallback = IO ()
- afterAppSinkEos :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkEosCallback) -> m SignalHandlerId
- onAppSinkEos :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkEosCallback) -> m SignalHandlerId
- type AppSinkNewPrerollCallback = IO FlowReturn
- afterAppSinkNewPreroll :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkNewPrerollCallback) -> m SignalHandlerId
- onAppSinkNewPreroll :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkNewPrerollCallback) -> m SignalHandlerId
- type AppSinkNewSampleCallback = IO FlowReturn
- afterAppSinkNewSample :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkNewSampleCallback) -> m SignalHandlerId
- onAppSinkNewSample :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkNewSampleCallback) -> m SignalHandlerId
- type AppSinkNewSerializedEventCallback = IO Bool
- afterAppSinkNewSerializedEvent :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkNewSerializedEventCallback) -> m SignalHandlerId
- onAppSinkNewSerializedEvent :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkNewSerializedEventCallback) -> m SignalHandlerId
- type AppSinkPullPrerollCallback = IO (Maybe Sample)
- afterAppSinkPullPreroll :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkPullPrerollCallback) -> m SignalHandlerId
- onAppSinkPullPreroll :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkPullPrerollCallback) -> m SignalHandlerId
- type AppSinkPullSampleCallback = IO (Maybe Sample)
- afterAppSinkPullSample :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkPullSampleCallback) -> m SignalHandlerId
- onAppSinkPullSample :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkPullSampleCallback) -> m SignalHandlerId
- type AppSinkTryPullObjectCallback = Word64 -> IO (Maybe MiniObject)
- afterAppSinkTryPullObject :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkTryPullObjectCallback) -> m SignalHandlerId
- onAppSinkTryPullObject :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkTryPullObjectCallback) -> m SignalHandlerId
- type AppSinkTryPullPrerollCallback = Word64 -> IO (Maybe Sample)
- afterAppSinkTryPullPreroll :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkTryPullPrerollCallback) -> m SignalHandlerId
- onAppSinkTryPullPreroll :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkTryPullPrerollCallback) -> m SignalHandlerId
- type AppSinkTryPullSampleCallback = Word64 -> IO (Maybe Sample)
- afterAppSinkTryPullSample :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkTryPullSampleCallback) -> m SignalHandlerId
- onAppSinkTryPullSample :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkTryPullSampleCallback) -> m SignalHandlerId
Exported types
Memory-managed wrapper type.
Instances
Eq AppSink Source # | |
GObject AppSink Source # | |
Defined in GI.GstApp.Objects.AppSink | |
ManagedPtrNewtype AppSink Source # | |
Defined in GI.GstApp.Objects.AppSink toManagedPtr :: AppSink -> ManagedPtr AppSink | |
TypedObject AppSink Source # | |
Defined in GI.GstApp.Objects.AppSink | |
HasParentTypes AppSink Source # | |
Defined in GI.GstApp.Objects.AppSink | |
IsGValue (Maybe AppSink) Source # | Convert |
Defined in GI.GstApp.Objects.AppSink gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe AppSink -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe AppSink) | |
type ParentTypes AppSink Source # | |
Defined in GI.GstApp.Objects.AppSink type ParentTypes AppSink = '[BaseSink, Element, Object, Object, URIHandler] |
class (GObject o, IsDescendantOf AppSink o) => IsAppSink o Source #
Instances
(GObject o, IsDescendantOf AppSink o) => IsAppSink o Source # | |
Defined in GI.GstApp.Objects.AppSink |
Methods
Click to display all available methods, including inherited ones
Methods
abortState, addControlBinding, addPad, addPropertyDeepNotifyWatch, addPropertyNotifyWatch, bindProperty, bindPropertyFull, callAsync, changeState, continueState, createAllPads, defaultError, doPreroll, forceFloating, foreachPad, foreachSinkPad, foreachSrcPad, freezeNotify, getv, hasActiveControlBindings, hasAncestor, hasAsAncestor, hasAsParent, isAsyncEnabled, isEos, isFloating, isLastSampleEnabled, isLockedState, isQosEnabled, iteratePads, iterateSinkPads, iterateSrcPads, link, linkFiltered, linkPads, linkPadsFiltered, linkPadsFull, lostState, messageFull, messageFullWithDetails, noMorePads, notify, notifyByPspec, postMessage, provideClock, pullPreroll, pullSample, query, queryConvert, queryDuration, queryLatency, queryPosition, ref, refSink, releaseRequestPad, removeControlBinding, removePad, removePropertyNotifyWatch, requestPad, requestPadSimple, runDispose, seek, seekSimple, sendEvent, stealData, stealQdata, suggestNextSync, syncStateWithParent, syncValues, thawNotify, tryPullPreroll, tryPullSample, unlink, unlinkPads, unparent, unref, wait, waitClock, waitPreroll, watchClosure.
Getters
getBaseTime, getBlocksize, getBufferListSupport, getBus, getCaps, getClock, getCompatiblePad, getCompatiblePadTemplate, getContext, getContextUnlocked, getContexts, getControlBinding, getControlRate, getCurrentClockTime, getCurrentRunningTime, getData, getDrop, getDropOutOfSegment, getEmitSignals, getFactory, getGValueArray, getLastSample, getLatency, getMaxBitrate, getMaxBuffers, getMaxLateness, getMetadata, getName, getPadTemplate, getPadTemplateList, getParent, getPathString, getProcessingDeadline, getProperty, getProtocols, getQdata, getRenderDelay, getRequestPad, getStartTime, getState, getStaticPad, getStats, getSync, getThrottleTime, getTsOffset, getUri, getUriType, getValue, getWaitOnEos.
Setters
setAsyncEnabled, setBaseTime, setBlocksize, setBufferListSupport, setBus, setCaps, setClock, setContext, setControlBindingDisabled, setControlBindingsDisabled, setControlRate, setData, setDataFull, setDrop, setDropOutOfSegment, setEmitSignals, setLastSampleEnabled, setLockedState, setMaxBitrate, setMaxBuffers, setMaxLateness, setName, setParent, setProcessingDeadline, setProperty, setQosEnabled, setRenderDelay, setStartTime, setState, setSync, setThrottleTime, setTsOffset, setUri, setWaitOnEos.
getBufferListSupport
appSinkGetBufferListSupport Source #
:: (HasCallStack, MonadIO m, IsAppSink a) | |
=> a |
|
-> m Bool | Returns: |
Check if appsink
supports buffer lists.
Since: 1.12
getCaps
:: (HasCallStack, MonadIO m, IsAppSink a) | |
=> a |
|
-> m (Maybe Caps) | Returns: the |
Get the configured caps on appsink
.
getDrop
:: (HasCallStack, MonadIO m, IsAppSink a) | |
=> a |
|
-> m Bool | Returns: |
Check if appsink
will drop old buffers when the maximum amount of queued
buffers is reached.
getEmitSignals
appSinkGetEmitSignals Source #
:: (HasCallStack, MonadIO m, IsAppSink a) | |
=> a |
|
-> m Bool | Returns: |
Check if appsink will emit the "new-preroll" and "new-sample" signals.
getMaxBuffers
:: (HasCallStack, MonadIO m, IsAppSink a) | |
=> a |
|
-> m Word32 | Returns: The maximum amount of buffers that can be queued. |
Get the maximum amount of buffers that can be queued in appsink
.
getWaitOnEos
:: (HasCallStack, MonadIO m, IsAppSink a) | |
=> a |
|
-> m Bool | Returns: |
Check if appsink
will wait for all buffers to be consumed when an EOS is
received.
isEos
:: (HasCallStack, MonadIO m, IsAppSink a) | |
=> a |
|
-> m Bool | Returns: |
Check if appsink
is EOS, which is when no more samples can be pulled because
an EOS event was received.
This function also returns True
when the appsink is not in the PAUSED or
PLAYING state.
pullPreroll
:: (HasCallStack, MonadIO m, IsAppSink a) | |
=> a |
|
-> m (Maybe Sample) | Returns: a |
Get the last preroll sample in appsink
. 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 appSinkPullSample
.
If an EOS event was received before any buffers, this function returns
Nothing
. 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.
pullSample
:: (HasCallStack, MonadIO m, IsAppSink a) | |
=> a |
|
-> m (Maybe Sample) | Returns: a |
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 buffers 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 buffers could consume a lot of memory, especially when dealing with raw video frames.
If an EOS event was received before any buffers, this function returns
Nothing
. Use gst_app_sink_is_eos () to check for the EOS condition.
setBufferListSupport
appSinkSetBufferListSupport Source #
:: (HasCallStack, MonadIO m, IsAppSink a) | |
=> a |
|
-> Bool |
|
-> m () |
Instruct appsink
to enable or disable buffer list support.
For backwards-compatibility reasons applications need to opt in to indicate that they will be able to handle buffer lists.
Since: 1.12
setCaps
:: (HasCallStack, MonadIO m, IsAppSink a) | |
=> a |
|
-> Maybe Caps |
|
-> m () |
Set 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 incomplete,
you must check the caps on the samples to get the actual used caps.
setDrop
:: (HasCallStack, MonadIO m, IsAppSink a) | |
=> a |
|
-> Bool |
|
-> m () |
Instruct appsink
to drop old buffers when the maximum amount of queued
buffers is reached.
setEmitSignals
appSinkSetEmitSignals Source #
:: (HasCallStack, MonadIO m, IsAppSink a) | |
=> a |
|
-> Bool |
|
-> m () |
Make 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.
setMaxBuffers
:: (HasCallStack, MonadIO m, IsAppSink a) | |
=> a |
|
-> Word32 |
|
-> m () |
Set 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 appsink
.
setWaitOnEos
:: (HasCallStack, MonadIO m, IsAppSink a) | |
=> a |
|
-> Bool |
|
-> m () |
Instruct appsink
to wait for all buffers to be consumed when an EOS is received.
tryPullPreroll
appSinkTryPullPreroll Source #
:: (HasCallStack, MonadIO m, IsAppSink a) | |
=> a |
|
-> Word64 |
|
-> m (Maybe Sample) | Returns: a |
Get the last preroll sample in appsink
. 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 appSinkPullSample
.
If an EOS event was received before any buffers or the timeout expires,
this function returns Nothing
. 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.
Since: 1.10
tryPullSample
:: (HasCallStack, MonadIO m, IsAppSink a) | |
=> a |
|
-> Word64 |
|
-> m (Maybe Sample) | Returns: a |
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 buffers 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 buffers could consume a lot of memory, especially when dealing with raw video frames.
If an EOS event was received before any buffers or the timeout expires,
this function returns Nothing
. Use gst_app_sink_is_eos () to check for the EOS
condition.
Since: 1.10
Properties
bufferList
No description available in the introspection data.
constructAppSinkBufferList :: (IsAppSink o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “buffer-list
” property. This is rarely needed directly, but it is used by new
.
getAppSinkBufferList :: (MonadIO m, IsAppSink o) => o -> m Bool Source #
Get the value of the “buffer-list
” property.
When overloading is enabled, this is equivalent to
get
appSink #bufferList
setAppSinkBufferList :: (MonadIO m, IsAppSink o) => o -> Bool -> m () Source #
Set the value of the “buffer-list
” property.
When overloading is enabled, this is equivalent to
set
appSink [ #bufferList:=
value ]
caps
No description available in the introspection data.
clearAppSinkCaps :: (MonadIO m, IsAppSink o) => o -> m () Source #
Set the value of the “caps
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#caps
constructAppSinkCaps :: (IsAppSink o, MonadIO m) => Caps -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “caps
” property. This is rarely needed directly, but it is used by new
.
getAppSinkCaps :: (MonadIO m, IsAppSink o) => o -> m (Maybe Caps) Source #
Get the value of the “caps
” property.
When overloading is enabled, this is equivalent to
get
appSink #caps
setAppSinkCaps :: (MonadIO m, IsAppSink o) => o -> Caps -> m () Source #
Set the value of the “caps
” property.
When overloading is enabled, this is equivalent to
set
appSink [ #caps:=
value ]
drop
No description available in the introspection data.
constructAppSinkDrop :: (IsAppSink o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “drop
” property. This is rarely needed directly, but it is used by new
.
getAppSinkDrop :: (MonadIO m, IsAppSink o) => o -> m Bool Source #
Get the value of the “drop
” property.
When overloading is enabled, this is equivalent to
get
appSink #drop
setAppSinkDrop :: (MonadIO m, IsAppSink o) => o -> Bool -> m () Source #
Set the value of the “drop
” property.
When overloading is enabled, this is equivalent to
set
appSink [ #drop:=
value ]
emitSignals
No description available in the introspection data.
constructAppSinkEmitSignals :: (IsAppSink o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “emit-signals
” property. This is rarely needed directly, but it is used by new
.
getAppSinkEmitSignals :: (MonadIO m, IsAppSink o) => o -> m Bool Source #
Get the value of the “emit-signals
” property.
When overloading is enabled, this is equivalent to
get
appSink #emitSignals
setAppSinkEmitSignals :: (MonadIO m, IsAppSink o) => o -> Bool -> m () Source #
Set the value of the “emit-signals
” property.
When overloading is enabled, this is equivalent to
set
appSink [ #emitSignals:=
value ]
eos
No description available in the introspection data.
getAppSinkEos :: (MonadIO m, IsAppSink o) => o -> m Bool Source #
Get the value of the “eos
” property.
When overloading is enabled, this is equivalent to
get
appSink #eos
maxBuffers
No description available in the introspection data.
constructAppSinkMaxBuffers :: (IsAppSink o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “max-buffers
” property. This is rarely needed directly, but it is used by new
.
getAppSinkMaxBuffers :: (MonadIO m, IsAppSink o) => o -> m Word32 Source #
Get the value of the “max-buffers
” property.
When overloading is enabled, this is equivalent to
get
appSink #maxBuffers
setAppSinkMaxBuffers :: (MonadIO m, IsAppSink o) => o -> Word32 -> m () Source #
Set the value of the “max-buffers
” property.
When overloading is enabled, this is equivalent to
set
appSink [ #maxBuffers:=
value ]
waitOnEos
No description available in the introspection data.
constructAppSinkWaitOnEos :: (IsAppSink o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “wait-on-eos
” property. This is rarely needed directly, but it is used by new
.
getAppSinkWaitOnEos :: (MonadIO m, IsAppSink o) => o -> m Bool Source #
Get the value of the “wait-on-eos
” property.
When overloading is enabled, this is equivalent to
get
appSink #waitOnEos
setAppSinkWaitOnEos :: (MonadIO m, IsAppSink o) => o -> Bool -> m () Source #
Set the value of the “wait-on-eos
” property.
When overloading is enabled, this is equivalent to
set
appSink [ #waitOnEos:=
value ]
Signals
eos
type AppSinkEosCallback = IO () Source #
Signal that the end-of-stream has been reached. This signal is emitted from the streaming thread.
afterAppSinkEos :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkEosCallback) -> m SignalHandlerId Source #
Connect a signal handler for the eos signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
appSink #eos callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onAppSinkEos :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkEosCallback) -> m SignalHandlerId Source #
Connect a signal handler for the eos signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
appSink #eos callback
newPreroll
type AppSinkNewPrerollCallback = IO FlowReturn Source #
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 appSinkPullPreroll
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.
afterAppSinkNewPreroll :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkNewPrerollCallback) -> m SignalHandlerId Source #
Connect a signal handler for the newPreroll signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
appSink #newPreroll callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onAppSinkNewPreroll :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkNewPrerollCallback) -> m SignalHandlerId Source #
Connect a signal handler for the newPreroll signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
appSink #newPreroll callback
newSample
type AppSinkNewSampleCallback = IO FlowReturn Source #
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 appSinkPullSample
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.
afterAppSinkNewSample :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkNewSampleCallback) -> m SignalHandlerId Source #
Connect a signal handler for the newSample signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
appSink #newSample callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onAppSinkNewSample :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkNewSampleCallback) -> m SignalHandlerId Source #
Connect a signal handler for the newSample signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
appSink #newSample callback
newSerializedEvent
type AppSinkNewSerializedEventCallback = IO Bool Source #
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 AppSink::eos instead.
EOS cannot be pulled either, use appSinkIsEos
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 True
if the event has been handled, which will
skip basesink handling of the event, False
otherwise.
Since: 1.20
afterAppSinkNewSerializedEvent :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkNewSerializedEventCallback) -> m SignalHandlerId Source #
Connect a signal handler for the newSerializedEvent signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
appSink #newSerializedEvent callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onAppSinkNewSerializedEvent :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkNewSerializedEventCallback) -> m SignalHandlerId Source #
Connect a signal handler for the newSerializedEvent signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
appSink #newSerializedEvent callback
pullPreroll
type AppSinkPullPrerollCallback Source #
Get the last preroll sample in appsink
. 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 appSinkPullSample
or the "pull-sample" action signal.
If an EOS event was received before any buffers, this function returns
Nothing
. 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.
afterAppSinkPullPreroll :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkPullPrerollCallback) -> m SignalHandlerId Source #
Connect a signal handler for the pullPreroll signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
appSink #pullPreroll callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onAppSinkPullPreroll :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkPullPrerollCallback) -> m SignalHandlerId Source #
Connect a signal handler for the pullPreroll signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
appSink #pullPreroll callback
pullSample
type AppSinkPullSampleCallback Source #
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" properties.
If an EOS event was received before any buffers, this function returns
Nothing
. Use gst_app_sink_is_eos () to check for the EOS condition.
afterAppSinkPullSample :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkPullSampleCallback) -> m SignalHandlerId Source #
Connect a signal handler for the pullSample signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
appSink #pullSample callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onAppSinkPullSample :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkPullSampleCallback) -> m SignalHandlerId Source #
Connect a signal handler for the pullSample signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
appSink #pullSample callback
tryPullObject
type AppSinkTryPullObjectCallback Source #
= Word64 |
|
-> IO (Maybe MiniObject) | Returns: a |
This function blocks until a sample or an event 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 and events will be put in a queue so that the application can pull them at its own rate. Events can be pulled when the appsink is in the READY, PAUSED or PLAYING state.
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" properties.
This function will only pull serialized events, excluding
the EOS event for which this functions returns
Nothing
. Use appSinkIsEos
to check for the EOS condition.
This signal is a variant of AppSink::tryPullSample: that can be used to handle incoming events as well as samples.
Note that future releases may extend this API to return other object types so make sure that your code is checking for the actual type it is handling.
Since: 1.20
afterAppSinkTryPullObject :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkTryPullObjectCallback) -> m SignalHandlerId Source #
Connect a signal handler for the tryPullObject signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
appSink #tryPullObject callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onAppSinkTryPullObject :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkTryPullObjectCallback) -> m SignalHandlerId Source #
Connect a signal handler for the tryPullObject signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
appSink #tryPullObject callback
tryPullPreroll
type AppSinkTryPullPrerollCallback Source #
= Word64 |
|
-> IO (Maybe Sample) | Returns: a |
Get the last preroll sample in appsink
. 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 appSinkPullSample
or the "pull-sample" action signal.
If an EOS event was received before any buffers or the timeout expires,
this function returns Nothing
. 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.
Since: 1.10
afterAppSinkTryPullPreroll :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkTryPullPrerollCallback) -> m SignalHandlerId Source #
Connect a signal handler for the tryPullPreroll signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
appSink #tryPullPreroll callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onAppSinkTryPullPreroll :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkTryPullPrerollCallback) -> m SignalHandlerId Source #
Connect a signal handler for the tryPullPreroll signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
appSink #tryPullPreroll callback
tryPullSample
type AppSinkTryPullSampleCallback Source #
= Word64 |
|
-> IO (Maybe Sample) | Returns: a |
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" properties.
If an EOS event was received before any buffers or the timeout expires,
this function returns Nothing
. Use gst_app_sink_is_eos () to check
for the EOS condition.
Since: 1.10
afterAppSinkTryPullSample :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkTryPullSampleCallback) -> m SignalHandlerId Source #
Connect a signal handler for the tryPullSample signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
appSink #tryPullSample callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onAppSinkTryPullSample :: (IsAppSink a, MonadIO m) => a -> ((?self :: a) => AppSinkTryPullSampleCallback) -> m SignalHandlerId Source #
Connect a signal handler for the tryPullSample signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
appSink #tryPullSample callback