mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 03:06:16 +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);
|
VADisplay dpy = gst_va_display_get_va_dpy (display);
|
||||||
VAStatus status;
|
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);
|
status = vaDeriveImage (dpy, surface, image);
|
||||||
if (status != VA_STATUS_SUCCESS) {
|
if (status != VA_STATUS_SUCCESS) {
|
||||||
|
|
Loading…
Reference in a new issue