mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 00:06:36 +00:00
va: check surface status before get derive image
According with documentation the surface has to be in ready state before getting it derived image. This patch adds that check. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5760>
This commit is contained in:
parent
6b1fba14bf
commit
ddf6fd9c61
1 changed files with 15 additions and 0 deletions
|
@ -212,6 +212,21 @@ va_get_derive_image (GstVaDisplay * display, VASurfaceID surface,
|
|||
{
|
||||
VADisplay dpy = gst_va_display_get_va_dpy (display);
|
||||
VAStatus status;
|
||||
VASurfaceStatus state;
|
||||
|
||||
/* When directly accessing a surface special care must be taken to insure sync
|
||||
* proper synchronization with the graphics hardware. Clients should call
|
||||
* vaQuerySurfaceStatus to insure that a surface is not the target of
|
||||
* concurrent rendering or currently being displayed by an overlay. */
|
||||
status = vaQuerySurfaceStatus (dpy, surface, &state);
|
||||
if (status != VA_STATUS_SUCCESS) {
|
||||
GST_WARNING ("vaQuerySurfaceStatus: %s", vaErrorStr (status));
|
||||
return FALSE;
|
||||
}
|
||||
if (state != VASurfaceReady) {
|
||||
GST_INFO ("Surface not ready");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
status = vaDeriveImage (dpy, surface, image);
|
||||
if (status != VA_STATUS_SUCCESS) {
|
||||
|
|
Loading…
Reference in a new issue