Skip to content

vaDeriveImage returns VA_STATUS_ERROR_OPERATION_FAILED #296

Open
@joeyes86

Description

@joeyes86

It's a kind of weird situation. I wrote small sample code

#include <va/va.h>
#include <va/va_x11.h>
#include <stdio.h>

void main()
{   
    int major_ver;
    int minor_ver;

    Display* x11_display = XOpenDisplay(NULL);
    VADisplay va_dpy = vaGetDisplay(x11_display);

    VAStatus va_status = vaInitialize(va_dpy, &major_ver, &minor_ver);

    VASurfaceID surfaces[4];
    vaCreateSurfaces(va_dpy, VA_RT_FORMAT_YUV420, 1920, 1088, &surfaces[0], 4, NULL, 0);
    for (int i = 0; i < 4; i++) {
        VAImage surface_image;
        VAStatus va_status = vaDeriveImage(va_dpy, surfaces[i], &surface_image);
        printf("surface %d: vaDeriveImage returns %d\n", i, va_status);
    }
}

build command is gcc h264encode.c -lva -lva-x11 -lX11

Output:

libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
surface 0: vaDeriveImage returns 1
surface 1: vaDeriveImage returns 1
surface 2: vaDeriveImage returns 1
surface 3: vaDeriveImage returns 1

The same code at the very beginning of the https://github.com/intel/libva-utils/blob/master/encode/h264encode.c main fuction works fine and vaDeriveImage returns 0.
What I'm missing for?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions