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

Description

The appsrc element can be used by applications to insert data into a GStreamer pipeline. Unlike most GStreamer elements, appsrc provides external API functions.

appsrc can be used by linking with the libgstapp library to access the methods directly or by using the appsrc action signals.

Before operating appsrc, the caps property must be set to fixed caps describing the format of the data that will be pushed with appsrc. An exception to this is when pushing buffers with unknown caps, in which case no caps should be set. This is typically true of file-like sources that push raw byte buffers. If you don't want to explicitly set the caps, you can use gst_app_src_push_sample. This method gets the caps associated with the sample and sets them on the appsrc replacing any previously set caps (if different from sample's caps).

The main way of handing data to the appsrc element is by calling the appSrcPushBuffer method or by emitting the push-buffer action signal. This will put the buffer onto a queue from which appsrc will read from in its streaming thread. It is important to note that data transport will not happen from the thread that performed the push-buffer call.

The "max-bytes", "max-buffers" and "max-time" properties control how much data can be queued in appsrc before appsrc considers the queue full. A filled internal queue will always signal the "enough-data" signal, which signals the application that it should stop pushing data into appsrc. The "block" property will cause appsrc to block the push-buffer method until free data becomes available again.

When the internal queue is running out of data, the "need-data" signal is emitted, which signals the application that it should start pushing more data into appsrc.

In addition to the "need-data" and "enough-data" signals, appsrc can emit the "seek-data" signal when the "stream-mode" property is set to "seekable" or "random-access". The signal argument will contain the new desired position in the stream expressed in the unit set with the "format" property. After receiving the seek-data signal, the application should push-buffers from the new position.

These signals allow the application to operate the appsrc in two different ways:

The push mode, in which the application repeatedly calls the push-buffer/push-sample method with a new buffer/sample. Optionally, the queue size in the appsrc can be controlled with the enough-data and need-data signals by respectively stopping/starting the push-buffer/push-sample calls. This is a typical mode of operation for the stream-type "stream" and "seekable". Use this mode when implementing various network protocols or hardware devices.

The pull mode, in which the need-data signal triggers the next push-buffer call. This mode is typically used in the "random-access" stream-type. Use this mode for file access or other randomly accessible sources. In this mode, a buffer of exactly the amount of bytes given by the need-data signal should be pushed into appsrc.

In all modes, the size property on appsrc should contain the total stream size in bytes. Setting this property is mandatory in the random-access mode. For the stream and seekable modes, setting this property is optional but recommended.

When the application has finished pushing data into appsrc, it should call appSrcEndOfStream or emit the end-of-stream action signal. After this call, no more buffers can be pushed into appsrc until a flushing seek occurs or the state of the appsrc has gone through READY.

Synopsis

Exported types

newtype AppSrc Source #

Memory-managed wrapper type.

Constructors

AppSrc (ManagedPtr AppSrc) 

Instances

Instances details
Eq AppSrc Source # 
Instance details

Defined in GI.GstApp.Objects.AppSrc

Methods

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

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

GObject AppSrc Source # 
Instance details

Defined in GI.GstApp.Objects.AppSrc

ManagedPtrNewtype AppSrc Source # 
Instance details

Defined in GI.GstApp.Objects.AppSrc

Methods

toManagedPtr :: AppSrc -> ManagedPtr AppSrc

TypedObject AppSrc Source # 
Instance details

Defined in GI.GstApp.Objects.AppSrc

Methods

glibType :: IO GType

HasParentTypes AppSrc Source # 
Instance details

Defined in GI.GstApp.Objects.AppSrc

IsGValue (Maybe AppSrc) Source #

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

Instance details

Defined in GI.GstApp.Objects.AppSrc

Methods

gvalueGType_ :: IO GType

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

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

type ParentTypes AppSrc Source # 
Instance details

Defined in GI.GstApp.Objects.AppSrc

type ParentTypes AppSrc = '[BaseSrc, Element, Object, Object, URIHandler]

class (GObject o, IsDescendantOf AppSrc o) => IsAppSrc o Source #

Type class for types which can be safely cast to AppSrc, for instance with toAppSrc.

Instances

Instances details
(GObject o, IsDescendantOf AppSrc o) => IsAppSrc o Source # 
Instance details

Defined in GI.GstApp.Objects.AppSrc

toAppSrc :: (MonadIO m, IsAppSrc o) => o -> m AppSrc Source #

Cast to AppSrc, 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, endOfStream, forceFloating, foreachPad, foreachSinkPad, foreachSrcPad, freezeNotify, getv, hasActiveControlBindings, hasAncestor, hasAsAncestor, hasAsParent, isAsync, isFloating, isLive, isLockedState, iteratePads, iterateSinkPads, iterateSrcPads, link, linkFiltered, linkPads, linkPadsFiltered, linkPadsFull, lostState, messageFull, messageFullWithDetails, negotiate, newSeamlessSegment, newSegment, noMorePads, notify, notifyByPspec, postMessage, provideClock, pushBuffer, pushBufferList, pushSample, query, queryConvert, queryDuration, queryLatency, queryPosition, ref, refSink, releaseRequestPad, removeControlBinding, removePad, removePropertyNotifyWatch, requestPad, requestPadSimple, runDispose, seek, seekSimple, sendEvent, startComplete, startWait, stealData, stealQdata, submitBufferList, suggestNextSync, syncStateWithParent, syncValues, thawNotify, unlink, unlinkPads, unparent, unref, waitPlaying, watchClosure.

Getters

getAllocator, getBaseTime, getBlocksize, getBufferPool, getBus, getCaps, getClock, getCompatiblePad, getCompatiblePadTemplate, getContext, getContextUnlocked, getContexts, getControlBinding, getControlRate, getCurrentClockTime, getCurrentLevelBuffers, getCurrentLevelBytes, getCurrentLevelTime, getCurrentRunningTime, getData, getDoTimestamp, getDuration, getEmitSignals, getFactory, getGValueArray, getLatency, getLeakyType, getMaxBuffers, getMaxBytes, getMaxTime, getMetadata, getName, getPadTemplate, getPadTemplateList, getParent, getPathString, getProperty, getProtocols, getQdata, getRequestPad, getSize, getStartTime, getState, getStaticPad, getStreamType, getUri, getUriType, getValue.

Setters

setAsync, setAutomaticEos, setBaseTime, setBlocksize, setBus, setCaps, setClock, setContext, setControlBindingDisabled, setControlBindingsDisabled, setControlRate, setData, setDataFull, setDoTimestamp, setDuration, setDynamicSize, setEmitSignals, setFormat, setLatency, setLeakyType, setLive, setLockedState, setMaxBuffers, setMaxBytes, setMaxTime, setName, setParent, setProperty, setSize, setStartTime, setState, setStreamType, setUri.

endOfStream

appSrcEndOfStream Source #

Arguments

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

appsrc: a AppSrc

-> m FlowReturn

Returns: GST_FLOW_OK when the EOS was successfully queued. GST_FLOW_FLUSHING when appsrc is not PAUSED or PLAYING.

Indicates to the appsrc element that the last buffer queued in the element is the last buffer of the stream.

getCaps

appSrcGetCaps Source #

Arguments

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

appsrc: a AppSrc

-> m (Maybe Caps)

Returns: the Caps produced by the source. gst_caps_unref() after usage.

Get the configured caps on appsrc.

getCurrentLevelBuffers

appSrcGetCurrentLevelBuffers Source #

Arguments

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

appsrc: a AppSrc

-> m Word64

Returns: The number of currently queued buffers.

Get the number of currently queued buffers inside appsrc.

Since: 1.20

getCurrentLevelBytes

appSrcGetCurrentLevelBytes Source #

Arguments

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

appsrc: a AppSrc

-> m Word64

Returns: The number of currently queued bytes.

Get the number of currently queued bytes inside appsrc.

Since: 1.2

getCurrentLevelTime

appSrcGetCurrentLevelTime Source #

Arguments

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

appsrc: a AppSrc

-> m Word64

Returns: The amount of currently queued time.

Get the amount of currently queued time inside appsrc.

Since: 1.20

getDuration

appSrcGetDuration Source #

Arguments

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

appsrc: a AppSrc

-> m Word64

Returns: the duration of the stream previously set with appSrcSetDuration;

Get the duration of the stream in nanoseconds. A value of GST_CLOCK_TIME_NONE means that the duration is not known.

Since: 1.10

getEmitSignals

appSrcGetEmitSignals Source #

Arguments

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

appsrc: a AppSrc

-> m Bool

Returns: True if appsrc is emitting the "new-preroll" and "new-buffer" signals.

Check if appsrc will emit the "new-preroll" and "new-buffer" signals.

getLatency

appSrcGetLatency Source #

Arguments

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

appsrc: a AppSrc

-> m (Word64, Word64) 

Retrieve the min and max latencies in min and max respectively.

getLeakyType

appSrcGetLeakyType Source #

Arguments

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

appsrc: a AppSrc

-> m AppLeakyType

Returns: The currently set AppLeakyType.

Returns the currently set AppLeakyType. See appSrcSetLeakyType for more details.

Since: 1.20

getMaxBuffers

appSrcGetMaxBuffers Source #

Arguments

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

appsrc: a AppSrc

-> m Word64

Returns: The maximum amount of buffers that can be queued.

Get the maximum amount of buffers that can be queued in appsrc.

Since: 1.20

getMaxBytes

appSrcGetMaxBytes Source #

Arguments

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

appsrc: a AppSrc

-> m Word64

Returns: The maximum amount of bytes that can be queued.

Get the maximum amount of bytes that can be queued in appsrc.

getMaxTime

appSrcGetMaxTime Source #

Arguments

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

appsrc: a AppSrc

-> m Word64

Returns: The maximum amount of time that can be queued.

Get the maximum amount of time that can be queued in appsrc.

Since: 1.20

getSize

appSrcGetSize Source #

Arguments

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

appsrc: a AppSrc

-> m Int64

Returns: the size of the stream previously set with appSrcSetSize;

Get the size of the stream in bytes. A value of -1 means that the size is not known.

getStreamType

appSrcGetStreamType Source #

Arguments

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

appsrc: a AppSrc

-> m AppStreamType

Returns: the stream type.

Get the stream type. Control the stream type of appsrc with appSrcSetStreamType.

pushBuffer

appSrcPushBuffer Source #

Arguments

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

appsrc: a AppSrc

-> Buffer

buffer: a Buffer to push

-> m FlowReturn

Returns: GST_FLOW_OK when the buffer was successfully queued. GST_FLOW_FLUSHING when appsrc is not PAUSED or PLAYING. GST_FLOW_EOS when EOS occurred.

Adds a buffer to the queue of buffers that the appsrc element will push to its source pad. This function takes ownership of the buffer.

When the block property is TRUE, this function can block until free space becomes available in the queue.

pushBufferList

appSrcPushBufferList Source #

Arguments

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

appsrc: a AppSrc

-> BufferList

bufferList: a BufferList to push

-> m FlowReturn

Returns: GST_FLOW_OK when the buffer list was successfully queued. GST_FLOW_FLUSHING when appsrc is not PAUSED or PLAYING. GST_FLOW_EOS when EOS occurred.

Adds a buffer list to the queue of buffers and buffer lists that the appsrc element will push to its source pad. This function takes ownership of bufferList.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Since: 1.14

pushSample

appSrcPushSample Source #

Arguments

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

appsrc: a AppSrc

-> Sample

sample: a Sample from which buffer and caps may be extracted

-> m FlowReturn

Returns: GST_FLOW_OK when the buffer was successfully queued. GST_FLOW_FLUSHING when appsrc is not PAUSED or PLAYING. GST_FLOW_EOS when EOS occurred.

Extract a buffer from the provided sample and adds it to the queue of buffers that the appsrc element will push to its source pad. Any previous caps that were set on appsrc will be replaced by the caps associated with the sample if not equal.

This function does not take ownership of the sample so the sample needs to be unreffed after calling this function.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Since: 1.6

setCaps

appSrcSetCaps Source #

Arguments

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

appsrc: a AppSrc

-> Maybe Caps

caps: caps to set

-> m () 

Set the capabilities on the appsrc element. This function takes a copy of the caps structure. After calling this method, the source will only produce caps that match caps. caps must be fixed and the caps on the buffers must match the caps or left NULL.

setDuration

appSrcSetDuration Source #

Arguments

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

appsrc: a AppSrc

-> Word64

duration: the duration to set

-> m () 

Set the duration of the stream in nanoseconds. A value of GST_CLOCK_TIME_NONE means that the duration is not known.

