mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
overlay: fix support for global-alpha.
Fix support for global-alpha subpictures. The previous changes brought the ability to check for GstVideoOverlayRectangle changes by comparing the underlying pixel buffer pointers. If sequence number and pixel data did not change, then this is an indication that only the global-alpha value changed. Now, try to update the underlying VA subpicture global-alpha value. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
This commit is contained in:
parent
e6390d6e5f
commit
2ecb955626
1 changed files with 13 additions and 0 deletions
|
@ -295,6 +295,17 @@ overlay_rectangle_update_render_rect(GstVaapiOverlayRectangle *overlay,
|
|||
return overlay_rectangle_associate(overlay);
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
overlay_rectangle_update_global_alpha(GstVaapiOverlayRectangle *overlay,
|
||||
GstVideoOverlayRectangle *rect)
|
||||
{
|
||||
const guint flags = gst_video_overlay_rectangle_get_flags(rect);
|
||||
if (!(flags & GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA))
|
||||
return TRUE;
|
||||
return gst_vaapi_subpicture_set_global_alpha(overlay->subpicture,
|
||||
gst_video_overlay_rectangle_get_global_alpha(rect));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
overlay_rectangle_update(GstVaapiOverlayRectangle *overlay,
|
||||
GstVideoOverlayRectangle *rect)
|
||||
|
@ -303,6 +314,8 @@ overlay_rectangle_update(GstVaapiOverlayRectangle *overlay,
|
|||
return FALSE;
|
||||
if (!overlay_rectangle_update_render_rect(overlay, rect))
|
||||
return FALSE;
|
||||
if (!overlay_rectangle_update_global_alpha(overlay, rect))
|
||||
return FALSE;
|
||||
gst_video_overlay_rectangle_replace(&overlay->rect, rect);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue