VideoOverlayComposition

Functions to create and handle overlay compositions on video buffers.

An overlay composition describes one or more overlay rectangles to be blended on top of a video buffer.

This API serves two main purposes:

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

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 #GstVideoOverlayComposition 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.

Constructors

this
this(gstvideo.video_overlay_rectangle.VideoOverlayRectangle rectangle)

Creates a new video overlay composition object to hold one or more overlay rectangles.

Members

Functions

addRectangle
void addRectangle(gstvideo.video_overlay_rectangle.VideoOverlayRectangle rectangle)

Adds an overlay rectangle to an existing overlay composition object. This must be done right after creating the overlay composition.

blend
bool blend(gstvideo.video_frame.VideoFrame videoBuf)

Blends the overlay rectangles in comp on top of the raw video data contained in video_buf. The data in video_buf must be writable and mapped appropriately.

copy
gstvideo.video_overlay_composition.VideoOverlayComposition copy()

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
gstvideo.video_overlay_rectangle.VideoOverlayRectangle getRectangle(uint n)

Returns the n-th #GstVideoOverlayRectangle contained in comp.

getSeqnum
uint getSeqnum()

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
gstvideo.video_overlay_composition.VideoOverlayComposition makeWritable()

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
uint nRectangles()

Returns the number of #GstVideoOverlayRectangle<!-- -->s contained in comp.

Inherited Members

From Boxed

cInstancePtr
void* cInstancePtr;

Pointer to the C boxed value

getType
GType getType()

Get the GType of this boxed type.

gType
GType gType [@property getter]

Boxed GType property.

self
Boxed self()

Convenience method to return this cast to a type. For use in D with statements.

copy_
void* copy_()

Make a copy of the wrapped C boxed data.

boxedCopy
void* boxedCopy(void* cBoxed)

Copy a C boxed value using g_boxed_copy.

boxedFree
void boxedFree(void* cBoxed)

Free a C boxed value using g_boxed_free.