Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
- Exported types
- Methods
- doPreroll
- getBlocksize
- getLastSample
- getLatency
- getMaxBitrate
- getMaxLateness
- getRenderDelay
- getSync
- getThrottleTime
- getTsOffset
- isAsyncEnabled
- isLastSampleEnabled
- isQosEnabled
- queryLatency
- setAsyncEnabled
- setBlocksize
- setLastSampleEnabled
- setMaxBitrate
- setMaxLateness
- setQosEnabled
- setRenderDelay
- setSync
- setThrottleTime
- setTsOffset
- wait
- waitClock
- waitPreroll
- Properties
BaseSink
is the base class for sink elements in GStreamer, such as
xvimagesink or filesink. It is a layer on top of Element
that provides a
simplified interface to plugin writers. BaseSink
handles many details
for you, for example: preroll, clock synchronization, state changes,
activation in push or pull mode, and queries.
In most cases, when writing sink elements, there is no need to implement
class methods from Element
or to set functions on pads, because the
BaseSink
infrastructure should be sufficient.
BaseSink
provides support for exactly one sink pad, which should be
named "sink". A sink implementation (subclass of BaseSink
) should
install a pad template in its class_init function, like so:
C code
static void my_element_class_init (GstMyElementClass *klass) { GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); // sinktemplate should be a #GstStaticPadTemplate with direction // %GST_PAD_SINK and name "sink" gst_element_class_add_static_pad_template (gstelement_class, &sinktemplate); gst_element_class_set_static_metadata (gstelement_class, "Sink name", "Sink", "My Sink element", "The author <my.sink@my.email>"); }
BaseSink
will handle the prerolling correctly. This means that it will
return StateChangeReturnAsync
from a state change to PAUSED until the first
buffer arrives in this element. The base class will call the
BaseSinkClass
.preroll
() vmethod with this preroll buffer and will then
commit the state change to the next asynchronously pending state.
When the element is set to PLAYING, BaseSink
will synchronise on the
clock using the times returned from BaseSinkClass
.get_times
(). If this
function returns CLOCK_TIME_NONE
for the start time, no synchronisation
will be done. Synchronisation can be disabled entirely by setting the object
BaseSink
:sync
property to False
.
After synchronisation the virtual method BaseSinkClass
.render
() will be
called. Subclasses should minimally implement this method.
Subclasses that synchronise on the clock in the BaseSinkClass
.render
()
method are supported as well. These classes typically receive a buffer in
the render method and can then potentially block on the clock while
rendering. A typical example is an audiosink.
These subclasses can use baseSinkWaitPreroll
to perform the
blocking wait.
Upon receiving the EOS event in the PLAYING state, BaseSink
will wait
for the clock to reach the time indicated by the stop time of the last
BaseSinkClass
.get_times
() call before posting an EOS message. When the
element receives EOS in PAUSED, preroll completes, the event is queued and an
EOS message is posted when going to PLAYING.
BaseSink
will internally use the EventTypeSegment
events to schedule
synchronisation and clipping of buffers. Buffers that fall completely outside
of the current segment are dropped. Buffers that fall partially in the
segment are rendered (and prerolled). Subclasses should do any subbuffer
clipping themselves when needed.
BaseSink
will by default report the current playback position in
FormatTime
based on the current clock time and segment information.
If no clock has been set on the element, the query will be forwarded
upstream.
The BaseSinkClass
.set_caps
() function will be called when the subclass
should configure itself to process a specific media type.
The BaseSinkClass
.start
() and BaseSinkClass
.stop
() virtual methods
will be called when resources should be allocated. Any
BaseSinkClass
.preroll
(), BaseSinkClass
.render
() and
BaseSinkClass
.set_caps
() function will be called between the
BaseSinkClass
.start
() and BaseSinkClass
.stop
() calls.
The BaseSinkClass
.event
() virtual method will be called when an event is
received by BaseSink
. Normally this method should only be overridden by
very specific elements (such as file sinks) which need to handle the
newsegment event specially.
The BaseSinkClass
.unlock
() method is called when the elements should
unblock any blocking operations they perform in the
BaseSinkClass
.render
() method. This is mostly useful when the
BaseSinkClass
.render
() method performs a blocking write on a file
descriptor, for example.
The BaseSink
:max-lateness
property affects how the sink deals with
buffers that arrive too late in the sink. A buffer arrives too late in the
sink when the presentation time (as a combination of the last segment, buffer
timestamp and element base_time) plus the duration is before the current
time of the clock.
If the frame is later than max-lateness, the sink will drop the buffer
without calling the render method.
This feature is disabled if sync is disabled, the
BaseSinkClass
.get_times
() method does not return a valid start time or
max-lateness is set to -1 (the default).
Subclasses can use baseSinkSetMaxLateness
to configure the
max-lateness value.
The BaseSink
:qos
property will enable the quality-of-service features of
the basesink which gather statistics about the real-time performance of the
clock synchronisation. For each buffer received in the sink, statistics are
gathered and a QOS event is sent upstream with these numbers. This
information can then be used by upstream elements to reduce their processing
rate, for example.
The BaseSink
:async
property can be used to instruct the sink to never
perform an ASYNC state change. This feature is mostly usable when dealing
with non-synchronized streams or sparse streams.
- newtype BaseSink = BaseSink (ManagedPtr BaseSink)
- class GObject o => IsBaseSink o
- toBaseSink :: IsBaseSink o => o -> IO BaseSink
- noBaseSink :: Maybe BaseSink
- data BaseSinkDoPrerollMethodInfo
- baseSinkDoPreroll :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> MiniObject -> m FlowReturn
- data BaseSinkGetBlocksizeMethodInfo
- baseSinkGetBlocksize :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> m Word32
- data BaseSinkGetLastSampleMethodInfo
- baseSinkGetLastSample :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> m (Maybe Sample)
- data BaseSinkGetLatencyMethodInfo
- baseSinkGetLatency :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> m Word64
- data BaseSinkGetMaxBitrateMethodInfo
- baseSinkGetMaxBitrate :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> m Word64
- data BaseSinkGetMaxLatenessMethodInfo
- baseSinkGetMaxLateness :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> m Int64
- data BaseSinkGetRenderDelayMethodInfo
- baseSinkGetRenderDelay :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> m Word64
- data BaseSinkGetSyncMethodInfo
- baseSinkGetSync :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> m Bool
- data BaseSinkGetThrottleTimeMethodInfo
- baseSinkGetThrottleTime :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> m Word64
- data BaseSinkGetTsOffsetMethodInfo
- baseSinkGetTsOffset :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> m Int64
- data BaseSinkIsAsyncEnabledMethodInfo
- baseSinkIsAsyncEnabled :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> m Bool
- data BaseSinkIsLastSampleEnabledMethodInfo
- baseSinkIsLastSampleEnabled :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> m Bool
- data BaseSinkIsQosEnabledMethodInfo
- baseSinkIsQosEnabled :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> m Bool
- data BaseSinkQueryLatencyMethodInfo
- baseSinkQueryLatency :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> m (Bool, Bool, Bool, Word64, Word64)
- data BaseSinkSetAsyncEnabledMethodInfo
- baseSinkSetAsyncEnabled :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> Bool -> m ()
- data BaseSinkSetBlocksizeMethodInfo
- baseSinkSetBlocksize :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> Word32 -> m ()
- data BaseSinkSetLastSampleEnabledMethodInfo
- baseSinkSetLastSampleEnabled :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> Bool -> m ()
- data BaseSinkSetMaxBitrateMethodInfo
- baseSinkSetMaxBitrate :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> Word64 -> m ()
- data BaseSinkSetMaxLatenessMethodInfo
- baseSinkSetMaxLateness :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> Int64 -> m ()
- data BaseSinkSetQosEnabledMethodInfo
- baseSinkSetQosEnabled :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> Bool -> m ()
- data BaseSinkSetRenderDelayMethodInfo
- baseSinkSetRenderDelay :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> Word64 -> m ()
- data BaseSinkSetSyncMethodInfo
- baseSinkSetSync :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> Bool -> m ()
- data BaseSinkSetThrottleTimeMethodInfo
- baseSinkSetThrottleTime :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> Word64 -> m ()
- data BaseSinkSetTsOffsetMethodInfo
- baseSinkSetTsOffset :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> Int64 -> m ()
- data BaseSinkWaitMethodInfo
- baseSinkWait :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> Word64 -> m (FlowReturn, Int64)
- data BaseSinkWaitClockMethodInfo
- baseSinkWaitClock :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> Word64 -> m (ClockReturn, Int64)
- data BaseSinkWaitPrerollMethodInfo
- baseSinkWaitPreroll :: (HasCallStack, MonadIO m, IsBaseSink a) => a -> m FlowReturn
- data BaseSinkAsyncPropertyInfo
- baseSinkAsync :: AttrLabelProxy "async"
- constructBaseSinkAsync :: IsBaseSink o => Bool -> IO (GValueConstruct o)
- getBaseSinkAsync :: (MonadIO m, IsBaseSink o) => o -> m Bool
- setBaseSinkAsync :: (MonadIO m, IsBaseSink o) => o -> Bool -> m ()
- data BaseSinkBlocksizePropertyInfo
- baseSinkBlocksize :: AttrLabelProxy "blocksize"
- constructBaseSinkBlocksize :: IsBaseSink o => Word32 -> IO (GValueConstruct o)
- getBaseSinkBlocksize :: (MonadIO m, IsBaseSink o) => o -> m Word32
- setBaseSinkBlocksize :: (MonadIO m, IsBaseSink o) => o -> Word32 -> m ()
- data BaseSinkEnableLastSamplePropertyInfo
- baseSinkEnableLastSample :: AttrLabelProxy "enableLastSample"
- constructBaseSinkEnableLastSample :: IsBaseSink o => Bool -> IO (GValueConstruct o)
- getBaseSinkEnableLastSample :: (MonadIO m, IsBaseSink o) => o -> m Bool
- setBaseSinkEnableLastSample :: (MonadIO m, IsBaseSink o) => o -> Bool -> m ()
- data BaseSinkLastSamplePropertyInfo
- baseSinkLastSample :: AttrLabelProxy "lastSample"
- getBaseSinkLastSample :: (MonadIO m, IsBaseSink o) => o -> m (Maybe Sample)
- data BaseSinkMaxBitratePropertyInfo
- baseSinkMaxBitrate :: AttrLabelProxy "maxBitrate"
- constructBaseSinkMaxBitrate :: IsBaseSink o => Word64 -> IO (GValueConstruct o)
- getBaseSinkMaxBitrate :: (MonadIO m, IsBaseSink o) => o -> m Word64
- setBaseSinkMaxBitrate :: (MonadIO m, IsBaseSink o) => o -> Word64 -> m ()
- data BaseSinkMaxLatenessPropertyInfo
- baseSinkMaxLateness :: AttrLabelProxy "maxLateness"
- constructBaseSinkMaxLateness :: IsBaseSink o => Int64 -> IO (GValueConstruct o)
- getBaseSinkMaxLateness :: (MonadIO m, IsBaseSink o) => o -> m Int64
- setBaseSinkMaxLateness :: (MonadIO m, IsBaseSink o) => o -> Int64 -> m ()
- data BaseSinkQosPropertyInfo
- baseSinkQos :: AttrLabelProxy "qos"
- constructBaseSinkQos :: IsBaseSink o => Bool -> IO (GValueConstruct o)
- getBaseSinkQos :: (MonadIO m, IsBaseSink o) => o -> m Bool
- setBaseSinkQos :: (MonadIO m, IsBaseSink o) => o -> Bool -> m ()
- data BaseSinkRenderDelayPropertyInfo
- baseSinkRenderDelay :: AttrLabelProxy "renderDelay"
- constructBaseSinkRenderDelay :: IsBaseSink o => Word64 -> IO (GValueConstruct o)
- getBaseSinkRenderDelay :: (MonadIO m, IsBaseSink o) => o -> m Word64
- setBaseSinkRenderDelay :: (MonadIO m, IsBaseSink o) => o -> Word64 -> m ()
- data BaseSinkSyncPropertyInfo
- baseSinkSync :: AttrLabelProxy "sync"
- constructBaseSinkSync :: IsBaseSink o => Bool -> IO (GValueConstruct o)
- getBaseSinkSync :: (MonadIO m, IsBaseSink o) => o -> m Bool
- setBaseSinkSync :: (MonadIO m, IsBaseSink o) => o -> Bool -> m ()
- data BaseSinkThrottleTimePropertyInfo
- baseSinkThrottleTime :: AttrLabelProxy "throttleTime"
- constructBaseSinkThrottleTime :: IsBaseSink o => Word64 -> IO (GValueConstruct o)
- getBaseSinkThrottleTime :: (MonadIO m, IsBaseSink o) => o -> m Word64
- setBaseSinkThrottleTime :: (MonadIO m, IsBaseSink o) => o -> Word64 -> m ()
- data BaseSinkTsOffsetPropertyInfo
- baseSinkTsOffset :: AttrLabelProxy "tsOffset"
- constructBaseSinkTsOffset :: IsBaseSink o => Int64 -> IO (GValueConstruct o)
- getBaseSinkTsOffset :: (MonadIO m, IsBaseSink o) => o -> m Int64
- setBaseSinkTsOffset :: (MonadIO m, IsBaseSink o) => o -> Int64 -> m ()
Exported types
GObject BaseSink Source # | |
IsObject BaseSink Source # | |
IsElement BaseSink Source # | |
IsObject BaseSink Source # | |
IsBaseSink BaseSink Source # | |
((~) * info (ResolveBaseSinkMethod t BaseSink), MethodInfo * info BaseSink p) => IsLabel t (BaseSink -> p) Source # | |
((~) * info (ResolveBaseSinkMethod t BaseSink), MethodInfo * info BaseSink p) => IsLabelProxy t (BaseSink -> p) Source # | |
HasAttributeList * BaseSink Source # | |
type AttributeList BaseSink Source # | |
type SignalList BaseSink Source # | |
class GObject o => IsBaseSink o Source #
(GObject a, UnknownAncestorError Constraint BaseSink a) => IsBaseSink a Source # | |
IsBaseSink BaseSink Source # | |
toBaseSink :: IsBaseSink o => o -> IO BaseSink Source #
Methods
doPreroll
data BaseSinkDoPrerollMethodInfo Source #
((~) * signature (MiniObject -> m FlowReturn), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkDoPrerollMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> MiniObject |
|
-> m FlowReturn | Returns: |
If the sink
spawns its own thread for pulling buffers from upstream it
should call this method after it has pulled a buffer. If the element needed
to preroll, this function will perform the preroll and will then block
until the element state is changed.
This function should be called with the PREROLL_LOCK held.
getBlocksize
data BaseSinkGetBlocksizeMethodInfo Source #
((~) * signature (m Word32), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkGetBlocksizeMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> m Word32 | Returns: the number of bytes |
Get the number of bytes that the sink will pull when it is operating in pull mode.
getLastSample
data BaseSinkGetLastSampleMethodInfo Source #
((~) * signature (m (Maybe Sample)), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkGetLastSampleMethodInfo a signature Source # | |
baseSinkGetLastSample Source #
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> m (Maybe Sample) | Returns: a |
Get the last sample that arrived in the sink and was used for preroll or for rendering. This property can be used to generate thumbnails.
The Caps
on the sample can be used to determine the type of the buffer.
Free-function: gst_sample_unref
getLatency
data BaseSinkGetLatencyMethodInfo Source #
((~) * signature (m Word64), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkGetLatencyMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> m Word64 | Returns: The configured latency. |
Get the currently configured latency.
getMaxBitrate
data BaseSinkGetMaxBitrateMethodInfo Source #
((~) * signature (m Word64), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkGetMaxBitrateMethodInfo a signature Source # | |
baseSinkGetMaxBitrate Source #
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> m Word64 | Returns: the maximum number of bits per second |
Get the maximum amount of bits per second that the sink will render.
Since: 1.2
getMaxLateness
data BaseSinkGetMaxLatenessMethodInfo Source #
((~) * signature (m Int64), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkGetMaxLatenessMethodInfo a signature Source # | |
baseSinkGetMaxLateness Source #
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> m Int64 | Returns: The maximum time in nanoseconds that a buffer can be late before it is dropped and not rendered. A value of -1 means an unlimited time. |
Gets the max lateness value. See gst_base_sink_set_max_lateness for more details.
getRenderDelay
data BaseSinkGetRenderDelayMethodInfo Source #
((~) * signature (m Word64), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkGetRenderDelayMethodInfo a signature Source # | |
baseSinkGetRenderDelay Source #
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> m Word64 | Returns: the render delay of |
Get the render delay of sink
. see baseSinkSetRenderDelay
for more
information about the render delay.
getSync
data BaseSinkGetSyncMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkGetSyncMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> m Bool | Returns: |
Checks if sink
is currently configured to synchronize against the
clock.
getThrottleTime
data BaseSinkGetThrottleTimeMethodInfo Source #
((~) * signature (m Word64), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkGetThrottleTimeMethodInfo a signature Source # | |
baseSinkGetThrottleTime Source #
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> m Word64 | Returns: the number of nanoseconds |
Get the time that will be inserted between frames to control the maximum buffers per second.
getTsOffset
data BaseSinkGetTsOffsetMethodInfo Source #
((~) * signature (m Int64), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkGetTsOffsetMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> m Int64 | Returns: The synchronisation offset. |
Get the synchronisation offset of sink
.
isAsyncEnabled
data BaseSinkIsAsyncEnabledMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkIsAsyncEnabledMethodInfo a signature Source # | |
baseSinkIsAsyncEnabled Source #
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> m Bool | Returns: |
Checks if sink
is currently configured to perform asynchronous state
changes to PAUSED.
isLastSampleEnabled
data BaseSinkIsLastSampleEnabledMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkIsLastSampleEnabledMethodInfo a signature Source # | |
baseSinkIsLastSampleEnabled Source #
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> m Bool | Returns: |
Checks if sink
is currently configured to store the last received sample in
the last-sample property.
isQosEnabled
data BaseSinkIsQosEnabledMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkIsQosEnabledMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> m Bool | Returns: |
Checks if sink
is currently configured to send Quality-of-Service events
upstream.
queryLatency
data BaseSinkQueryLatencyMethodInfo Source #
((~) * signature (m (Bool, Bool, Bool, Word64, Word64)), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkQueryLatencyMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> m (Bool, Bool, Bool, Word64, Word64) | Returns: |
Query the sink for the latency parameters. The latency will be queried from
the upstream elements. live
will be True
if sink
is configured to
synchronize against the clock. upstreamLive
will be True
if an upstream
element is live.
If both live
and upstreamLive
are True
, the sink will want to compensate
for the latency introduced by the upstream elements by setting the
minLatency
to a strictly positive value.
This function is mostly used by subclasses.
setAsyncEnabled
data BaseSinkSetAsyncEnabledMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkSetAsyncEnabledMethodInfo a signature Source # | |
baseSinkSetAsyncEnabled Source #
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> Bool |
|
-> m () |
Configures sink
to perform all state changes asynchronously. When async is
disabled, the sink will immediately go to PAUSED instead of waiting for a
preroll buffer. This feature is useful if the sink does not synchronize
against the clock or when it is dealing with sparse streams.
setBlocksize
data BaseSinkSetBlocksizeMethodInfo Source #
((~) * signature (Word32 -> m ()), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkSetBlocksizeMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> Word32 |
|
-> m () |
Set the number of bytes that the sink will pull when it is operating in pull mode.
setLastSampleEnabled
data BaseSinkSetLastSampleEnabledMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkSetLastSampleEnabledMethodInfo a signature Source # | |
baseSinkSetLastSampleEnabled Source #
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> Bool |
|
-> m () |
Configures sink
to store the last received sample in the last-sample
property.
setMaxBitrate
data BaseSinkSetMaxBitrateMethodInfo Source #
((~) * signature (Word64 -> m ()), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkSetMaxBitrateMethodInfo a signature Source # | |
baseSinkSetMaxBitrate Source #
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> Word64 |
|
-> m () |
Set the maximum amount of bits per second that the sink will render.
Since: 1.2
setMaxLateness
data BaseSinkSetMaxLatenessMethodInfo Source #
((~) * signature (Int64 -> m ()), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkSetMaxLatenessMethodInfo a signature Source # | |
baseSinkSetMaxLateness Source #
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> Int64 |
|
-> m () |
Sets the new max lateness value to maxLateness
. This value is
used to decide if a buffer should be dropped or not based on the
buffer timestamp and the current clock time. A value of -1 means
an unlimited time.
setQosEnabled
data BaseSinkSetQosEnabledMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkSetQosEnabledMethodInfo a signature Source # | |
baseSinkSetQosEnabled Source #
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> Bool |
|
-> m () |
Configures sink
to send Quality-of-Service events upstream.
setRenderDelay
data BaseSinkSetRenderDelayMethodInfo Source #
((~) * signature (Word64 -> m ()), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkSetRenderDelayMethodInfo a signature Source # | |
baseSinkSetRenderDelay Source #
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> Word64 |
|
-> m () |
Set the render delay in sink
to delay
. The render delay is the time
between actual rendering of a buffer and its synchronisation time. Some
devices might delay media rendering which can be compensated for with this
function.
After calling this function, this sink will report additional latency and other sinks will adjust their latency to delay the rendering of their media.
This function is usually called by subclasses.
setSync
data BaseSinkSetSyncMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkSetSyncMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> Bool |
|
-> m () |
setThrottleTime
data BaseSinkSetThrottleTimeMethodInfo Source #
((~) * signature (Word64 -> m ()), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkSetThrottleTimeMethodInfo a signature Source # | |
baseSinkSetThrottleTime Source #
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> Word64 |
|
-> m () |
Set the time that will be inserted between rendered buffers. This can be used to control the maximum buffers per second that the sink will render.
setTsOffset
data BaseSinkSetTsOffsetMethodInfo Source #
((~) * signature (Int64 -> m ()), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkSetTsOffsetMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> Int64 |
|
-> m () |
Adjust the synchronisation of sink
with offset
. A negative value will
render buffers earlier than their timestamp. A positive value will delay
rendering. This function can be used to fix playback of badly timestamped
buffers.
wait
data BaseSinkWaitMethodInfo Source #
((~) * signature (Word64 -> m (FlowReturn, Int64)), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkWaitMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> Word64 |
|
-> m (FlowReturn, Int64) | Returns: |
This function will wait for preroll to complete and will then block until time
is reached. It is usually called by subclasses that use their own internal
synchronisation but want to let some synchronization (like EOS) be handled
by the base class.
This function should only be called with the PREROLL_LOCK held (like when receiving an EOS event in the ::event vmethod or when handling buffers in ::render).
The time
argument should be the running_time of when the timeout should happen
and will be adjusted with any latency and offset configured in the sink.
waitClock
data BaseSinkWaitClockMethodInfo Source #
((~) * signature (Word64 -> m (ClockReturn, Int64)), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkWaitClockMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> Word64 |
|
-> m (ClockReturn, Int64) | Returns: |
This function will block until time
is reached. It is usually called by
subclasses that use their own internal synchronisation.
If time
is not valid, no synchronisation is done and ClockReturnBadtime
is
returned. Likewise, if synchronisation is disabled in the element or there
is no clock, no synchronisation is done and ClockReturnBadtime
is returned.
This function should only be called with the PREROLL_LOCK held, like when
receiving an EOS event in the BaseSinkClass
.event
() vmethod or when
receiving a buffer in
the BaseSinkClass
.render
() vmethod.
The time
argument should be the running_time of when this method should
return and is not adjusted with any latency or offset configured in the
sink.
waitPreroll
data BaseSinkWaitPrerollMethodInfo Source #
((~) * signature (m FlowReturn), MonadIO m, IsBaseSink a) => MethodInfo * BaseSinkWaitPrerollMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsBaseSink a) | |
=> a |
|
-> m FlowReturn | Returns: |
If the BaseSinkClass
.render
() method performs its own synchronisation
against the clock it must unblock when going from PLAYING to the PAUSED state
and call this method before continuing to render the remaining data.
This function will block until a state change to PLAYING happens (in which
case this function returns FlowReturnOk
) or the processing must be stopped due
to a state change to READY or a FLUSH event (in which case this function
returns FlowReturnFlushing
).
This function should only be called with the PREROLL_LOCK held, like in the render function.
Properties
async
data BaseSinkAsyncPropertyInfo Source #
baseSinkAsync :: AttrLabelProxy "async" Source #
constructBaseSinkAsync :: IsBaseSink o => Bool -> IO (GValueConstruct o) Source #
getBaseSinkAsync :: (MonadIO m, IsBaseSink o) => o -> m Bool Source #
setBaseSinkAsync :: (MonadIO m, IsBaseSink o) => o -> Bool -> m () Source #
blocksize
data BaseSinkBlocksizePropertyInfo Source #
baseSinkBlocksize :: AttrLabelProxy "blocksize" Source #
constructBaseSinkBlocksize :: IsBaseSink o => Word32 -> IO (GValueConstruct o) Source #
getBaseSinkBlocksize :: (MonadIO m, IsBaseSink o) => o -> m Word32 Source #
setBaseSinkBlocksize :: (MonadIO m, IsBaseSink o) => o -> Word32 -> m () Source #
enableLastSample
data BaseSinkEnableLastSamplePropertyInfo Source #
baseSinkEnableLastSample :: AttrLabelProxy "enableLastSample" Source #
constructBaseSinkEnableLastSample :: IsBaseSink o => Bool -> IO (GValueConstruct o) Source #
getBaseSinkEnableLastSample :: (MonadIO m, IsBaseSink o) => o -> m Bool Source #
setBaseSinkEnableLastSample :: (MonadIO m, IsBaseSink o) => o -> Bool -> m () Source #
lastSample
data BaseSinkLastSamplePropertyInfo Source #
baseSinkLastSample :: AttrLabelProxy "lastSample" Source #
getBaseSinkLastSample :: (MonadIO m, IsBaseSink o) => o -> m (Maybe Sample) Source #
maxBitrate
data BaseSinkMaxBitratePropertyInfo Source #
baseSinkMaxBitrate :: AttrLabelProxy "maxBitrate" Source #
constructBaseSinkMaxBitrate :: IsBaseSink o => Word64 -> IO (GValueConstruct o) Source #
getBaseSinkMaxBitrate :: (MonadIO m, IsBaseSink o) => o -> m Word64 Source #
setBaseSinkMaxBitrate :: (MonadIO m, IsBaseSink o) => o -> Word64 -> m () Source #
maxLateness
data BaseSinkMaxLatenessPropertyInfo Source #
baseSinkMaxLateness :: AttrLabelProxy "maxLateness" Source #
constructBaseSinkMaxLateness :: IsBaseSink o => Int64 -> IO (GValueConstruct o) Source #
getBaseSinkMaxLateness :: (MonadIO m, IsBaseSink o) => o -> m Int64 Source #
setBaseSinkMaxLateness :: (MonadIO m, IsBaseSink o) => o -> Int64 -> m () Source #
qos
data BaseSinkQosPropertyInfo Source #
baseSinkQos :: AttrLabelProxy "qos" Source #
constructBaseSinkQos :: IsBaseSink o => Bool -> IO (GValueConstruct o) Source #
getBaseSinkQos :: (MonadIO m, IsBaseSink o) => o -> m Bool Source #
setBaseSinkQos :: (MonadIO m, IsBaseSink o) => o -> Bool -> m () Source #
renderDelay
data BaseSinkRenderDelayPropertyInfo Source #
baseSinkRenderDelay :: AttrLabelProxy "renderDelay" Source #
constructBaseSinkRenderDelay :: IsBaseSink o => Word64 -> IO (GValueConstruct o) Source #
getBaseSinkRenderDelay :: (MonadIO m, IsBaseSink o) => o -> m Word64 Source #
setBaseSinkRenderDelay :: (MonadIO m, IsBaseSink o) => o -> Word64 -> m () Source #
sync
data BaseSinkSyncPropertyInfo Source #
baseSinkSync :: AttrLabelProxy "sync" Source #
constructBaseSinkSync :: IsBaseSink o => Bool -> IO (GValueConstruct o) Source #
getBaseSinkSync :: (MonadIO m, IsBaseSink o) => o -> m Bool Source #
setBaseSinkSync :: (MonadIO m, IsBaseSink o) => o -> Bool -> m () Source #
throttleTime
data BaseSinkThrottleTimePropertyInfo Source #
baseSinkThrottleTime :: AttrLabelProxy "throttleTime" Source #
constructBaseSinkThrottleTime :: IsBaseSink o => Word64 -> IO (GValueConstruct o) Source #
getBaseSinkThrottleTime :: (MonadIO m, IsBaseSink o) => o -> m Word64 Source #
setBaseSinkThrottleTime :: (MonadIO m, IsBaseSink o) => o -> Word64 -> m () Source #
tsOffset
data BaseSinkTsOffsetPropertyInfo Source #
baseSinkTsOffset :: AttrLabelProxy "tsOffset" Source #
constructBaseSinkTsOffset :: IsBaseSink o => Int64 -> IO (GValueConstruct o) Source #
getBaseSinkTsOffset :: (MonadIO m, IsBaseSink o) => o -> m Int64 Source #
setBaseSinkTsOffset :: (MonadIO m, IsBaseSink o) => o -> Int64 -> m () Source #