[Libva] Problem in vaDeriveImage

Sambhav isambhav at gmail.com
Thu Jan 21 23:00:51 PST 2010


 Hi All,

I am trying to derive an image buffer from  a VA Surface using vaDeriveImage
API.
But once I call this API I am not getting any valid data in the output
argument VAImage.
The code is given below.

 The sample application present at
http://cgit.freedesktop.org/libva/tree/test/putsurface also failed.

Is this API supported in the following setup ?
**
*Board*              - Portwell NANO-8044-1600
*Platform*          -  Atom Z530 + Poulsbo US15W
*IEGDVersion*    -  10.2.1447
*Libva Version*  -  Rev. 0.29
*OS*                   - Ubuntu 8.04


Here is my code:
The width and height of the VA surface is 352x288. But the output of
vaDeriveImage is 0x0

#define SURFACE_NUM 1

#define CHECK_VASTATUS(va_status,func)                                  \

if (va_status != VA_STATUS_SUCCESS) {                                   \

    fprintf(stderr,"%s:%s (%d) failed,exit\n", __func__, func, __LINE__); \

    exit(1);                                                            \

}

int main(int argc,char **argv)

{

       VAStatus va_status;

       VAImage surface_image;

       static  Display *x11_display;

       static  VADisplay *va_dpy;

       int major_ver, minor_ver;

       static  VASurfaceID surface_id[SURFACE_NUM];

       static  int width=352, height=288;
       void *surface_p=NULL;
       int screen;
       Window root, win;

       x11_display = XOpenDisplay(":0.0");

if (x11_display == NULL) {

               fprintf(stderr, "Can't connect X server!\n");

               exit(-1);

       }

       screen = DefaultScreen(x11_display);

       root = RootWindow(x11_display, screen);

       win = XCreateSimpleWindow(x11_display, root, 0, 0, width, height,0,
0, WhitePixel(x11_display, 0));

       XMapWindow(x11_display, win);

       XSync(x11_display, False);

       va_dpy = vaGetDisplay(x11_display);

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

       CHECK_VASTATUS(va_status, "vaInitialize");

       va_status = vaCreateSurfaces(va_dpy,width,
height,VA_RT_FORMAT_YUV420, SURFACE_NUM, &surface_id[0]);

       CHECK_VASTATUS(va_status, "vaCreateSurfaces");

       va_status = vaDeriveImage(va_dpy,surface_id[0],&surface_image);

       CHECK_VASTATUS(va_status,"vaDeriveImage");

       printf("Surface Width  :%u\n",surface_image.width);

       printf("Surface Height :%u\n",surface_image.height);

vaDestroySurfaces(va_dpy,&surface_id[0],SURFACE_NUM);

       vaTerminate(va_dpy);

}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/libva/attachments/20100122/0b63d898/attachment.html 


More information about the Libva mailing list