gi-gstvideo-1.0.28: GStreamerVideo bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.GstVideo.Structs.VideoOverlayRectangle

Description

An opaque video overlay rectangle object. A rectangle contains a single overlay rectangle which can be added to a composition.

Synopsis

Exported types

newtype VideoOverlayRectangle Source #

Memory-managed wrapper type.

Constructors

VideoOverlayRectangle (ManagedPtr VideoOverlayRectangle) 

Methods

copy

videoOverlayRectangleCopy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoOverlayRectangle

rectangle: a VideoOverlayRectangle to copy

-> m VideoOverlayRectangle

Returns: a new VideoOverlayRectangle equivalent to rectangle.

Makes a copy of rectangle, so that it is possible to modify it (e.g. to change the render co-ordinates or render dimension). The actual overlay pixel data buffers contained in the rectangle are not copied.

getFlags

videoOverlayRectangleGetFlags Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoOverlayRectangle

rectangle: a VideoOverlayRectangle

-> m [VideoOverlayFormatFlags]

Returns: the VideoOverlayFormatFlags associated with the rectangle.

Retrieves the flags associated with a VideoOverlayRectangle. This is useful if the caller can handle both premultiplied alpha and non premultiplied alpha, for example. By knowing whether the rectangle uses premultiplied or not, it can request the pixel data in the format it is stored in, to avoid unnecessary conversion.

getGlobalAlpha

videoOverlayRectangleGetGlobalAlpha Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoOverlayRectangle

rectangle: a VideoOverlayRectangle

-> m Float

Returns: the global-alpha value associated with the rectangle.

Retrieves the global-alpha value associated with a VideoOverlayRectangle.

getPixelsArgb

videoOverlayRectangleGetPixelsArgb Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoOverlayRectangle

rectangle: a VideoOverlayRectangle

-> [VideoOverlayFormatFlags]

flags: flags If a global_alpha value != 1 is set for the rectangle, the caller should set the GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA flag if he wants to apply global-alpha himself. If the flag is not set global_alpha is applied internally before returning the pixel-data.

-> m Buffer

Returns: a Buffer holding the ARGB pixel data with width and height of the render dimensions as per videoOverlayRectangleGetRenderRectangle. This function does not return a reference, the caller should obtain a reference of her own with gst_buffer_ref() if needed.

No description available in the introspection data.

getPixelsAyuv

videoOverlayRectangleGetPixelsAyuv Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoOverlayRectangle

rectangle: a VideoOverlayRectangle

-> [VideoOverlayFormatFlags]

flags: flags If a global_alpha value != 1 is set for the rectangle, the caller should set the GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA flag if he wants to apply global-alpha himself. If the flag is not set global_alpha is applied internally before returning the pixel-data.

-> m Buffer

Returns: a Buffer holding the AYUV pixel data with width and height of the render dimensions as per videoOverlayRectangleGetRenderRectangle. This function does not return a reference, the caller should obtain a reference of her own with gst_buffer_ref() if needed.

No description available in the introspection data.

getPixelsRaw

videoOverlayRectangleGetPixelsRaw Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoOverlayRectangle

rectangle: a VideoOverlayRectangle

-> [VideoOverlayFormatFlags]

flags: flags If a global_alpha value != 1 is set for the rectangle, the caller should set the GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA flag if he wants to apply global-alpha himself. If the flag is not set global_alpha is applied internally before returning the pixel-data.

-> m Buffer

Returns: a Buffer holding the pixel data with format as originally provided and specified in video meta with width and height of the render dimensions as per videoOverlayRectangleGetRenderRectangle. This function does not return a reference, the caller should obtain a reference of her own with gst_buffer_ref() if needed.

No description available in the introspection data.

getPixelsUnscaledArgb

videoOverlayRectangleGetPixelsUnscaledArgb Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoOverlayRectangle

rectangle: a VideoOverlayRectangle

-> [VideoOverlayFormatFlags]

flags: flags. If a global_alpha value != 1 is set for the rectangle, the caller should set the GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA flag if he wants to apply global-alpha himself. If the flag is not set global_alpha is applied internally before returning the pixel-data.

-> m Buffer

Returns: a Buffer holding the ARGB pixel data with VideoMeta set. This function does not return a reference, the caller should obtain a reference of her own with gst_buffer_ref() if needed.

Retrieves the pixel data as it is. This is useful if the caller can do the scaling itself when handling the overlaying. The rectangle will need to be scaled to the render dimensions, which can be retrieved using videoOverlayRectangleGetRenderRectangle.

getPixelsUnscaledAyuv

videoOverlayRectangleGetPixelsUnscaledAyuv Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoOverlayRectangle

rectangle: a VideoOverlayRectangle

-> [VideoOverlayFormatFlags]

flags: flags. If a global_alpha value != 1 is set for the rectangle, the caller should set the GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA flag if he wants to apply global-alpha himself. If the flag is not set global_alpha is applied internally before returning the pixel-data.

-> m Buffer

Returns: a Buffer holding the AYUV pixel data with VideoMeta set. This function does not return a reference, the caller should obtain a reference of her own with gst_buffer_ref() if needed.

Retrieves the pixel data as it is. This is useful if the caller can do the scaling itself when handling the overlaying. The rectangle will need to be scaled to the render dimensions, which can be retrieved using videoOverlayRectangleGetRenderRectangle.

getPixelsUnscaledRaw

videoOverlayRectangleGetPixelsUnscaledRaw Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoOverlayRectangle

rectangle: a VideoOverlayRectangle

-> [VideoOverlayFormatFlags]

flags: flags. If a global_alpha value != 1 is set for the rectangle, the caller should set the GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA flag if he wants to apply global-alpha himself. If the flag is not set global_alpha is applied internally before returning the pixel-data.

-> m Buffer

Returns: a Buffer holding the pixel data with VideoMeta set. This function does not return a reference, the caller should obtain a reference of her own with gst_buffer_ref() if needed.

Retrieves the pixel data as it is. This is useful if the caller can do the scaling itself when handling the overlaying. The rectangle will need to be scaled to the render dimensions, which can be retrieved using videoOverlayRectangleGetRenderRectangle.

getRenderRectangle

videoOverlayRectangleGetRenderRectangle Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoOverlayRectangle

rectangle: a VideoOverlayRectangle

-> m (Bool, Int32, Int32, Word32, Word32)

Returns: TRUE if valid render dimensions were retrieved.

Retrieves the render position and render dimension of the overlay rectangle on the video.

getSeqnum

videoOverlayRectangleGetSeqnum Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoOverlayRectangle

rectangle: a VideoOverlayRectangle

-> m Word32

Returns: the sequence number of rectangle

Returns the sequence number of this rectangle. 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).

Using the sequence number of a rectangle as an indicator for changed pixel-data of a rectangle is dangereous. Some API calls, like e.g. videoOverlayRectangleSetGlobalAlpha, automatically update the per rectangle sequence number, which is misleading for renderers/ consumers, that handle global-alpha themselves. For them the pixel-data returned by gst_video_overlay_rectangle_get_pixels_*() won't be different for different global-alpha values. In this case a renderer could also use the GstBuffer pointers as a hint for changed pixel-data.

newRaw

videoOverlayRectangleNewRaw Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Buffer

pixels: a Buffer pointing to the pixel memory

-> Int32

renderX: the X co-ordinate on the video where the top-left corner of this overlay rectangle should be rendered to

-> Int32

renderY: the Y co-ordinate on the video where the top-left corner of this overlay rectangle should be rendered to

-> Word32

renderWidth: the render width of this rectangle on the video

-> Word32

renderHeight: the render height of this rectangle on the video

-> [VideoOverlayFormatFlags]

flags: flags

-> m VideoOverlayRectangle

Returns: a new VideoOverlayRectangle. Unref with gst_video_overlay_rectangle_unref() when no longer needed.

Creates a new video overlay rectangle with ARGB or AYUV pixel data. The layout in case of ARGB of the components in memory is B-G-R-A on little-endian platforms (corresponding to GST_VIDEO_FORMAT_BGRA) and A-R-G-B on big-endian platforms (corresponding to GST_VIDEO_FORMAT_ARGB). In other words, pixels are treated as 32-bit words and the lowest 8 bits then contain the blue component value and the highest 8 bits contain the alpha component value. Unless specified in the flags, the RGB values are non-premultiplied. This is the format that is used by most hardware, and also many rendering libraries such as Cairo, for example. The pixel data buffer must have VideoMeta set.

setGlobalAlpha

videoOverlayRectangleSetGlobalAlpha Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoOverlayRectangle

rectangle: a VideoOverlayRectangle

-> Float

globalAlpha: Global alpha value (0 to 1.0)

-> m () 

Sets the global alpha value associated with a VideoOverlayRectangle. Per- pixel alpha values are multiplied with this value. Valid values: 0 <= global_alpha <= 1; 1 to deactivate.

rectangle must be writable, meaning its refcount must be 1. You can make the rectangles inside a VideoOverlayComposition writable using videoOverlayCompositionMakeWritable or videoOverlayCompositionCopy.

setRenderRectangle

videoOverlayRectangleSetRenderRectangle Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoOverlayRectangle

rectangle: a VideoOverlayRectangle

-> Int32

renderX: render X position of rectangle on video

-> Int32

renderY: render Y position of rectangle on video

-> Word32

renderWidth: render width of rectangle

-> Word32

renderHeight: render height of rectangle

-> m () 

Sets the render position and dimensions of the rectangle on the video. This function is mainly for elements that modify the size of the video in some way (e.g. through scaling or cropping) and need to adjust the details of any overlays to match the operation that changed the size.

rectangle must be writable, meaning its refcount must be 1. You can make the rectangles inside a VideoOverlayComposition writable using videoOverlayCompositionMakeWritable or videoOverlayCompositionCopy.