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:
Holger Kaelberer 2012-05-15 10:24:08 +02:00 committed by Gwenole Beauchesne
parent e6390d6e5f
commit 2ecb955626

View file

@ -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;
}