Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
- Exported types
- Methods
- addToFrame
- allocateOutputBuffer
- allocateOutputFrame
- allocateOutputFrameWithParams
- dropFrame
- dropSubframe
- finishFrame
- finishSubframe
- getAllocator
- getBufferPool
- getEstimateRate
- getFrame
- getFrames
- getInputSubframeIndex
- getLatency
- getMaxDecodeTime
- getMaxErrors
- getNeedsFormat
- getNeedsSyncPoint
- getOldestFrame
- getOutputState
- getPacketized
- getPendingFrameSize
- getProcessedSubframeIndex
- getQosProportion
- getSubframeMode
- haveFrame
- haveLastSubframe
- mergeTags
- negotiate
- proxyGetcaps
- releaseFrame
- requestSyncPoint
- setEstimateRate
- setInterlacedOutputState
- setLatency
- setMaxErrors
- setNeedsFormat
- setNeedsSyncPoint
- setOutputState
- setPacketized
- setSubframeMode
- setUseDefaultPadAcceptcaps
- Properties
This base class is for video decoders turning encoded data into raw video frames.
The GstVideoDecoder base class and derived subclasses should cooperate as follows:
Configuration
- Initially, GstVideoDecoder calls
start
when the decoder element is activated, which allows the subclass to perform any global setup.
- GstVideoDecoder calls
setFormat
to inform the subclass of caps describing input video data that it is about to receive, including possibly configuration data. While unlikely, it might be called more than once, if changing input parameters require reconfiguration. - Incoming data buffers are processed as needed, described in Data Processing below.
- GstVideoDecoder calls
stop
at end of all processing.
Data processing
- The base class gathers input data, and optionally allows subclass to parse this into subsequently manageable chunks, typically corresponding to and referred to as 'frames'.
- Each input frame is provided in turn to the subclass'
handleFrame
callback. - When the subclass enables the subframe mode with
gst_video_decoder_set_subframe_mode
, the base class will provide to the subclass the same input frame with different input buffers to the subclasshandleFrame
callback. During this call, the subclass needs to take ownership of the input_buffer asgstVideoCodecFrame
.input_buffer will have been changed before the next subframe buffer is received. The subclass will callgst_video_decoder_have_last_subframe
when a new input frame can be created by the base class. Every subframe will share the samegstVideoCodecFrame
.output_buffer to write the decoding result. The subclass is responsible to protect its access. - If codec processing results in decoded data, the subclass should call
gstVideoDecoderFinishFrame
to have decoded data pushed downstream. In subframe mode the subclass should callgstVideoDecoderFinishSubframe
until the last subframe where it should callgstVideoDecoderFinishFrame
. The subclass can detect the last subframe using GST_VIDEO_BUFFER_FLAG_MARKER on buffers or using its own logic to collect the subframes. In case of decoding failure, the subclass must callgstVideoDecoderDropFrame
orgstVideoDecoderDropSubframe
, to allow the base class to do timestamp and offset tracking, and possibly to requeue the frame for a later attempt in the case of reverse playback.
Shutdown phase
- The GstVideoDecoder class calls
stop
to inform the subclass that data parsing will be stopped.
Additional Notes
- Seeking/Flushing
- When the pipeline is seeked or otherwise flushed, the subclass is
informed via a call to its
reset
callback, with the hard parameter set to true. This indicates the subclass should drop any internal data queues and timestamps and prepare for a fresh set of buffers to arrive for parsing and decoding. - End Of Stream
- At end-of-stream, the subclass
parse
function may be called some final times with the at_eos parameter set to true, indicating that the element should not expect any more data to be arriving, and it should parse and remaining frames and callvideoDecoderHaveFrame
if possible.
The subclass is responsible for providing pad template caps for
source and sink pads. The pads need to be named "sink" and "src". It also
needs to provide information about the output caps, when they are known.
This may be when the base class calls the subclass' setFormat
function,
though it might be during decoding, before calling
gstVideoDecoderFinishFrame
. This is done via
gstVideoDecoderSetOutputState
The subclass is also responsible for providing (presentation) timestamps (likely based on corresponding input ones). If that is not applicable or possible, the base class provides limited framerate based interpolation.
Similarly, the base class provides some limited (legacy) seeking support
if specifically requested by the subclass, as full-fledged support
should rather be left to upstream demuxer, parser or alike. This simple
approach caters for seeking and duration reporting using estimated input
bitrates. To enable it, a subclass should call
gstVideoDecoderSetEstimateRate
to enable handling of incoming
byte-streams.
The base class provides some support for reverse playback, in particular in case incoming data is not packetized or upstream does not provide fragments on keyframe boundaries. However, the subclass should then be prepared for the parsing and frame processing stage to occur separately (in normal forward processing, the latter immediately follows the former), The subclass also needs to ensure the parsing stage properly marks keyframes, unless it knows the upstream elements will do so properly for incoming data.
The bare minimum that a functional subclass needs to implement is:
- Provide pad templates
- Inform the base class of output caps via
gstVideoDecoderSetOutputState
- Parse input data, if it is not considered packetized from upstream
Data will be provided to
parse
which should invokegstVideoDecoderAddToFrame
andgstVideoDecoderHaveFrame
to separate the data belonging to each video frame. - Accept data in
handleFrame
and provide decoded results togstVideoDecoderFinishFrame
, or callgstVideoDecoderDropFrame
.
Synopsis
- newtype VideoDecoder = VideoDecoder (ManagedPtr VideoDecoder)
- class (GObject o, IsDescendantOf VideoDecoder o) => IsVideoDecoder o
- toVideoDecoder :: (MonadIO m, IsVideoDecoder o) => o -> m VideoDecoder
- videoDecoderAddToFrame :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> Int32 -> m ()
- videoDecoderAllocateOutputBuffer :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> m (Maybe Buffer)
- videoDecoderAllocateOutputFrame :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> VideoCodecFrame -> m FlowReturn
- videoDecoderAllocateOutputFrameWithParams :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> VideoCodecFrame -> BufferPoolAcquireParams -> m FlowReturn
- videoDecoderDropFrame :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> VideoCodecFrame -> m FlowReturn
- videoDecoderDropSubframe :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> VideoCodecFrame -> m FlowReturn
- videoDecoderFinishFrame :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> VideoCodecFrame -> m FlowReturn
- videoDecoderFinishSubframe :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> VideoCodecFrame -> m FlowReturn
- videoDecoderGetAllocator :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> m (Maybe Allocator, AllocationParams)
- videoDecoderGetBufferPool :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> m (Maybe BufferPool)
- videoDecoderGetEstimateRate :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> m Int32
- videoDecoderGetFrame :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> Int32 -> m (Maybe VideoCodecFrame)
- videoDecoderGetFrames :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> m [VideoCodecFrame]
- videoDecoderGetInputSubframeIndex :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> VideoCodecFrame -> m Word32
- videoDecoderGetLatency :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> m (Word64, Word64)
- videoDecoderGetMaxDecodeTime :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> VideoCodecFrame -> m Int64
- videoDecoderGetMaxErrors :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> m Int32
- videoDecoderGetNeedsFormat :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> m Bool
- videoDecoderGetNeedsSyncPoint :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> m Bool
- videoDecoderGetOldestFrame :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> m (Maybe VideoCodecFrame)
- videoDecoderGetOutputState :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> m (Maybe VideoCodecState)
- videoDecoderGetPacketized :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> m Bool
- videoDecoderGetPendingFrameSize :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> m Word64
- videoDecoderGetProcessedSubframeIndex :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> VideoCodecFrame -> m Word32
- videoDecoderGetQosProportion :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> m Double
- videoDecoderGetSubframeMode :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> m Bool
- videoDecoderHaveFrame :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> m FlowReturn
- videoDecoderHaveLastSubframe :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> VideoCodecFrame -> m FlowReturn
- videoDecoderMergeTags :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> Maybe TagList -> TagMergeMode -> m ()
- videoDecoderNegotiate :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> m Bool
- videoDecoderProxyGetcaps :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> Maybe Caps -> Maybe Caps -> m Caps
- videoDecoderReleaseFrame :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> VideoCodecFrame -> m ()
- videoDecoderRequestSyncPoint :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> VideoCodecFrame -> [VideoDecoderRequestSyncPointFlags] -> m ()
- videoDecoderSetEstimateRate :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> Bool -> m ()
- videoDecoderSetInterlacedOutputState :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> VideoFormat -> VideoInterlaceMode -> Word32 -> Word32 -> Maybe VideoCodecState -> m (Maybe VideoCodecState)
- videoDecoderSetLatency :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> Word64 -> Word64 -> m ()
- videoDecoderSetMaxErrors :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> Int32 -> m ()
- videoDecoderSetNeedsFormat :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> Bool -> m ()
- videoDecoderSetNeedsSyncPoint :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> Bool -> m ()
- videoDecoderSetOutputState :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> VideoFormat -> Word32 -> Word32 -> Maybe VideoCodecState -> m (Maybe VideoCodecState)
- videoDecoderSetPacketized :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> Bool -> m ()
- videoDecoderSetSubframeMode :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> Bool -> m ()
- videoDecoderSetUseDefaultPadAcceptcaps :: (HasCallStack, MonadIO m, IsVideoDecoder a) => a -> Bool -> m ()
- constructVideoDecoderAutomaticRequestSyncPointFlags :: (IsVideoDecoder o, MonadIO m) => [VideoDecoderRequestSyncPointFlags] -> m (GValueConstruct o)
- getVideoDecoderAutomaticRequestSyncPointFlags :: (MonadIO m, IsVideoDecoder o) => o -> m [VideoDecoderRequestSyncPointFlags]
- setVideoDecoderAutomaticRequestSyncPointFlags :: (MonadIO m, IsVideoDecoder o) => o -> [VideoDecoderRequestSyncPointFlags] -> m ()
- constructVideoDecoderAutomaticRequestSyncPoints :: (IsVideoDecoder o, MonadIO m) => Bool -> m (GValueConstruct o)
- getVideoDecoderAutomaticRequestSyncPoints :: (MonadIO m, IsVideoDecoder o) => o -> m Bool
- setVideoDecoderAutomaticRequestSyncPoints :: (MonadIO m, IsVideoDecoder o) => o -> Bool -> m ()
- constructVideoDecoderDiscardCorruptedFrames :: (IsVideoDecoder o, MonadIO m) => Bool -> m (GValueConstruct o)
- getVideoDecoderDiscardCorruptedFrames :: (MonadIO m, IsVideoDecoder o) => o -> m Bool
- setVideoDecoderDiscardCorruptedFrames :: (MonadIO m, IsVideoDecoder o) => o -> Bool -> m ()
- constructVideoDecoderMaxErrors :: (IsVideoDecoder o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getVideoDecoderMaxErrors :: (MonadIO m, IsVideoDecoder o) => o -> m Int32
- setVideoDecoderMaxErrors :: (MonadIO m, IsVideoDecoder o) => o -> Int32 -> m ()
- constructVideoDecoderMinForceKeyUnitInterval :: (IsVideoDecoder o, MonadIO m) => Word64 -> m (GValueConstruct o)
- getVideoDecoderMinForceKeyUnitInterval :: (MonadIO m, IsVideoDecoder o) => o -> m Word64
- setVideoDecoderMinForceKeyUnitInterval :: (MonadIO m, IsVideoDecoder o) => o -> Word64 -> m ()
- constructVideoDecoderQos :: (IsVideoDecoder o, MonadIO m) => Bool -> m (GValueConstruct o)
- getVideoDecoderQos :: (MonadIO m, IsVideoDecoder o) => o -> m Bool
- setVideoDecoderQos :: (MonadIO m, IsVideoDecoder o) => o -> Bool -> m ()
Exported types
newtype VideoDecoder Source #
Memory-managed wrapper type.
VideoDecoder (ManagedPtr VideoDecoder) |
Instances
Eq VideoDecoder Source # | |
Defined in GI.GstVideo.Objects.VideoDecoder (==) :: VideoDecoder -> VideoDecoder -> Bool # (/=) :: VideoDecoder -> VideoDecoder -> Bool # | |
GObject VideoDecoder Source # | |
Defined in GI.GstVideo.Objects.VideoDecoder | |
ManagedPtrNewtype VideoDecoder Source # | |
Defined in GI.GstVideo.Objects.VideoDecoder toManagedPtr :: VideoDecoder -> ManagedPtr VideoDecoder | |
TypedObject VideoDecoder Source # | |
Defined in GI.GstVideo.Objects.VideoDecoder | |
HasParentTypes VideoDecoder Source # | |
Defined in GI.GstVideo.Objects.VideoDecoder | |
IsGValue (Maybe VideoDecoder) Source # | Convert |
Defined in GI.GstVideo.Objects.VideoDecoder gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe VideoDecoder -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe VideoDecoder) | |
type ParentTypes VideoDecoder Source # | |
Defined in GI.GstVideo.Objects.VideoDecoder type ParentTypes VideoDecoder = '[Element, Object, Object] |
class (GObject o, IsDescendantOf VideoDecoder o) => IsVideoDecoder o Source #
Type class for types which can be safely cast to VideoDecoder
, for instance with toVideoDecoder
.
Instances
(GObject o, IsDescendantOf VideoDecoder o) => IsVideoDecoder o Source # | |
Defined in GI.GstVideo.Objects.VideoDecoder |
toVideoDecoder :: (MonadIO m, IsVideoDecoder o) => o -> m VideoDecoder Source #
Cast to VideoDecoder
, 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
Methods
abortState, addControlBinding, addPad, addPropertyDeepNotifyWatch, addPropertyNotifyWatch, addToFrame, allocateOutputBuffer, allocateOutputFrame, allocateOutputFrameWithParams, bindProperty, bindPropertyFull, callAsync, changeState, continueState, createAllPads, defaultError, dropFrame, dropSubframe, finishFrame, finishSubframe, forceFloating, foreachPad, foreachSinkPad, foreachSrcPad, freezeNotify, getv, hasActiveControlBindings, hasAncestor, hasAsAncestor, hasAsParent, haveFrame, haveLastSubframe, isFloating, isLockedState, iteratePads, iterateSinkPads, iterateSrcPads, link, linkFiltered, linkPads, linkPadsFiltered, linkPadsFull, lostState, mergeTags, messageFull, messageFullWithDetails, negotiate, noMorePads, notify, notifyByPspec, postMessage, provideClock, proxyGetcaps, query, queryConvert, queryDuration, queryPosition, ref, refSink, releaseFrame, releaseRequestPad, removeControlBinding, removePad, removePropertyNotifyWatch, requestPad, requestPadSimple, requestSyncPoint, runDispose, seek, seekSimple, sendEvent, stealData, stealQdata, suggestNextSync, syncStateWithParent, syncValues, thawNotify, unlink, unlinkPads, unparent, unref, watchClosure.
Getters
getAllocator, getBaseTime, getBufferPool, getBus, getClock, getCompatiblePad, getCompatiblePadTemplate, getContext, getContextUnlocked, getContexts, getControlBinding, getControlRate, getCurrentClockTime, getCurrentRunningTime, getData, getEstimateRate, getFactory, getFrame, getFrames, getGValueArray, getInputSubframeIndex, getLatency, getMaxDecodeTime, getMaxErrors, getMetadata, getName, getNeedsFormat, getNeedsSyncPoint, getOldestFrame, getOutputState, getPacketized, getPadTemplate, getPadTemplateList, getParent, getPathString, getPendingFrameSize, getProcessedSubframeIndex, getProperty, getQdata, getQosProportion, getRequestPad, getStartTime, getState, getStaticPad, getSubframeMode, getValue.
Setters
setBaseTime, setBus, setClock, setContext, setControlBindingDisabled, setControlBindingsDisabled, setControlRate, setData, setDataFull, setEstimateRate, setInterlacedOutputState, setLatency, setLockedState, setMaxErrors, setName, setNeedsFormat, setNeedsSyncPoint, setOutputState, setPacketized, setParent, setProperty, setStartTime, setState, setSubframeMode, setUseDefaultPadAcceptcaps.
addToFrame
videoDecoderAddToFrame Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> Int32 |
|
-> m () |
Removes next nBytes
of input data and adds it to currently parsed frame.
allocateOutputBuffer
videoDecoderAllocateOutputBuffer Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> m (Maybe Buffer) | Returns: allocated buffer, or NULL if no buffer could be allocated (e.g. when downstream is flushing or shutting down) |
Helper function that allocates a buffer to hold a video frame for decoder
's
current VideoCodecState
.
You should use videoDecoderAllocateOutputFrame
instead of this
function, if possible at all.
allocateOutputFrame
videoDecoderAllocateOutputFrame Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> VideoCodecFrame |
|
-> m FlowReturn | Returns: |
Helper function that allocates a buffer to hold a video frame for decoder
's
current VideoCodecState
. Subclass should already have configured video
state and set src pad caps.
The buffer allocated here is owned by the frame and you should only keep references to the frame, not the buffer.
allocateOutputFrameWithParams
videoDecoderAllocateOutputFrameWithParams Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> VideoCodecFrame |
|
-> BufferPoolAcquireParams |
|
-> m FlowReturn | Returns: |
Same as gst_video_decoder_allocate_output_frame
except it allows passing
BufferPoolAcquireParams
to the sub call gst_buffer_pool_acquire_buffer.
Since: 1.12
dropFrame
videoDecoderDropFrame Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> VideoCodecFrame |
|
-> m FlowReturn | Returns: a |
Similar to videoDecoderFinishFrame
, but drops frame
in any
case and posts a QoS message with the frame's details on the bus.
In any case, the frame is considered finished and released.
dropSubframe
videoDecoderDropSubframe Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> VideoCodecFrame |
|
-> m FlowReturn | Returns: a |
Drops input data. The frame is not considered finished until the whole frame is finished or dropped by the subclass.
Since: 1.20
finishFrame
videoDecoderFinishFrame Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> VideoCodecFrame |
|
-> m FlowReturn | Returns: a |
frame
should have a valid decoded data buffer, whose metadata fields
are then appropriately set according to frame data and pushed downstream.
If no output data is provided, frame
is considered skipped.
In any case, the frame is considered finished and released.
After calling this function the output buffer of the frame is to be considered read-only. This function will also change the metadata of the buffer.
finishSubframe
videoDecoderFinishSubframe Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> VideoCodecFrame |
|
-> m FlowReturn | Returns: a |
Indicate that a subframe has been finished to be decoded
by the subclass. This method should be called for all subframes
except the last subframe where gstVideoDecoderFinishFrame
should be called instead.
Since: 1.20
getAllocator
videoDecoderGetAllocator Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> m (Maybe Allocator, AllocationParams) |
Lets VideoDecoder
sub-classes to know the memory allocator
used by the base class and its params
.
Unref the allocator
after use it.
getBufferPool
videoDecoderGetBufferPool Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> m (Maybe BufferPool) | Returns: the instance of the |
No description available in the introspection data.
getEstimateRate
videoDecoderGetEstimateRate Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> m Int32 | Returns: currently configured byte to time conversion setting |
No description available in the introspection data.
getFrame
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> Int32 |
|
-> m (Maybe VideoCodecFrame) | Returns: pending unfinished |
Get a pending unfinished VideoCodecFrame
getFrames
videoDecoderGetFrames Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> m [VideoCodecFrame] | Returns: pending unfinished |
Get all pending unfinished VideoCodecFrame
getInputSubframeIndex
videoDecoderGetInputSubframeIndex Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> VideoCodecFrame |
|
-> m Word32 | Returns: the current subframe index received in subframe mode, 1 otherwise. |
Queries the number of the last subframe received by
the decoder baseclass in the frame
.
Since: 1.20
getLatency
videoDecoderGetLatency Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> m (Word64, Word64) |
Query the configured decoder latency. Results will be returned via
minLatency
and maxLatency
.
getMaxDecodeTime
videoDecoderGetMaxDecodeTime Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> VideoCodecFrame |
|
-> m Int64 | Returns: max decoding time. |
Determines maximum possible decoding time for frame
that will
allow it to decode and arrive in time (as determined by QoS events).
In particular, a negative result means decoding in time is no longer possible
and should therefore occur as soon/skippy as possible.
getMaxErrors
videoDecoderGetMaxErrors Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> m Int32 | Returns: currently configured decoder tolerated error count. |
No description available in the introspection data.
getNeedsFormat
videoDecoderGetNeedsFormat Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> m Bool | Returns: |
Queries decoder required format handling.
Since: 1.4
getNeedsSyncPoint
videoDecoderGetNeedsSyncPoint Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> m Bool | Returns: |
Queries if the decoder requires a sync point before it starts outputting data in the beginning.
Since: 1.20
getOldestFrame
videoDecoderGetOldestFrame Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> m (Maybe VideoCodecFrame) | Returns: oldest pending unfinished |
Get the oldest pending unfinished VideoCodecFrame
getOutputState
videoDecoderGetOutputState Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> m (Maybe VideoCodecState) | Returns: |
Get the VideoCodecState
currently describing the output stream.
getPacketized
videoDecoderGetPacketized Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> m Bool | Returns: TRUE if input data is considered packetized. |
Queries whether input data is considered packetized or not by the base class.
getPendingFrameSize
videoDecoderGetPendingFrameSize Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> m Word64 | Returns: The number of bytes pending for the current frame |
Returns the number of bytes previously added to the current frame
by calling videoDecoderAddToFrame
.
Since: 1.4
getProcessedSubframeIndex
videoDecoderGetProcessedSubframeIndex Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> VideoCodecFrame |
|
-> m Word32 | Returns: the current subframe processed received in subframe mode. |
Queries the number of subframes in the frame processed by the decoder baseclass.
Since: 1.20
getQosProportion
videoDecoderGetQosProportion Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> m Double | Returns: The current QoS proportion. |
No description available in the introspection data.
Since: 1.0.3
getSubframeMode
videoDecoderGetSubframeMode Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> m Bool | Returns: TRUE if input data is considered as sub frames. |
Queries whether input data is considered as subframes or not by the base class. If FALSE, each input buffer will be considered as a full frame.
Since: 1.20
haveFrame
videoDecoderHaveFrame Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> m FlowReturn | Returns: a |
Gathers all data collected for currently parsed frame, gathers corresponding
metadata and passes it along for further processing, i.e. handleFrame
.
haveLastSubframe
videoDecoderHaveLastSubframe Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> VideoCodecFrame |
|
-> m FlowReturn | Returns: a |
Indicates that the last subframe has been processed by the decoder
in frame
. This will release the current frame in video decoder
allowing to receive new frames from upstream elements. This method
must be called in the subclass handleFrame
callback.
Since: 1.20
mergeTags
videoDecoderMergeTags Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> Maybe TagList |
|
-> TagMergeMode |
|
-> m () |
Sets the audio decoder tags and how they should be merged with any
upstream stream tags. This will override any tags previously-set
with gst_audio_decoder_merge_tags()
.
Note that this is provided for convenience, and the subclass is not required to use this and can still do tag handling on its own.
MT safe.
negotiate
videoDecoderNegotiate Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> m Bool |
Negotiate with downstream elements to currently configured VideoCodecState
.
Unmark GST_PAD_FLAG_NEED_RECONFIGURE in any case. But mark it again if
negotiate fails.
proxyGetcaps
videoDecoderProxyGetcaps Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> Maybe Caps |
|
-> Maybe Caps |
|
-> m Caps | Returns: a |
Returns caps that express caps
(or sink template caps if caps
== NULL)
restricted to resolution/format/... combinations supported by downstream
elements.
Since: 1.6
releaseFrame
videoDecoderReleaseFrame Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> VideoCodecFrame |
|
-> m () |
Similar to videoDecoderDropFrame
, but simply releases frame
without any processing other than removing it from list of pending frames,
after which it is considered finished and released.
Since: 1.2.2
requestSyncPoint
videoDecoderRequestSyncPoint Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> VideoCodecFrame |
|
-> [VideoDecoderRequestSyncPointFlags] | |
-> m () |
Allows the VideoDecoder
subclass to request from the base class that
a new sync should be requested from upstream, and that frame
was the frame
when the subclass noticed that a new sync point is required. A reason for
the subclass to do this could be missing reference frames, for example.
The base class will then request a new sync point from upstream as long as the time that passed since the last one is exceeding VideoDecoder:minForceKeyUnitInterval.
The subclass can signal via flags
how the frames until the next sync point
should be handled:
- If
VideoDecoderRequestSyncPointFlagsDiscardInput
is selected then all following input frames until the next sync point are discarded. This can be useful if the lack of a sync point will prevent all further decoding and the decoder implementation is not very robust in handling missing references frames. - If
VideoDecoderRequestSyncPointFlagsCorruptOutput
is selected then all output frames followingframe
are marked as corrupted viaBufferFlagsCorrupted
. Corrupted frames can be automatically dropped by the base class, see VideoDecoder:discardCorruptedFrames. Subclasses can manually mark frames as corrupted viaVideoCodecFrameFlagsCorrupted
before callingvideoDecoderFinishFrame
.
Since: 1.20
setEstimateRate
videoDecoderSetEstimateRate Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> Bool |
|
-> m () |
Allows baseclass to perform byte to time estimated conversion.
setInterlacedOutputState
videoDecoderSetInterlacedOutputState Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> VideoFormat |
|
-> VideoInterlaceMode |
|
-> Word32 |
|
-> Word32 |
|
-> Maybe VideoCodecState |
|
-> m (Maybe VideoCodecState) | Returns: the newly configured output state. |
Same as gst_video_decoder_set_output_state
() but also allows you to also set
the interlacing mode.
Since: 1.16.
setLatency
videoDecoderSetLatency Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> Word64 |
|
-> Word64 |
|
-> m () |
Lets VideoDecoder
sub-classes tell the baseclass what the decoder latency
is. If the provided values changed from previously provided ones, this will
also post a LATENCY message on the bus so the pipeline can reconfigure its
global latency.
setMaxErrors
videoDecoderSetMaxErrors Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> Int32 |
|
-> m () |
Sets numbers of tolerated decoder errors, where a tolerated one is then only warned about, but more than tolerated will lead to fatal error. You can set -1 for never returning fatal errors. Default is set to GST_VIDEO_DECODER_MAX_ERRORS.
The '-1' option was added in 1.4
setNeedsFormat
videoDecoderSetNeedsFormat Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> Bool |
|
-> m () |
Configures decoder format needs. If enabled, subclass needs to be negotiated with format caps before it can process any data. It will then never be handed any data before it has been configured. Otherwise, it might be handed data without having been configured and is then expected being able to do so either by default or based on the input data.
Since: 1.4
setNeedsSyncPoint
videoDecoderSetNeedsSyncPoint Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> Bool |
|
-> m () |
Configures whether the decoder requires a sync point before it starts outputting data in the beginning. If enabled, the base class will discard all non-sync point frames in the beginning and after a flush and does not pass it to the subclass.
If the first frame is not a sync point, the base class will request a sync point via the force-key-unit event.
Since: 1.20
setOutputState
videoDecoderSetOutputState Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> VideoFormat |
|
-> Word32 |
|
-> Word32 |
|
-> Maybe VideoCodecState |
|
-> m (Maybe VideoCodecState) | Returns: the newly configured output state. |
Creates a new VideoCodecState
with the specified fmt
, width
and height
as the output state for the decoder.
Any previously set output state on decoder
will be replaced by the newly
created one.
If the subclass wishes to copy over existing fields (like pixel aspec ratio,
or framerate) from an existing VideoCodecState
, it can be provided as a
reference
.
If the subclass wishes to override some fields from the output state (like
pixel-aspect-ratio or framerate) it can do so on the returned VideoCodecState
.
The new output state will only take effect (set on pads and buffers) starting
from the next call to gst_video_decoder_finish_frame
().
setPacketized
videoDecoderSetPacketized Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> Bool |
|
-> m () |
Allows baseclass to consider input data as packetized or not. If the
input is packetized, then the parse
method will not be called.
setSubframeMode
videoDecoderSetSubframeMode Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> Bool |
|
-> m () |
If this is set to TRUE, it informs the base class that the subclass can receive the data at a granularity lower than one frame.
Note that in this mode, the subclass has two options. It can either
require the presence of a GST_VIDEO_BUFFER_FLAG_MARKER to mark the
end of a frame. Or it can operate in such a way that it will decode
a single frame at a time. In this second case, every buffer that
arrives to the element is considered part of the same frame until
videoDecoderFinishFrame
is called.
In either case, the same VideoCodecFrame
will be passed to the
GstVideoDecoderClass:handle_frame vmethod repeatedly with a
different GstVideoCodecFrame:input_buffer every time until the end of the
frame has been signaled using either method.
This method must be called during the decoder subclass setFormat
call.
Since: 1.20
setUseDefaultPadAcceptcaps
videoDecoderSetUseDefaultPadAcceptcaps Source #
:: (HasCallStack, MonadIO m, IsVideoDecoder a) | |
=> a |
|
-> Bool |
|
-> m () |
Lets VideoDecoder
sub-classes decide if they want the sink pad
to use the default pad query handler to reply to accept-caps queries.
By setting this to true it is possible to further customize the default
handler with GST_PAD_SET_ACCEPT_INTERSECT
and
GST_PAD_SET_ACCEPT_TEMPLATE
Since: 1.6
Properties
automaticRequestSyncPointFlags
GstVideoDecoderRequestSyncPointFlags to use for the automatically
requested sync points if automatic-request-sync-points
is enabled.
Since: 1.20
constructVideoDecoderAutomaticRequestSyncPointFlags :: (IsVideoDecoder o, MonadIO m) => [VideoDecoderRequestSyncPointFlags] -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “automatic-request-sync-point-flags
” property. This is rarely needed directly, but it is used by new
.
getVideoDecoderAutomaticRequestSyncPointFlags :: (MonadIO m, IsVideoDecoder o) => o -> m [VideoDecoderRequestSyncPointFlags] Source #
Get the value of the “automatic-request-sync-point-flags
” property.
When overloading is enabled, this is equivalent to
get
videoDecoder #automaticRequestSyncPointFlags
setVideoDecoderAutomaticRequestSyncPointFlags :: (MonadIO m, IsVideoDecoder o) => o -> [VideoDecoderRequestSyncPointFlags] -> m () Source #
Set the value of the “automatic-request-sync-point-flags
” property.
When overloading is enabled, this is equivalent to
set
videoDecoder [ #automaticRequestSyncPointFlags:=
value ]
automaticRequestSyncPoints
If set to True
the decoder will automatically request sync points when
it seems like a good idea, e.g. if the first frames are not key frames or
if packet loss was reported by upstream.
Since: 1.20
constructVideoDecoderAutomaticRequestSyncPoints :: (IsVideoDecoder o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “automatic-request-sync-points
” property. This is rarely needed directly, but it is used by new
.
getVideoDecoderAutomaticRequestSyncPoints :: (MonadIO m, IsVideoDecoder o) => o -> m Bool Source #
Get the value of the “automatic-request-sync-points
” property.
When overloading is enabled, this is equivalent to
get
videoDecoder #automaticRequestSyncPoints
setVideoDecoderAutomaticRequestSyncPoints :: (MonadIO m, IsVideoDecoder o) => o -> Bool -> m () Source #
Set the value of the “automatic-request-sync-points
” property.
When overloading is enabled, this is equivalent to
set
videoDecoder [ #automaticRequestSyncPoints:=
value ]
discardCorruptedFrames
If set to True
the decoder will discard frames that are marked as
corrupted instead of outputting them.
Since: 1.20
constructVideoDecoderDiscardCorruptedFrames :: (IsVideoDecoder o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “discard-corrupted-frames
” property. This is rarely needed directly, but it is used by new
.
getVideoDecoderDiscardCorruptedFrames :: (MonadIO m, IsVideoDecoder o) => o -> m Bool Source #
Get the value of the “discard-corrupted-frames
” property.
When overloading is enabled, this is equivalent to
get
videoDecoder #discardCorruptedFrames
setVideoDecoderDiscardCorruptedFrames :: (MonadIO m, IsVideoDecoder o) => o -> Bool -> m () Source #
Set the value of the “discard-corrupted-frames
” property.
When overloading is enabled, this is equivalent to
set
videoDecoder [ #discardCorruptedFrames:=
value ]
maxErrors
Maximum number of tolerated consecutive decode errors. See
videoDecoderSetMaxErrors
for more details.
Since: 1.18
constructVideoDecoderMaxErrors :: (IsVideoDecoder o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “max-errors
” property. This is rarely needed directly, but it is used by new
.
getVideoDecoderMaxErrors :: (MonadIO m, IsVideoDecoder o) => o -> m Int32 Source #
Get the value of the “max-errors
” property.
When overloading is enabled, this is equivalent to
get
videoDecoder #maxErrors
setVideoDecoderMaxErrors :: (MonadIO m, IsVideoDecoder o) => o -> Int32 -> m () Source #
Set the value of the “max-errors
” property.
When overloading is enabled, this is equivalent to
set
videoDecoder [ #maxErrors:=
value ]
minForceKeyUnitInterval
Minimum interval between force-key-unit events sent upstream by the
decoder. Setting this to 0 will cause every event to be handled, setting
this to CLOCK_TIME_NONE
will cause every event to be ignored.
See videoEventNewUpstreamForceKeyUnit
for more details about
force-key-unit events.
Since: 1.20
constructVideoDecoderMinForceKeyUnitInterval :: (IsVideoDecoder o, MonadIO m) => Word64 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “min-force-key-unit-interval
” property. This is rarely needed directly, but it is used by new
.
getVideoDecoderMinForceKeyUnitInterval :: (MonadIO m, IsVideoDecoder o) => o -> m Word64 Source #
Get the value of the “min-force-key-unit-interval
” property.
When overloading is enabled, this is equivalent to
get
videoDecoder #minForceKeyUnitInterval
setVideoDecoderMinForceKeyUnitInterval :: (MonadIO m, IsVideoDecoder o) => o -> Word64 -> m () Source #
Set the value of the “min-force-key-unit-interval
” property.
When overloading is enabled, this is equivalent to
set
videoDecoder [ #minForceKeyUnitInterval:=
value ]
qos
If set to True
the decoder will handle QoS events received
from downstream elements.
This includes dropping output frames which are detected as late
using the metrics reported by those events.
Since: 1.18
constructVideoDecoderQos :: (IsVideoDecoder o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “qos
” property. This is rarely needed directly, but it is used by new
.
getVideoDecoderQos :: (MonadIO m, IsVideoDecoder o) => o -> m Bool Source #
Get the value of the “qos
” property.
When overloading is enabled, this is equivalent to
get
videoDecoder #qos
setVideoDecoderQos :: (MonadIO m, IsVideoDecoder o) => o -> Bool -> m () Source #
Set the value of the “qos
” property.
When overloading is enabled, this is equivalent to
set
videoDecoder [ #qos:=
value ]