mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 08:41:07 +00:00
va: libs: Add va_check_surface_has_status() helper function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
This commit is contained in:
parent
933a155b1a
commit
2ec51dab7d
2 changed files with 28 additions and 0 deletions
|
@ -383,6 +383,30 @@ va_check_surface (GstVaDisplay * display, VASurfaceID surface)
|
|||
return (status == VA_STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
gboolean
|
||||
va_check_surface_has_status (GstVaDisplay * display, VASurfaceID surface,
|
||||
VASurfaceStatus surface_status)
|
||||
{
|
||||
VADisplay dpy = gst_va_display_get_va_dpy (display);
|
||||
VAStatus status;
|
||||
VASurfaceStatus state;
|
||||
|
||||
status = vaQuerySurfaceStatus (dpy, surface, &state);
|
||||
|
||||
if (status != VA_STATUS_SUCCESS) {
|
||||
GST_ERROR ("vaQuerySurfaceStatus: %s", vaErrorStr (status));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
GST_LOG ("surface %#x status %d", surface, state);
|
||||
|
||||
/* Just query the surface, no flag to compare, we succeed. */
|
||||
if (!surface_status)
|
||||
return TRUE;
|
||||
|
||||
return ((state & surface_status) == surface_status);
|
||||
}
|
||||
|
||||
gboolean
|
||||
va_copy_surface (GstVaDisplay * display, VASurfaceID dst, VASurfaceID src)
|
||||
{
|
||||
|
|
|
@ -51,6 +51,10 @@ gboolean va_sync_surface (GstVaDisplay * displa
|
|||
GST_VA_API
|
||||
gboolean va_check_surface (GstVaDisplay * display,
|
||||
VASurfaceID surface);
|
||||
GST_VA_API
|
||||
gboolean va_check_surface_has_status (GstVaDisplay * display,
|
||||
VASurfaceID surface,
|
||||
VASurfaceStatus surface_status);
|
||||
|
||||
gboolean va_copy_surface (GstVaDisplay * display,
|
||||
VASurfaceID dst,
|
||||
|
|
Loading…
Reference in a new issue