Since: 1.10

setEmitSignals

appSrcSetEmitSignals Source #

Arguments

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

appsrc: a AppSrc

-> Bool

emit: the new state

-> m () 

Make appsrc emit the "new-preroll" and "new-buffer" signals. This option is by default disabled because signal emission is expensive and unneeded when the application prefers to operate in pull mode.

setLatency

appSrcSetLatency Source #

Arguments

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

appsrc: a AppSrc

-> Word64

min: the min latency

-> Word64

max: the max latency

-> m () 

Configure the min and max latency in src. If min is set to -1, the default latency calculations for pseudo-live sources will be used.

setLeakyType

appSrcSetLeakyType Source #

Arguments

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

appsrc: a AppSrc

-> AppLeakyType

leaky: the AppLeakyType

-> m () 

When set to any other value than GST_APP_LEAKY_TYPE_NONE then the appsrc will drop any buffers that are pushed into it once its internal queue is full. The selected type defines whether to drop the oldest or new buffers.

Since: 1.20

setMaxBuffers

appSrcSetMaxBuffers Source #

Arguments

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

appsrc: a AppSrc

-> Word64

max: the maximum number of buffers to queue

-> m () 

Set the maximum amount of buffers that can be queued in appsrc. After the maximum amount of buffers are queued, appsrc will emit the "enough-data" signal.

Since: 1.20

setMaxBytes

appSrcSetMaxBytes Source #

Arguments

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

appsrc: a AppSrc

-> Word64

max: the maximum number of bytes to queue

-> m () 

Set the maximum amount of bytes that can be queued in appsrc. After the maximum amount of bytes are queued, appsrc will emit the "enough-data" signal.

setMaxTime

appSrcSetMaxTime Source #

Arguments

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

appsrc: a AppSrc

-> Word64

max: the maximum amonut of time to queue

-> m () 

Set the maximum amount of time that can be queued in appsrc. After the maximum amount of time are queued, appsrc will emit the "enough-data" signal.

Since: 1.20

setSize

appSrcSetSize Source #

Arguments

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

appsrc: a AppSrc

-> Int64

size: the size to set

-> m () 

Set the size of the stream in bytes. A value of -1 means that the size is not known.

setStreamType

appSrcSetStreamType Source #

Arguments

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

appsrc: a AppSrc

-> AppStreamType

type: the new state

-> m () 

Set the stream type on appsrc. For seekable streams, the "seek" signal must be connected to.

A stream_type stream

Properties

block

When max-bytes are queued and after the enough-data signal has been emitted, block any further push-buffer calls until the amount of queued bytes drops below the max-bytes limit.

