gi-gstapp-1.0.28: GStreamerApp bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.GstApp.Objects.AppSink

Description

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

Exported types

newtype AppSink Source #

Memory-managed wrapper type.

Constructors

AppSink (ManagedPtr AppSink) 

Instances

Instances details
Eq AppSink Source # 
Instance details

Defined in GI.GstApp.Objects.AppSink

Methods

(==) :: AppSink -> AppSink -> Bool #

(/=) :: AppSink -> AppSink -> Bool #

GObject AppSink Source # 
Instance details

Defined in GI.GstApp.Objects.AppSink

ManagedPtrNewtype AppSink Source # 
Instance details

Defined in GI.GstApp.Objects.AppSink

Methods

toManagedPtr :: AppSink -> ManagedPtr AppSink

TypedObject AppSink Source # 
Instance details

Defined in GI.GstApp.Objects.AppSink

Methods

glibType :: IO GType

HasParentTypes AppSink Source # 
Instance details

Defined in GI.GstApp.Objects.AppSink

IsGValue (Maybe AppSink) Source #

Convert AppSink to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.GstApp.Objects.AppSink

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe AppSink -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe AppSink)

type ParentTypes AppSink Source # 
Instance details

Defined in GI.GstApp.Objects.AppSink

type ParentTypes AppSink = '[BaseSink, Element, Object, Object, URIHandler]

class (GObject o, IsDescendantOf AppSink o) => IsAppSink o Source #

Type class for types which can be safely cast to AppSink, for instance with toAppSink.

Instances

Instances details
(GObject o, IsDescendantOf AppSink o) => IsAppSink o Source # 
Instance details

Defined in GI.GstApp.Objects.AppSink

toAppSink :: (MonadIO m, IsAppSink o) => o -> m AppSink Source #

Cast to AppSink, for types for which this is known to be safe. For general casts, use castTo.

Methods

Click to display all available methods, including inherited ones

Expand

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 #

Arguments

:: (HasCallStack, MonadIO m, IsAppSink a) 
=> a

appsink: a AppSink

-> m Bool

Returns: True if appsink supports buffer lists.

Check if appsink supports buffer lists.

Since: 1.12

getCaps

appSinkGetCaps Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppSink a) 
=> a

appsink: a AppSink

-> m (Maybe Caps)

Returns: the Caps accepted by the sink. gst_caps_unref() after usage.

Get the configured caps on appsink.

getDrop

appSinkGetDrop Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppSink a) 
=> a

appsink: a AppSink

-> m Bool

Returns: True if appsink is dropping old buffers when the queue is filled.

Check if appsink will drop old buffers when the maximum amount of queued buffers is reached.

getEmitSignals

appSinkGetEmitSignals Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppSink a) 
=> a

appsink: a AppSink

-> m Bool

Returns: True if appsink is emitting the "new-preroll" and "new-sample" signals.

Check if appsink will emit the "new-preroll" and "new-sample" signals.

getMaxBuffers

appSinkGetMaxBuffers Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppSink a) 
=> a

appsink: a AppSink

-> 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

appSinkGetWaitOnEos Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppSink a) 
=> a

appsink: a AppSink

-> m Bool

Returns: True if appsink will wait for all buffers to be consumed when an EOS is received.

Check if appsink will wait for all buffers to be consumed when an EOS is received.

isEos

appSinkIsEos Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppSink a) 
=> a

appsink: a AppSink

-> m Bool

Returns: True if no more samples can be pulled and the appsink is EOS.

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

appSinkPullPreroll Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppSink a) 
=> a

appsink: a AppSink

-> m (Maybe Sample)

Returns: a Sample or NULL when the appsink is stopped or EOS. Call gst_sample_unref() after usage.

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

appSinkPullSample Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppSink a) 
=> a

appsink: a AppSink

-> m (Maybe Sample)

Returns: a Sample or NULL when the appsink is stopped or EOS. Call gst_sample_unref() after usage.

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 #

Arguments

:: (HasCallStack, MonadIO m, IsAppSink a) 
=> a

appsink: a AppSink

-> Bool

enableLists: enable or disable buffer list support

-> 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

appSinkSetCaps Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppSink a) 
=> a

appsink: a AppSink

-> Maybe Caps

caps: caps to set

-> 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

appSinkSetDrop Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppSink a) 
=> a

appsink: a AppSink

-> Bool

drop: the new state

-> m () 

Instruct appsink to drop old buffers when the maximum amount of queued buffers is reached.

setEmitSignals

appSinkSetEmitSignals Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppSink a) 
=> a

appsink: a AppSink

-> Bool

emit: the new state

-> 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

appSinkSetMaxBuffers Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppSink a) 
=> a

appsink: a AppSink

-> Word32

max: the maximum number of buffers to queue

-> 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

appSinkSetWaitOnEos Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppSink a) 
=> a

appsink: a AppSink

-> Bool

wait: the new state

-> m () 

Instruct appsink to wait for all buffers to be consumed when an EOS is received.

tryPullPreroll

appSinkTryPullPreroll Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppSink a) 
=> a

appsink: a AppSink

-> Word64

timeout: the maximum amount of time to wait for the preroll sample

-> m (Maybe Sample)

Returns: a Sample or NULL when the appsink is stopped or EOS or the timeout expires. Call gst_sample_unref() after usage.

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

appSinkTryPullSample Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppSink a) 
=> a

appsink: a AppSink

-> Word64

timeout: the maximum amount of time to wait for a sample

-> m (Maybe Sample)

Returns: a Sample or NULL when the appsink is stopped or EOS or the timeout expires. Call gst_sample_unref() after usage.

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 #

Arguments

 = IO (Maybe Sample)

Returns: a Sample or NULL when the appsink is stopped or EOS.

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 #

Arguments

 = IO (Maybe Sample)

Returns: a Sample or NULL when the appsink is stopped or EOS.

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 #

Arguments

 = Word64

timeout: the maximum amount of time to wait for a sample

-> IO (Maybe MiniObject)

Returns: a Sample or a Event or NULL when the appsink is stopped or EOS or the timeout expires.

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 #

Arguments

 = Word64

timeout: the maximum amount of time to wait for the preroll sample

-> IO (Maybe Sample)

Returns: a Sample or NULL when the appsink is stopped or EOS or the timeout expires.

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 #

Arguments

 = Word64

timeout: the maximum amount of time to wait for a sample

-> IO (Maybe Sample)

Returns: a Sample or NULL when the appsink is stopped or EOS or the timeout expires.

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