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 |
GI.GstVideo.Structs.VideoOverlayComposition
Contents
Description
<refsect2>
<para>
Functions to create and handle overlay compositions on video buffers.
</para>
<para>
An overlay composition describes one or more overlay rectangles to be
blended on top of a video buffer.
</para>
<para>
This API serves two main purposes:
<itemizedlist>
<listitem>
it can be used to attach overlay information (subtitles or logos)
to non-raw video buffers such as GL/VAAPI/VDPAU surfaces. The actual
blending of the overlay can then be done by e.g. the video sink that
processes these non-raw buffers.
</listitem>
<listitem>
it can also be used to blend overlay rectangles on top of raw video
buffers, thus consolidating blending functionality for raw video in
one place.
</listitem>
Together, this allows existing overlay elements to easily handle raw
and non-raw video as input in without major changes (once the overlays
have been put into a GstOverlayComposition
object anyway) - for raw
video the overlay can just use the blending function to blend the data
on top of the video, and for surface buffers it can just attach them to
the buffer and let the sink render the overlays.
</itemizedlist>
</para>
</refsect2>
- newtype VideoOverlayComposition = VideoOverlayComposition (ManagedPtr VideoOverlayComposition)
- noVideoOverlayComposition :: Maybe VideoOverlayComposition
- data VideoOverlayCompositionAddRectangleMethodInfo
- videoOverlayCompositionAddRectangle :: (HasCallStack, MonadIO m) => VideoOverlayComposition -> VideoOverlayRectangle -> m ()
- data VideoOverlayCompositionBlendMethodInfo
- videoOverlayCompositionBlend :: (HasCallStack, MonadIO m) => VideoOverlayComposition -> VideoFrame -> m Bool
- data VideoOverlayCompositionCopyMethodInfo
- videoOverlayCompositionCopy :: (HasCallStack, MonadIO m) => VideoOverlayComposition -> m VideoOverlayComposition
- data VideoOverlayCompositionGetRectangleMethodInfo
- videoOverlayCompositionGetRectangle :: (HasCallStack, MonadIO m) => VideoOverlayComposition -> Word32 -> m VideoOverlayRectangle
- data VideoOverlayCompositionGetSeqnumMethodInfo
- videoOverlayCompositionGetSeqnum :: (HasCallStack, MonadIO m) => VideoOverlayComposition -> m Word32
- data VideoOverlayCompositionMakeWritableMethodInfo
- videoOverlayCompositionMakeWritable :: (HasCallStack, MonadIO m) => VideoOverlayComposition -> m VideoOverlayComposition
- data VideoOverlayCompositionNRectanglesMethodInfo
- videoOverlayCompositionNRectangles :: (HasCallStack, MonadIO m) => VideoOverlayComposition -> m Word32
- videoOverlayCompositionNew :: (HasCallStack, MonadIO m) => VideoOverlayRectangle -> m VideoOverlayComposition
Exported types
newtype VideoOverlayComposition Source #
Constructors
VideoOverlayComposition (ManagedPtr VideoOverlayComposition) |
Instances
Methods
addRectangle
data VideoOverlayCompositionAddRectangleMethodInfo Source #
Instances
((~) * signature (VideoOverlayRectangle -> m ()), MonadIO m) => MethodInfo * VideoOverlayCompositionAddRectangleMethodInfo VideoOverlayComposition signature Source # | |
videoOverlayCompositionAddRectangle Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayComposition |
|
-> VideoOverlayRectangle |
|
-> m () |
Adds an overlay rectangle to an existing overlay composition object. This must be done right after creating the overlay composition.
blend
data VideoOverlayCompositionBlendMethodInfo Source #
Instances
((~) * signature (VideoFrame -> m Bool), MonadIO m) => MethodInfo * VideoOverlayCompositionBlendMethodInfo VideoOverlayComposition signature Source # | |
videoOverlayCompositionBlend Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayComposition |
|
-> VideoFrame |
|
-> m Bool |
Blends the overlay rectangles in comp
on top of the raw video data
contained in videoBuf
. The data in videoBuf
must be writable and
mapped appropriately.
Since videoBuf
data is read and will be modified, it ought be
mapped with flag GST_MAP_READWRITE.
copy
data VideoOverlayCompositionCopyMethodInfo Source #
Instances
((~) * signature (m VideoOverlayComposition), MonadIO m) => MethodInfo * VideoOverlayCompositionCopyMethodInfo VideoOverlayComposition signature Source # | |
videoOverlayCompositionCopy Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayComposition |
|
-> m VideoOverlayComposition | Returns: a new |
Makes a copy of comp
and all contained rectangles, so that it is possible
to modify the composition and contained rectangles (e.g. add additional
rectangles or change the render co-ordinates or render dimension). The
actual overlay pixel data buffers contained in the rectangles are not
copied.
getRectangle
data VideoOverlayCompositionGetRectangleMethodInfo Source #
Instances
((~) * signature (Word32 -> m VideoOverlayRectangle), MonadIO m) => MethodInfo * VideoOverlayCompositionGetRectangleMethodInfo VideoOverlayComposition signature Source # | |
videoOverlayCompositionGetRectangle Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayComposition |
|
-> Word32 |
|
-> m VideoOverlayRectangle | Returns: the |
Returns the n
-th VideoOverlayRectangle
contained in comp
.
getSeqnum
data VideoOverlayCompositionGetSeqnumMethodInfo Source #
Instances
((~) * signature (m Word32), MonadIO m) => MethodInfo * VideoOverlayCompositionGetSeqnumMethodInfo VideoOverlayComposition signature Source # | |
videoOverlayCompositionGetSeqnum Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayComposition |
|
-> m Word32 | Returns: the sequence number of |
Returns the sequence number of this composition. Sequence numbers are monotonically increasing and unique for overlay compositions and rectangles (meaning there will never be a rectangle with the same sequence number as a composition).
makeWritable
data VideoOverlayCompositionMakeWritableMethodInfo Source #
Instances
((~) * signature (m VideoOverlayComposition), MonadIO m) => MethodInfo * VideoOverlayCompositionMakeWritableMethodInfo VideoOverlayComposition signature Source # | |
videoOverlayCompositionMakeWritable Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayComposition |
|
-> m VideoOverlayComposition | Returns: a writable |
Takes ownership of comp
and returns a version of comp
that is writable
(i.e. can be modified). Will either return comp
right away, or create a
new writable copy of comp
and unref comp
itself. All the contained
rectangles will also be copied, but the actual overlay pixel data buffers
contained in the rectangles are not copied.
nRectangles
data VideoOverlayCompositionNRectanglesMethodInfo Source #
Instances
((~) * signature (m Word32), MonadIO m) => MethodInfo * VideoOverlayCompositionNRectanglesMethodInfo VideoOverlayComposition signature Source # | |
videoOverlayCompositionNRectangles Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayComposition |
|
-> m Word32 | Returns: the number of rectangles |
Returns the number of VideoOverlayRectangle
<!-- -->s contained in comp
.
new
videoOverlayCompositionNew Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayRectangle |
|
-> m VideoOverlayComposition | Returns: a new |
Creates a new video overlay composition object to hold one or more overlay rectangles.