constructAppSrcBlock :: (IsAppSrc o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “block” property. This is rarely needed directly, but it is used by new.

getAppSrcBlock :: (MonadIO m, IsAppSrc o) => o -> m Bool Source #

Get the value of the “block” property. When overloading is enabled, this is equivalent to

get appSrc #block

setAppSrcBlock :: (MonadIO m, IsAppSrc o) => o -> Bool -> m () Source #

Set the value of the “block” property. When overloading is enabled, this is equivalent to

set appSrc [ #block := value ]

caps

The GstCaps that will negotiated downstream and will be put on outgoing buffers.

clearAppSrcCaps :: (MonadIO m, IsAppSrc o) => o -> m () Source #

Set the value of the “caps” property to Nothing. When overloading is enabled, this is equivalent to

clear #caps

constructAppSrcCaps :: (IsAppSrc 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.

getAppSrcCaps :: (MonadIO m, IsAppSrc o) => o -> m (Maybe Caps) Source #

Get the value of the “caps” property. When overloading is enabled, this is equivalent to

get appSrc #caps

setAppSrcCaps :: (MonadIO m, IsAppSrc o) => o -> Caps -> m () Source #

Set the value of the “caps” property. When overloading is enabled, this is equivalent to

set appSrc [ #caps := value ]

currentLevelBuffers

The number of currently queued buffers inside appsrc.

Since: 1.20

getAppSrcCurrentLevelBuffers :: (MonadIO m, IsAppSrc o) => o -> m Word64 Source #

Get the value of the “current-level-buffers” property. When overloading is enabled, this is equivalent to

get appSrc #currentLevelBuffers

currentLevelBytes

The number of currently queued bytes inside appsrc.

Since: 1.2

getAppSrcCurrentLevelBytes :: (MonadIO m, IsAppSrc o) => o -> m Word64 Source #

Get the value of the “current-level-bytes” property. When overloading is enabled, this is equivalent to

get appSrc #currentLevelBytes

currentLevelTime

The amount of currently queued time inside appsrc.

Since: 1.20

getAppSrcCurrentLevelTime :: (MonadIO m, IsAppSrc o) => o -> m Word64 Source #

Get the value of the “current-level-time” property. When overloading is enabled, this is equivalent to

get appSrc #currentLevelTime

duration

The total duration in nanoseconds of the data stream. If the total duration is known, it is recommended to configure it with this property.

Since: 1.10

constructAppSrcDuration :: (IsAppSrc o, MonadIO m) => Word64 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “duration” property. This is rarely needed directly, but it is used by new.

getAppSrcDuration :: (MonadIO m, IsAppSrc o) => o -> m Word64 Source #

Get the value of the “duration” property. When overloading is enabled, this is equivalent to

get appSrc #duration

setAppSrcDuration :: (MonadIO m, IsAppSrc o) => o -> Word64 -> m () Source #

Set the value of the “duration” property. When overloading is enabled, this is equivalent to

set appSrc [ #duration := value ]

emitSignals

Make appsrc emit the "need-data", "enough-data" and "seek-data" signals. This option is by default enabled for backwards compatibility reasons but can disabled when needed because signal emission is expensive.

constructAppSrcEmitSignals :: (IsAppSrc 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.

getAppSrcEmitSignals :: (MonadIO m, IsAppSrc o) => o -> m Bool Source #

Get the value of the “emit-signals” property. When overloading is enabled, this is equivalent to

get appSrc #emitSignals

setAppSrcEmitSignals :: (MonadIO m, IsAppSrc o) => o -> Bool -> m () Source #

Set the value of the “emit-signals” property. When overloading is enabled, this is equivalent to

set appSrc [ #emitSignals := value ]

format

The format to use for segment events. When the source is producing timestamped buffers this property should be set to GST_FORMAT_TIME.

constructAppSrcFormat :: (IsAppSrc o, MonadIO m) => Format -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “format” property. This is rarely needed directly, but it is used by new.

getAppSrcFormat :: (MonadIO m, IsAppSrc o) => o -> m Format Source #

Get the value of the “format” property. When overloading is enabled, this is equivalent to

get appSrc #format

setAppSrcFormat :: (MonadIO m, IsAppSrc o) => o -> Format -> m () Source #

Set the value of the “format” property. When overloading is enabled, this is equivalent to

set appSrc [ #format := value ]

handleSegmentChange

When enabled, appsrc will check GstSegment in GstSample which was pushed via appSrcPushSample or "push-sample" signal action. If a GstSegment is changed, corresponding segment event will be followed by next data flow.

FIXME: currently only GST_FORMAT_TIME format is supported and therefore GstAppSrcformat should be time. However, possibly AppSrc can support other formats.

Since: 1.18

constructAppSrcHandleSegmentChange :: (IsAppSrc o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “handle-segment-change” property. This is rarely needed directly, but it is used by new.

getAppSrcHandleSegmentChange :: (MonadIO m, IsAppSrc o) => o -> m Bool Source #

Get the value of the “handle-segment-change” property. When overloading is enabled, this is equivalent to

get appSrc #handleSegmentChange

setAppSrcHandleSegmentChange :: (MonadIO m, IsAppSrc o) => o -> Bool -> m () Source #

Set the value of the “handle-segment-change” property. When overloading is enabled, this is equivalent to

set appSrc [ #handleSegmentChange := value ]

isLive

Instruct the source to behave like a live source. This includes that it will only push out buffers in the PLAYING state.

constructAppSrcIsLive :: (IsAppSrc o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “is-live” property. This is rarely needed directly, but it is used by new.

getAppSrcIsLive :: (MonadIO m, IsAppSrc o) => o -> m Bool Source #

Get the value of the “is-live” property. When overloading is enabled, this is equivalent to

get appSrc #isLive

setAppSrcIsLive :: (MonadIO m, IsAppSrc o) => o -> Bool -> m () Source #

Set the value of the “is-live” property. When overloading is enabled, this is equivalent to

set appSrc [ #isLive := value ]

leakyType

When set to any other value than GST_APP_LEAKY_TYPE_NONE then the appsrc will drop any buffers that are pushed into it once its internal queue is full. The selected type defines whether to drop the oldest or new buffers.

Since: 1.20

constructAppSrcLeakyType :: (IsAppSrc o, MonadIO m) => AppLeakyType -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “leaky-type” property. This is rarely needed directly, but it is used by new.

getAppSrcLeakyType :: (MonadIO m, IsAppSrc o) => o -> m AppLeakyType Source #

Get the value of the “leaky-type” property. When overloading is enabled, this is equivalent to

get appSrc #leakyType

setAppSrcLeakyType :: (MonadIO m, IsAppSrc o) => o -> AppLeakyType -> m () Source #

Set the value of the “leaky-type” property. When overloading is enabled, this is equivalent to

set appSrc [ #leakyType := value ]

maxBuffers

The maximum amount of buffers that can be queued internally. After the maximum amount of buffers are queued, appsrc will emit the "enough-data" signal.

Since: 1.20

constructAppSrcMaxBuffers :: (IsAppSrc o, MonadIO m) => Word64 -> 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.

getAppSrcMaxBuffers :: (MonadIO m, IsAppSrc o) => o -> m Word64 Source #

Get the value of the “max-buffers” property. When overloading is enabled, this is equivalent to

get appSrc #maxBuffers

setAppSrcMaxBuffers :: (MonadIO m, IsAppSrc o) => o -> Word64 -> m () Source #

Set the value of the “max-buffers” property. When overloading is enabled, this is equivalent to

set appSrc [ #maxBuffers := value ]

maxBytes

The maximum amount of bytes that can be queued internally. After the maximum amount of bytes are queued, appsrc will emit the "enough-data" signal.

constructAppSrcMaxBytes :: (IsAppSrc o, MonadIO m) => Word64 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “max-bytes” property. This is rarely needed directly, but it is used by new.

getAppSrcMaxBytes :: (MonadIO m, IsAppSrc o) => o -> m Word64 Source #

Get the value of the “max-bytes” property. When overloading is enabled, this is equivalent to

get appSrc #maxBytes

setAppSrcMaxBytes :: (MonadIO m, IsAppSrc o) => o -> Word64 -> m () Source #

Set the value of the “max-bytes” property. When overloading is enabled, this is equivalent to

set appSrc [ #maxBytes := value ]

maxLatency

No description available in the introspection data.

constructAppSrcMaxLatency :: (IsAppSrc o, MonadIO m) => Int64 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “max-latency” property. This is rarely needed directly, but it is used by new.

getAppSrcMaxLatency :: (MonadIO m, IsAppSrc o) => o -> m Int64 Source #

Get the value of the “max-latency” property. When overloading is enabled, this is equivalent to

get appSrc #maxLatency

setAppSrcMaxLatency :: (MonadIO m, IsAppSrc o) => o -> Int64 -> m () Source #

Set the value of the “max-latency” property. When overloading is enabled, this is equivalent to

set appSrc [ #maxLatency := value ]

maxTime

The maximum amount of time that can be queued internally. After the maximum amount of time are queued, appsrc will emit the "enough-data" signal.

Since: 1.20

constructAppSrcMaxTime :: (IsAppSrc o, MonadIO m) => Word64 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “max-time” property. This is rarely needed directly, but it is used by new.

getAppSrcMaxTime :: (MonadIO m, IsAppSrc o) => o -> m Word64 Source #

Get the value of the “max-time” property. When overloading is enabled, this is equivalent to

get appSrc #maxTime

setAppSrcMaxTime :: (MonadIO m, IsAppSrc o) => o -> Word64 -> m () Source #

Set the value of the “max-time” property. When overloading is enabled, this is equivalent to

set appSrc [ #maxTime := value ]

minLatency

The minimum latency of the source. A value of -1 will use the default latency calculations of BaseSrc.

constructAppSrcMinLatency :: (IsAppSrc o, MonadIO m) => Int64 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “min-latency” property. This is rarely needed directly, but it is used by new.

getAppSrcMinLatency :: (MonadIO m, IsAppSrc o) => o -> m Int64 Source #

Get the value of the “min-latency” property. When overloading is enabled, this is equivalent to

get appSrc #minLatency

setAppSrcMinLatency :: (MonadIO m, IsAppSrc o) => o -> Int64 -> m () Source #

Set the value of the “min-latency” property. When overloading is enabled, this is equivalent to

set appSrc [ #minLatency := value ]

minPercent

Make appsrc emit the "need-data" signal when the amount of bytes in the queue drops below this percentage of max-bytes.

constructAppSrcMinPercent :: (IsAppSrc o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “min-percent” property. This is rarely needed directly, but it is used by new.

getAppSrcMinPercent :: (MonadIO m, IsAppSrc o) => o -> m Word32 Source #

Get the value of the “min-percent” property. When overloading is enabled, this is equivalent to

get appSrc #minPercent

setAppSrcMinPercent :: (MonadIO m, IsAppSrc o) => o -> Word32 -> m () Source #

Set the value of the “min-percent” property. When overloading is enabled, this is equivalent to

set appSrc [ #minPercent := value ]

size

The total size in bytes of the data stream. If the total size is known, it is recommended to configure it with this property.

constructAppSrcSize :: (IsAppSrc o, MonadIO m) => Int64 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “size” property. This is rarely needed directly, but it is used by new.

getAppSrcSize :: (MonadIO m, IsAppSrc o) => o -> m Int64 Source #

Get the value of the “size” property. When overloading is enabled, this is equivalent to

get appSrc #size

setAppSrcSize :: (MonadIO m, IsAppSrc o) => o -> Int64 -> m () Source #

Set the value of the “size” property. When overloading is enabled, this is equivalent to

set appSrc [ #size := value ]

streamType

The type of stream that this source is producing. For seekable streams the application should connect to the seek-data signal.

constructAppSrcStreamType :: (IsAppSrc o, MonadIO m) => AppStreamType -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “stream-type” property. This is rarely needed directly, but it is used by new.

getAppSrcStreamType :: (MonadIO m, IsAppSrc o) => o -> m AppStreamType Source #

Get the value of the “stream-type” property. When overloading is enabled, this is equivalent to

get appSrc #streamType

setAppSrcStreamType :: (MonadIO m, IsAppSrc o) => o -> AppStreamType -> m () Source #

Set the value of the “stream-type” property. When overloading is enabled, this is equivalent to

set appSrc [ #streamType := value ]

Signals

endOfStream

type AppSrcEndOfStreamCallback = IO FlowReturn Source #

Notify appsrc that no more buffer are available.

afterAppSrcEndOfStream :: (IsAppSrc a, MonadIO m) => a -> ((?self :: a) => AppSrcEndOfStreamCallback) -> m SignalHandlerId Source #

Connect a signal handler for the endOfStream signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after appSrc #endOfStream 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.

onAppSrcEndOfStream :: (IsAppSrc a, MonadIO m) => a -> ((?self :: a) => AppSrcEndOfStreamCallback) -> m SignalHandlerId Source #

Connect a signal handler for the endOfStream signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on appSrc #endOfStream callback

enoughData

type AppSrcEnoughDataCallback = IO () Source #

Signal that the source has enough data. It is recommended that the application stops calling push-buffer until the need-data signal is emitted again to avoid excessive buffer queueing.

afterAppSrcEnoughData :: (IsAppSrc a, MonadIO m) => a -> ((?self :: a) => AppSrcEnoughDataCallback) -> m SignalHandlerId Source #

Connect a signal handler for the enoughData signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after appSrc #enoughData 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.

onAppSrcEnoughData :: (IsAppSrc a, MonadIO m) => a -> ((?self :: a) => AppSrcEnoughDataCallback) -> m SignalHandlerId Source #

Connect a signal handler for the enoughData signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on appSrc #enoughData callback

needData

type AppSrcNeedDataCallback Source #

Arguments

 = Word32

length: the amount of bytes needed.

-> IO () 

Signal that the source needs more data. In the callback or from another thread you should call push-buffer or end-of-stream.

length is just a hint and when it is set to -1, any number of bytes can be pushed into appsrc.

You can call push-buffer multiple times until the enough-data signal is fired.

afterAppSrcNeedData :: (IsAppSrc a, MonadIO m) => a -> ((?self :: a) => AppSrcNeedDataCallback) -> m SignalHandlerId Source #

Connect a signal handler for the needData signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after appSrc #needData 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.

onAppSrcNeedData :: (IsAppSrc a, MonadIO m) => a -> ((?self :: a) => AppSrcNeedDataCallback) -> m SignalHandlerId Source #

Connect a signal handler for the needData signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on appSrc #needData callback

pushBuffer

type AppSrcPushBufferCallback Source #

Arguments

 = Buffer

buffer: a buffer to push

-> IO FlowReturn 

Adds a buffer to the queue of buffers that the appsrc element will push to its source pad.

This function does not take ownership of the buffer, but it takes a reference so the buffer can be unreffed at any time after calling this function.

When the block property is TRUE, this function can block until free space becomes available in the queue.

afterAppSrcPushBuffer :: (IsAppSrc a, MonadIO m) => a -> ((?self :: a) => AppSrcPushBufferCallback) -> m SignalHandlerId Source #

Connect a signal handler for the pushBuffer signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after appSrc #pushBuffer 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.

onAppSrcPushBuffer :: (IsAppSrc a, MonadIO m) => a -> ((?self :: a) => AppSrcPushBufferCallback) -> m SignalHandlerId Source #

Connect a signal handler for the pushBuffer signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on appSrc #pushBuffer callback

pushBufferList

type AppSrcPushBufferListCallback Source #

Arguments

 = BufferList

bufferList: a buffer list to push

-> IO FlowReturn 

Adds a buffer list to the queue of buffers and buffer lists that the appsrc element will push to its source pad.

This function does not take ownership of the buffer list, but it takes a reference so the buffer list can be unreffed at any time after calling this function.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Since: 1.14

afterAppSrcPushBufferList :: (IsAppSrc a, MonadIO m) => a -> ((?self :: a) => AppSrcPushBufferListCallback) -> m SignalHandlerId Source #

Connect a signal handler for the pushBufferList signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after appSrc #pushBufferList 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.

onAppSrcPushBufferList :: (IsAppSrc a, MonadIO m) => a -> ((?self :: a) => AppSrcPushBufferListCallback) -> m SignalHandlerId Source #

Connect a signal handler for the pushBufferList signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on appSrc #pushBufferList callback

pushSample

type AppSrcPushSampleCallback Source #

Arguments

 = Sample

sample: a sample from which extract buffer to push

-> IO FlowReturn 

Extract a buffer from the provided sample and adds the extracted buffer to the queue of buffers that the appsrc element will push to its source pad. This function set the appsrc caps based on the caps in the sample and reset the caps if they change. Only the caps and the buffer of the provided sample are used and not for example the segment in the sample.

This function does not take ownership of the sample, but it takes a reference so the sample can be unreffed at any time after calling this function.

When the block property is TRUE, this function can block until free space becomes available in the queue.

Since: 1.6

afterAppSrcPushSample :: (IsAppSrc a, MonadIO m) => a -> ((?self :: a) => AppSrcPushSampleCallback) -> m SignalHandlerId Source #

Connect a signal handler for the pushSample signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after appSrc #pushSample 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.

onAppSrcPushSample :: (IsAppSrc a, MonadIO m) => a -> ((?self :: a) => AppSrcPushSampleCallback) -> m SignalHandlerId Source #

Connect a signal handler for the pushSample signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on appSrc #pushSample callback

seekData

type AppSrcSeekDataCallback Source #

Arguments

 = Word64

offset: the offset to seek to

-> IO Bool

Returns: True if the seek succeeded.

Seek to the given offset. The next push-buffer should produce buffers from the new offset. This callback is only called for seekable stream types.

afterAppSrcSeekData :: (IsAppSrc a, MonadIO m) => a -> ((?self :: a) => AppSrcSeekDataCallback) -> m SignalHandlerId Source #

Connect a signal handler for the seekData signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after appSrc #seekData 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.

onAppSrcSeekData :: (IsAppSrc a, MonadIO m) => a -> ((?self :: a) => AppSrcSeekDataCallback) -> m SignalHandlerId Source #

Connect a signal handler for the seekData signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on appSrc #seekData callback