[prev in list] [next in list] [prev in thread] [next in thread] 

List:       moblin-dev
Subject:    RE: [Moblin Dev] moblin menlow XvPutVideo support
From:       "Zhao, Halley" <halley.zhao () intel ! com>
Date:       2008-12-15 8:07:49
Message-ID: 8FED46E8A9CA574792FC7AACAC38FE7701C7C99D19 () PDSMSX501 ! ccr ! corp ! intel ! com
[Download RAW message or body]

[Attachment #2 (unknown)]

¡¡¡¡Hi Steven:
¡¡¡¡Could you also provide your Makefile for others to give a quick try?
¡¡¡¡And what's you "ati" means for " I used XvPutVideo in ati graphic drivers", are \
you using the gfx driver for psb? ¡¡¡¡
¡¡¡¡BR
¡¡¡¡
¡¡¡¡>-----Original Message-----
¡¡¡¡>From: dev-bounces@lists.moblin.org [mailto:dev-bounces@lists.moblin.org]
¡¡¡¡>On Behalf Of Steven
¡¡¡¡>Sent: 2008Äê12Ô 15ÈÕ 14:08
¡¡¡¡>To: dev@lists.moblin.org
¡¡¡¡>Subject: [Moblin Dev] moblin menlow XvPutVideo support
¡¡¡¡>
¡¡¡¡>Hi.
¡¡¡¡>I'm trying run application  that depends on Xv, it runs on eMenlow Pulsbo
¡¡¡¡>HW. I
¡¡¡¡>tried to run the XV testcode from attached file zvmon.c, but it returns an
¡¡¡¡>error.
¡¡¡¡>
¡¡¡¡>Is there another driver that needs to be installed to get XvPutVideo
¡¡¡¡>support?
¡¡¡¡>I used XvPutVideo in ati graphic drivers.
¡¡¡¡>
¡¡¡¡>Best Regards.
¡¡¡¡>Steven.
¡¡¡¡>#######################################################################
¡¡¡¡>#####
¡¡¡¡>##########################
¡¡¡¡>#include <stdlib.h>
¡¡¡¡>#include <stdio.h>
¡¡¡¡>#include <unistd.h>
¡¡¡¡>
¡¡¡¡>#include <X11/Xlib.h>
¡¡¡¡>#include <X11/Xutil.h>
¡¡¡¡>#include <X11/Xatom.h>
¡¡¡¡>#include <X11/extensions/Xv.h>
¡¡¡¡>#include <X11/extensions/Xvlib.h>
¡¡¡¡>
¡¡¡¡>#define GUID_YUV12_PLANAR 0x32315659
¡¡¡¡>
¡¡¡¡>int main (int argc, char* argv[])
¡¡¡¡>{
¡¡¡¡>  Display *dpy;
¡¡¡¡>  int screen;
¡¡¡¡>  XVisualInfo vinfo;
¡¡¡¡>  XSetWindowAttributes xswa;
¡¡¡¡>  unsigned long mask;
¡¡¡¡>  unsigned int p_version, p_release, p_request_base, p_event_base,
¡¡¡¡>p_error_base;
¡¡¡¡>  int p_num_adaptors;
¡¡¡¡>  XvAdaptorInfo *ai;
¡¡¡¡>  int xv_port = -1;
¡¡¡¡>  int ret, x, y, w, h, b, d;
¡¡¡¡>  Window window, root;
¡¡¡¡>  GC gc;
¡¡¡¡>  XEvent event;
¡¡¡¡>
¡¡¡¡>  if ((dpy = XOpenDisplay(NULL)) == NULL){
¡¡¡¡>    fprintf(stderr, "Cannot open Display.\n");
¡¡¡¡>    exit(-1);
¡¡¡¡>  }
¡¡¡¡>  screen = DefaultScreen(dpy);
¡¡¡¡>#if 1 //kscho
¡¡¡¡>  if (!XMatchVisualInfo(dpy, screen, 24, TrueColor, &vinfo)) {
¡¡¡¡>#else
¡¡¡¡>  if (!XMatchVisualInfo(dpy, screen, 16, TrueColor, &vinfo)
¡¡¡¡>     && !XMatchVisualInfo(dpy, screen, 15, TrueColor, &vinfo)){
¡¡¡¡>#endif
¡¡¡¡>    fprintf(stderr, "Cannot find the visual (15bpp or 16bpp).\n");
¡¡¡¡>    exit(-1);
¡¡¡¡>  }
¡¡¡¡>
¡¡¡¡>  xswa.colormap =  XCreateColormap(dpy, DefaultRootWindow(dpy),
¡¡¡¡>vinfo.visual, AllocNone);
¡¡¡¡>  xswa.event_mask = StructureNotifyMask | ExposureMask;
¡¡¡¡>  xswa.background_pixel = 0;
¡¡¡¡>  xswa.border_pixel = 0;
¡¡¡¡>  mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
¡¡¡¡>
¡¡¡¡>  window = XCreateWindow(dpy, DefaultRootWindow(dpy),
¡¡¡¡>			 0, 0, 640, 480, 0, vinfo.depth,
¡¡¡¡>			 InputOutput, vinfo.visual, mask, &xswa);
¡¡¡¡>  gc = XCreateGC(dpy, window, 0, 0);
¡¡¡¡>  XStoreName(dpy, window, "ZV");
¡¡¡¡>  XSetIconName(dpy, window, "ZV");
¡¡¡¡>  XSelectInput(dpy, window, StructureNotifyMask);
¡¡¡¡>  XMapWindow(dpy, window);
¡¡¡¡>  XSync(dpy, 1);
¡¡¡¡>
¡¡¡¡>  if ((ret = XvQueryExtension(dpy, &p_version, &p_release,
¡¡¡¡>&p_request_base,
¡¡¡¡>&p_event_base, &p_error_base)) != Success){
¡¡¡¡>      fprintf(stderr, "Cannot find XV Extention.\n");
¡¡¡¡>      exit(-1);
¡¡¡¡>  }
¡¡¡¡>  if ((ret = XvQueryAdaptors(dpy, DefaultRootWindow(dpy),
¡¡¡¡>&p_num_adaptors,
¡¡¡¡>&ai)) != Success){
¡¡¡¡>      fprintf(stderr, "Cannot find XV adaptor.\n");
¡¡¡¡>      exit(-1);
¡¡¡¡>  }
¡¡¡¡>  if (p_num_adaptors == 0){
¡¡¡¡>      fprintf(stderr, "Cannot find XV adaptor.\n");
¡¡¡¡>      exit(-1);
¡¡¡¡>  }
¡¡¡¡>  xv_port = ai[0].base_id;
¡¡¡¡>
¡¡¡¡>  XGetGeometry(dpy, window, &root, &x, &y, &w, &h, &b, &d);
¡¡¡¡>  if (XvPutVideo(dpy, xv_port, window, gc, 0, 0, 720, 480, x, y, w, h) !=
¡¡¡¡>Success){
¡¡¡¡>    printf("XvPutVideo failed.\n");
¡¡¡¡>    exit(-1);
¡¡¡¡>  }
¡¡¡¡>  XFlush(dpy);
¡¡¡¡>
¡¡¡¡>  getchar();
¡¡¡¡>}
¡¡¡¡>
¡¡¡¡>---------------------------------------------------------------------
¡¡¡¡>6F Lotte IT Castle II 550-1 Gasan-dong,
¡¡¡¡>Geumcheon-gu, Seoul, 153-768, Korea
¡¡¡¡>Research Engineer/R&D software Team
¡¡¡¡>Tel: 82-2-890-1657(Direct)
¡¡¡¡>FAX:02-890-1639
¡¡¡¡>
¡¡¡¡>
¡¡¡¡>
¡¡¡¡>_______________________________________________
¡¡¡¡>Moblin dev Mailing List
¡¡¡¡>dev@lists.moblin.org
¡¡¡¡>
¡¡¡¡>To manage or unsubscribe from this mailing list visit:
¡¡¡¡>https://lists.moblin.org/mailman/listinfo/dev or your user account on
¡¡¡¡>http://moblin.org once logged in.
¡¡¡¡>
¡¡¡¡>For more information on the Moblin Developer Mailing lists visit:
¡¡¡¡>http://moblin.org/community/mailing-lists



_______________________________________________
Moblin dev Mailing List
dev@lists.moblin.org

To manage or unsubscribe from this mailing list visit:
https://lists.moblin.org/mailman/listinfo/dev or your user account on http://moblin.org once logged in.

For more information on the Moblin Developer Mailing lists visit:
http://moblin.org/community/mailing-lists

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic