mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 19:20:35 +00:00
textoverlay: Add support for xBGR and RGBx
Now all RGB variants are supported.
This commit is contained in:
parent
200ee96338
commit
026776ca23
1 changed files with 26 additions and 0 deletions
|
@ -192,7 +192,9 @@ static GstStaticPadTemplate src_template_factory =
|
|||
GST_PAD_SRC,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS (GST_VIDEO_CAPS_BGRx ";"
|
||||
GST_VIDEO_CAPS_RGBx ";"
|
||||
GST_VIDEO_CAPS_xRGB ";"
|
||||
GST_VIDEO_CAPS_xBGR ";"
|
||||
GST_VIDEO_CAPS_RGBA ";"
|
||||
GST_VIDEO_CAPS_BGRA ";"
|
||||
GST_VIDEO_CAPS_ARGB ";"
|
||||
|
@ -205,7 +207,9 @@ static GstStaticPadTemplate video_sink_template_factory =
|
|||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS (GST_VIDEO_CAPS_BGRx ";"
|
||||
GST_VIDEO_CAPS_RGBx ";"
|
||||
GST_VIDEO_CAPS_xRGB ";"
|
||||
GST_VIDEO_CAPS_xBGR ";"
|
||||
GST_VIDEO_CAPS_RGBA ";"
|
||||
GST_VIDEO_CAPS_BGRA ";"
|
||||
GST_VIDEO_CAPS_ARGB ";"
|
||||
|
@ -1453,6 +1457,8 @@ gst_text_overlay_shade_packed_Y (GstTextOverlay * overlay, guchar * dest,
|
|||
}
|
||||
|
||||
#define gst_text_overlay_shade_BGRx gst_text_overlay_shade_xRGB
|
||||
#define gst_text_overlay_shade_RGBx gst_text_overlay_shade_xRGB
|
||||
#define gst_text_overlay_shade_xBGR gst_text_overlay_shade_xRGB
|
||||
static inline void
|
||||
gst_text_overlay_shade_xRGB (GstTextOverlay * overlay, guchar * dest,
|
||||
gint x0, gint x1, gint y0, gint y1)
|
||||
|
@ -1759,6 +1765,8 @@ gst_text_overlay_blit_##name (GstTextOverlay * overlay, \
|
|||
}
|
||||
xRGB_BLIT_FUNCTION (xRGB, 1, 2, 3);
|
||||
xRGB_BLIT_FUNCTION (BGRx, 2, 1, 0);
|
||||
xRGB_BLIT_FUNCTION (xBGR, 3, 2, 1);
|
||||
xRGB_BLIT_FUNCTION (RGBx, 0, 1, 2);
|
||||
|
||||
#define ARGB_BLIT_FUNCTION(name, A, R, G, B) \
|
||||
static inline void \
|
||||
|
@ -1931,11 +1939,21 @@ gst_text_overlay_push_frame (GstTextOverlay * overlay, GstBuffer * video_frame)
|
|||
GST_BUFFER_DATA (video_frame), xpos, xpos + overlay->image_width,
|
||||
ypos, ypos + overlay->image_height);
|
||||
break;
|
||||
case GST_VIDEO_FORMAT_xBGR:
|
||||
gst_text_overlay_shade_xBGR (overlay,
|
||||
GST_BUFFER_DATA (video_frame), xpos, xpos + overlay->image_width,
|
||||
ypos, ypos + overlay->image_height);
|
||||
break;
|
||||
case GST_VIDEO_FORMAT_BGRx:
|
||||
gst_text_overlay_shade_BGRx (overlay,
|
||||
GST_BUFFER_DATA (video_frame), xpos, xpos + overlay->image_width,
|
||||
ypos, ypos + overlay->image_height);
|
||||
break;
|
||||
case GST_VIDEO_FORMAT_RGBx:
|
||||
gst_text_overlay_shade_RGBx (overlay,
|
||||
GST_BUFFER_DATA (video_frame), xpos, xpos + overlay->image_width,
|
||||
ypos, ypos + overlay->image_height);
|
||||
break;
|
||||
case GST_VIDEO_FORMAT_ARGB:
|
||||
gst_text_overlay_shade_ARGB (overlay,
|
||||
GST_BUFFER_DATA (video_frame), xpos, xpos + overlay->image_width,
|
||||
|
@ -1991,6 +2009,14 @@ gst_text_overlay_push_frame (GstTextOverlay * overlay, GstBuffer * video_frame)
|
|||
gst_text_overlay_blit_xRGB (overlay,
|
||||
GST_BUFFER_DATA (video_frame), xpos, ypos);
|
||||
break;
|
||||
case GST_VIDEO_FORMAT_RGBx:
|
||||
gst_text_overlay_blit_RGBx (overlay,
|
||||
GST_BUFFER_DATA (video_frame), xpos, ypos);
|
||||
break;
|
||||
case GST_VIDEO_FORMAT_xBGR:
|
||||
gst_text_overlay_blit_xBGR (overlay,
|
||||
GST_BUFFER_DATA (video_frame), xpos, ypos);
|
||||
break;
|
||||
case GST_VIDEO_FORMAT_ARGB:
|
||||
gst_text_overlay_blit_ARGB (overlay,
|
||||
GST_BUFFER_DATA (video_frame), xpos, ypos);
|
||||
|
|
Loading…
Reference in a new issue