Commit 876bf233 authored by Lane Brooks's avatar Lane Brooks Committed by Sebastian Dröge
Browse files

textoverlay: Add support for vertical center alignment

Fixes bug #639159.
parent 25408834
......@@ -216,6 +216,7 @@ gst_text_overlay_valign_get_type (void)
{GST_TEXT_OVERLAY_VALIGN_BOTTOM, "bottom", "bottom"},
{GST_TEXT_OVERLAY_VALIGN_TOP, "top", "top"},
{GST_TEXT_OVERLAY_VALIGN_POS, "position", "position"},
{GST_TEXT_OVERLAY_VALIGN_CENTER, "center", "center"},
{0, NULL, NULL},
};
......@@ -1798,6 +1799,9 @@ gst_text_overlay_push_frame (GstTextOverlay * overlay, GstBuffer * video_frame)
ypos = (gint) (overlay->height * overlay->ypos) - height / 2;
ypos = CLAMP (ypos, 0, overlay->height - height);
break;
case GST_TEXT_OVERLAY_VALIGN_CENTER:
ypos = (overlay->height - height) / 2;
break;
default:
ypos = overlay->ypad;
break;
......
......@@ -35,7 +35,8 @@ typedef enum {
GST_TEXT_OVERLAY_VALIGN_BASELINE,
GST_TEXT_OVERLAY_VALIGN_BOTTOM,
GST_TEXT_OVERLAY_VALIGN_TOP,
GST_TEXT_OVERLAY_VALIGN_POS
GST_TEXT_OVERLAY_VALIGN_POS,
GST_TEXT_OVERLAY_VALIGN_CENTER
} GstTextOverlayVAlign;
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment