mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
tiger: use the new premultiplied support in gstvideo
This commit is contained in:
parent
7a9fff74c6
commit
8ba11fe2ff
1 changed files with 1 additions and 21 deletions
|
@ -776,7 +776,7 @@ gst_kate_tiger_set_composition (GstKateTiger * tiger)
|
||||||
rectangle = gst_video_overlay_rectangle_new_argb (tiger->render_buffer,
|
rectangle = gst_video_overlay_rectangle_new_argb (tiger->render_buffer,
|
||||||
tiger->video_width, tiger->video_height, 4 * tiger->video_width,
|
tiger->video_width, tiger->video_height, 4 * tiger->video_width,
|
||||||
0, 0, tiger->video_width, tiger->video_height,
|
0, 0, tiger->video_width, tiger->video_height,
|
||||||
GST_VIDEO_OVERLAY_FORMAT_FLAG_NONE);
|
GST_VIDEO_OVERLAY_FORMAT_FLAG_PREMULTIPLIED_ALPHA);
|
||||||
|
|
||||||
if (tiger->composition)
|
if (tiger->composition)
|
||||||
gst_video_overlay_composition_unref (tiger->composition);
|
gst_video_overlay_composition_unref (tiger->composition);
|
||||||
|
@ -789,23 +789,6 @@ gst_kate_tiger_set_composition (GstKateTiger * tiger)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
|
||||||
gst_kate_tiger_unpremultiply (GstKateTiger * tiger)
|
|
||||||
{
|
|
||||||
guint i, j;
|
|
||||||
guint8 *pimage, *text_image = GST_BUFFER_DATA (tiger->render_buffer);
|
|
||||||
|
|
||||||
for (i = 0; i < tiger->video_height; i++) {
|
|
||||||
pimage = text_image + 4 * (i * tiger->video_width);
|
|
||||||
for (j = 0; j < tiger->video_width; j++) {
|
|
||||||
TIGER_UNPREMULTIPLY (pimage[TIGER_ARGB_A], pimage[TIGER_ARGB_R],
|
|
||||||
pimage[TIGER_ARGB_G], pimage[TIGER_ARGB_B]);
|
|
||||||
|
|
||||||
pimage += 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_kate_tiger_video_chain (GstPad * pad, GstBuffer * buf)
|
gst_kate_tiger_video_chain (GstPad * pad, GstBuffer * buf)
|
||||||
{
|
{
|
||||||
|
@ -895,9 +878,6 @@ gst_kate_tiger_video_chain (GstPad * pad, GstBuffer * buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gst_video_format_is_yuv (tiger->video_format)) {
|
if (gst_video_format_is_yuv (tiger->video_format)) {
|
||||||
/* As the GstVideoOverlayComposition supports only unpremultiply ARGB,
|
|
||||||
* we need to unpermultiply it */
|
|
||||||
gst_kate_tiger_unpremultiply (tiger);
|
|
||||||
gst_kate_tiger_set_composition (tiger);
|
gst_kate_tiger_set_composition (tiger);
|
||||||
if (tiger->composition)
|
if (tiger->composition)
|
||||||
gst_video_overlay_composition_blend (tiger->composition, buf);
|
gst_video_overlay_composition_blend (tiger->composition, buf);
|
||||||
|
|
Loading…
Reference in a new issue