Class (GI Struct)

GstVideo-1.0GstVideoVideoOverlayRectangle

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

Index

Constructors

Properties

Methods

  • Parameters

    • flags: GstVideo.VideoOverlayFormatFlags

      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.

    Returns Gst.Buffer

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

  • Parameters

    • flags: GstVideo.VideoOverlayFormatFlags

      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.

    Returns Gst.Buffer

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

  • Parameters

    • flags: GstVideo.VideoOverlayFormatFlags

      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.

    Returns Gst.Buffer

    a Gst.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 gst_video_overlay_rectangle_get_render_rectangle(). 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 gst_video_overlay_rectangle_get_render_rectangle().

    Parameters

    • flags: GstVideo.VideoOverlayFormatFlags

      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.

    Returns Gst.Buffer

    a Gst.Buffer holding the ARGB pixel data with GstVideo.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 gst_video_overlay_rectangle_get_render_rectangle().

    Parameters

    • flags: GstVideo.VideoOverlayFormatFlags

      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.

    Returns Gst.Buffer

    a Gst.Buffer holding the AYUV pixel data with GstVideo.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 gst_video_overlay_rectangle_get_render_rectangle().

    Parameters

    • flags: GstVideo.VideoOverlayFormatFlags

      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.

    Returns Gst.Buffer

    a Gst.Buffer holding the pixel data with GstVideo.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 render position and render dimension of the overlay rectangle on the video.

    Returns [boolean, number, number, number, number]

    TRUE if valid render dimensions were retrieved.

  • 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. gst_video_overlay_rectangle_set_global_alpha(), 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.

    Returns number

    the sequence number of rectangle

  • Sets the global alpha value associated with a GstVideo.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 GstVideo.VideoOverlayComposition writable using gst_video_overlay_composition_make_writable() or gst_video_overlay_composition_copy().

    Parameters

    • global_alpha: number

      Global alpha value (0 to 1.0)

    Returns void

  • 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 GstVideo.VideoOverlayComposition writable using gst_video_overlay_composition_make_writable() or gst_video_overlay_composition_copy().

    Parameters

    • render_x: number

      render X position of rectangle on video

    • render_y: number

      render Y position of rectangle on video

    • render_width: number

      render width of rectangle

    • render_height: number

      render height of rectangle

    Returns void