Browse Source

+ from Nikolay Nikolov: xv and xvlib interface

git-svn-id: trunk@633 -
florian 20 years ago
parent
commit
94350de1fc
5 changed files with 582 additions and 36 deletions
  1. 2 0
      .gitattributes
  2. 53 35
      packages/extra/x11/Makefile
  3. 1 1
      packages/extra/x11/Makefile.fpc
  4. 118 0
      packages/extra/x11/xv.pp
  5. 408 0
      packages/extra/x11/xvlib.pp

+ 2 - 0
.gitattributes

@@ -3220,6 +3220,8 @@ packages/extra/x11/xrender.pp svneol=native#text/plain
 packages/extra/x11/xresource.pp svneol=native#text/plain
 packages/extra/x11/xshm.pp svneol=native#text/plain
 packages/extra/x11/xutil.pp svneol=native#text/plain
+packages/extra/x11/xv.pp svneol=native#text/plain
+packages/extra/x11/xvlib.pp svneol=native#text/plain
 packages/extra/zlib/Makefile svneol=native#text/plain
 packages/extra/zlib/Makefile.fpc svneol=native#text/plain
 packages/extra/zlib/fpmake.inc svneol=native#text/plain

+ 53 - 35
packages/extra/x11/Makefile

@@ -1,8 +1,8 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2005/05/05]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2005/07/16]
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-emx i386-watcom i386-netwlibc m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd arm-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-wince
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
@@ -233,103 +233,112 @@ PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages/base $(FPCDIR)/packages/ext
 override PACKAGE_NAME=x11
 override PACKAGE_VERSION=2.0.0
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override TARGET_UNITS+=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 endif
 override INSTALL_FPCPACKAGE=y
 ifdef REQUIRE_UNITSDIR
@@ -1132,6 +1141,9 @@ endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
 REQUIRE_PACKAGES_RTL=1
 endif
+ifeq ($(FULL_TARGET),i386-wince)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 REQUIRE_PACKAGES_RTL=1
 endif
@@ -1183,9 +1195,15 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 REQUIRE_PACKAGES_RTL=1
 endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 REQUIRE_PACKAGES_RTL=1
 endif
+ifeq ($(FULL_TARGET),arm-wince)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)

+ 1 - 1
packages/extra/x11/Makefile.fpc

@@ -7,7 +7,7 @@ name=x11
 version=2.0.0
 
 [target]
-units=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama
+units=x xlib xutil xresource xcms xshm xrender keysym xi xkb xkblib xatom xinerama xv xvlib
 
 [require]
 libc=y

+ 118 - 0
packages/extra/x11/xv.pp

@@ -0,0 +1,118 @@
+{***********************************************************
+Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
+and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its 
+documentation for any purpose and without fee is hereby granted, 
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in 
+supporting documentation, and that the names of Digital or MIT not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.  
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************}
+{ $XFree86: xc/include/extensions/Xv.h,v 1.3 1999/05/23 06:33:22 dawes Exp $ }
+
+unit xv;
+
+interface
+
+{$PACKRECORDS c}
+
+uses
+  x;
+
+const
+  XvName = 'XVideo';
+  XvVersion = 2;
+  XvRevision = 2;
+
+{ Symbols }
+type
+  TXvPortID = TXID;
+  TXvEncodingID = TXID;
+
+const
+  XvNone = 0;
+
+  XvInput       = 0;
+  XvOutput      = 1;
+
+  XvInputMask   = 1 shl XvInput;
+  XvOutputMask  = 1 shl XvOutput;
+  XvVideoMask   = $00000004;
+  XvStillMask   = $00000008;
+  XvImageMask   = $00000010;
+
+{ These two are not client viewable }
+  XvPixmapMask  = $00010000;
+  XvWindowMask  = $00020000;
+
+
+  XvGettable    = $01;
+  XvSettable    = $02;
+
+  XvRGB         = 0;
+  XvYUV         = 1;
+
+  XvPacked      = 0;
+  XvPlanar      = 1;
+
+  XvTopToBottom = 0;
+  XvBottomToTop = 1;
+
+
+{ Events }
+
+  XvVideoNotify = 0;
+  XvPortNotify  = 1;
+  XvNumEvents   = 2;
+
+{ Video Notify Reasons }
+
+  XvStarted    = 0;
+  XvStopped    = 1;
+  XvBusy       = 2;
+  XvPreempted  = 3;
+  XvHardError  = 4;
+  XvLastReason = 4;
+
+  XvNumReasons = XvLastReason + 1;
+
+  XvStartedMask   = 1 shl XvStarted;
+  XvStoppedMask   = 1 shl XvStopped;
+  XvBusyMask      = 1 shl XvBusy;
+  XvPreemptedMask = 1 shl XvPreempted;
+  XvHardErrorMask = 1 shl XvHardError;
+
+  XvAnyReasonMask = (1 shl XvNumReasons) - 1;
+  XvNoReasonMask  = 0;
+
+{ Errors }
+
+  XvBadPort     = 0;
+  XvBadEncoding = 1;
+  XvBadControl  = 2;
+  XvNumErrors   = 3;
+
+{ Status }
+
+  XvBadExtension   = 1;
+  XvAlreadyGrabbed = 2;
+  XvInvalidTime    = 3;
+  XvBadReply       = 4;
+  XvBadAlloc       = 5;
+
+implementation
+
+end.

+ 408 - 0
packages/extra/x11/xvlib.pp

@@ -0,0 +1,408 @@
+{***********************************************************
+Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
+and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its 
+documentation for any purpose and without fee is hereby granted, 
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in 
+supporting documentation, and that the names of Digital or MIT not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.  
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************}
+{ $XFree86: xc/include/extensions/Xvlib.h,v 1.3 1999/12/11 19:28:48 mvojkovi Exp $ }
+
+{*
+** File: 
+**
+**   Xvlib.h --- Xv library public header file
+**
+** Author: 
+**
+**   David Carver (Digital Workstation Engineering/Project Athena)
+**
+** Revisions:
+**
+**   26.06.91 Carver
+**     - changed XvFreeAdaptors to XvFreeAdaptorInfo
+**     - changed XvFreeEncodings to XvFreeEncodingInfo
+**
+**   11.06.91 Carver
+**     - changed SetPortControl to SetPortAttribute
+**     - changed GetPortControl to GetPortAttribute
+**     - changed QueryBestSize
+**
+**   05.15.91 Carver
+**     - version 2.0 upgrade
+**
+**   01.24.91 Carver
+**     - version 1.4 upgrade
+**
+*}
+
+unit xvlib;
+
+interface
+
+uses
+  ctypes, x, xlib, xshm, xv;
+
+{$PACKRECORDS c}
+
+const
+  libXv='Xv';
+
+type
+  PXvRational = ^TXvRational;
+  TXvRational = record
+    numerator : cint;
+    denominator : cint;
+  end;
+
+  PXvAttribute = ^TXvAttribute;
+  TXvAttribute = record
+    flags : cint; { XvGettable, XvSettable }
+    min_value : cint;
+    max_value : cint;
+    name : pchar;
+  end;
+
+  PPXvEncodingInfo = ^PXvEncodingInfo;
+  PXvEncodingInfo = ^TXvEncodingInfo;
+  TXvEncodingInfo = record
+    encoding_id : TXvEncodingID;
+    name : pchar;
+    width : culong;
+    height : culong;
+    rate : TXvRational;
+    num_encodings : culong;
+  end;
+
+  PXvFormat = ^TXvFormat;
+  TXvFormat = record
+    depth : cchar;
+    visual_id : culong;
+  end;
+
+  PPXvAdaptorInfo = ^PXvAdaptorInfo;
+  PXvAdaptorInfo = ^TXvAdaptorInfo;
+  TXvAdaptorInfo = record
+    base_id : TXvPortID;
+    num_ports : culong;
+    _type : cchar;
+    name : pchar;
+    num_formats : culong;
+    formats : PXvFormat;
+    num_adaptors : culong;
+  end;
+
+  PXvVideoNotifyEvent = ^TXvVideoNotifyEvent;
+  TXvVideoNotifyEvent = record
+    _type : cint;
+    serial : culong;      { # of last request processed by server }
+    send_event : TBool;   { true if this came from a SendEvent request }
+    display : PDisplay;   { Display the event was read from }
+    drawable : TDrawable; { drawable }
+    reason : culong;      { what generated this event }
+    port_id : TXvPortID;  { what port }
+    time : TTime;         { milliseconds }
+  end;
+
+  PXvPortNotifyEvent = ^TXvPortNotifyEvent;
+  TXvPortNotifyEvent = record
+    _type : cint;
+    serial : culong;     { # of last request processed by server }
+    send_event : TBool;  { true if this came from a SendEvent request }
+    display : PDisplay;  { Display the event was read from }
+    port_id : TXvPortID; { what port }
+    time : TTime;        { milliseconds }
+    attribute : TAtom;   { atom that identifies attribute }
+    value : clong;       { value of attribute }
+  end;
+
+  PXvEvent = ^TXvEvent;
+  TXvEvent = record
+    case longint of
+      0 : (
+            _type : cint;
+	  );
+      1 : (
+            xvvideo : TXvVideoNotifyEvent;
+          );
+      2 : (
+            xvport : TXvPortNotifyEvent;
+          );
+      3 : (
+            pad : array[0..23] of clong;
+          );
+  end;
+
+  PXvImageFormatValues = ^TXvImageFormatValues;
+  TXvImageFormatValues = record
+    id : cint;                    { Unique descriptor for the format }
+    _type : cint;                 { XvRGB, XvYUV }
+    byte_order : cint;            { LSBFirst, MSBFirst }
+    guid : array[0..15] of cchar; { Globally Unique IDentifier }
+    bits_per_pixel : cint;
+    format : cint;                { XvPacked, XvPlanar }
+    num_planes : cint;
+
+  { for RGB formats only }
+    depth : cint;
+    red_mask : cuint;
+    green_mask : cuint;
+    blue_mask : cuint;
+
+  { for YUV formats only }
+    y_sample_bits : cuint;
+    u_sample_bits : cuint;
+    v_sample_bits : cuint;
+    horz_y_period : cuint;
+    horz_u_period : cuint;
+    horz_v_period : cuint;
+    vert_y_period : cuint;
+    vert_u_period : cuint;
+    vert_v_period : cuint;
+    component_order : array[0..31] of char; { eg. UYVY }
+    scanline_order : cint;                  { XvTopToBottom, XvBottomToTop }
+  end;
+
+  PXvImage = ^TXvImage;
+  TXvImage = record
+    id : cint;
+    width, height : cint;
+    data_size : cint;              { bytes }
+    num_planes : cint;
+    pitches : pcint;               { bytes }
+    offsets : pcint;               { bytes }
+    data : pcchar;
+    obdata : TXPointer;
+  end;
+
+function XvQueryExtension(
+  display : PDisplay;
+  p_version,
+  p_revision,
+  p_requestBase,
+  p_eventBase,
+  p_errorBase : pcuint
+) : cint; cdecl; external libXv;
+
+function XvQueryAdaptors(
+  display : PDisplay;
+  window : TWindow;
+  p_nAdaptors : pcuint;
+  p_pAdaptors : PPXvAdaptorInfo
+) : cint; cdecl; external libXv;
+
+function XvQueryEncodings(
+  display : PDisplay;
+  port : TXvPortID;
+  p_nEncoding : pcuint;
+  p_pEncoding : PPXvEncodingInfo
+) : cint; cdecl; external libXv;
+
+function XvPutVideo(
+  display : PDisplay;
+  port : TXvPortID;
+  d : TDrawable;
+  gc : TGC;
+  vx,
+  vy : cint;
+  vw,
+  vh : cuint;
+  dx,
+  dy : cint;
+  dw,
+  dh : cuint
+) : cint; cdecl; external libXv;
+
+function XvPutStill(
+  display : PDisplay;
+  port : TXvPortID;
+  d : TDrawable;
+  gc : TGC;
+  vx,
+  vy : cint;
+  vw,
+  vh : cuint;
+  dx,
+  dy : cint;
+  dw,
+  dh : cuint
+) : cint; cdecl; external libXv;
+
+function XvGetVideo(
+  display : PDisplay;
+  port : TXvPortID;
+  d : TDrawable;
+  gc : TGC;
+  vx,
+  vy : cint;
+  vw,
+  vh : cuint;
+  dx,
+  dy : cint;
+  dw,
+  dh : cuint
+) : cint; cdecl; external libXv;
+
+function XvGetStill(
+  display : PDisplay;
+  port : TXvPortID;
+  d : TDrawable;
+  gc : TGC;
+  vx,
+  vy : cint;
+  vw,
+  vh : cuint;
+  dx,
+  dy : cint;
+  dw,
+  dh : cuint
+) : cint; cdecl; external libXv;
+
+function XvStopVideo(
+  display : PDisplay;
+  port : TXvPortID;
+  drawable : TDrawable
+) : cint; cdecl; external libXv;
+
+function XvGrabPort(
+  display : PDisplay;
+  port : TXvPortID;
+  time : TTime
+) : cint; cdecl; external libXv;
+
+function XvUngrabPort(
+  display : PDisplay;
+  port : TXvPortID;
+  time : TTime
+) : cint; cdecl; external libXv;
+
+function XvSelectVideoNotify(
+  display : PDisplay;
+  drawable : TDrawable;
+  onoff : TBool
+) : cint; cdecl; external libXv;
+
+function XvSelectPortNotify(
+  display : PDisplay;
+  port : TXvPortID;
+  onoff : TBool
+) : cint; cdecl; external libXv;
+
+function XvSetPortAttribute(
+  display : PDisplay;
+  port : TXvPortID;
+  attribute : TAtom;
+  value : cint
+) : cint; cdecl; external libXv;
+
+function XvGetPortAttribute(
+  display : PDisplay;
+  port : TXvPortID;
+  attribute : TAtom;
+  p_value : pcint
+) : cint; cdecl; external libXv;
+
+function XvQueryBestSize(
+  display : PDisplay;
+  port : TXvPortID;
+  motion : TBool;
+  vid_w,
+  vid_h,
+  drw_w,
+  drw_h : cuint;
+  p_actual_width,
+  p_actual_height : pcuint
+) : cint; cdecl; external libXv;
+
+function XvQueryPortAttributes(
+  display : PDisplay;
+  port : TXvPortID;
+  number : pcint
+) : PXvAttribute; cdecl; external libXv;
+
+
+procedure XvFreeAdaptorInfo(
+  adaptors : PXvAdaptorInfo
+); cdecl; external libXv;
+
+procedure XvFreeEncodingInfo(
+  encodings : PXvEncodingInfo
+); cdecl; external libXv;
+
+
+function XvListImageFormats (
+  display : PDisplay;
+  port_id : TXvPortID;
+  count_return : pcint
+) : PXvImageFormatValues; cdecl; external libXv;
+
+function XvCreateImage (
+  display : PDisplay;
+  port : TXvPortID;
+  id : cint;
+  data : pcchar;
+  width,
+  height : cint
+) : PXvImage; cdecl; external libXv;
+
+function XvPutImage (
+  display : PDisplay;
+  id : TXvPortID;
+  d : TDrawable;
+  gc : TGC;
+  image : PXvImage;
+  src_x,
+  src_y : cint;
+  src_w,
+  src_h : cuint;
+  dest_x,
+  dest_y : cint;
+  dest_w,
+  dest_h : cuint
+) : cint; cdecl; external libXv;
+
+function XvShmPutImage (
+  display : PDisplay;
+  id : TXvPortID;
+  d : TDrawable;
+  gc : TGC;
+  image : PXvImage;
+  src_x,
+  src_y : cint;
+  src_w,
+  src_h : cuint;
+  dest_x,
+  dest_y : cint;
+  dest_w,
+  dest_h : cuint;
+  send_event : TBool
+) : cint; cdecl; external libXv;
+
+function XvShmCreateImage(
+  display : PDisplay;
+  port : TXvPortID;
+  id : cint;
+  data : pcchar;
+  width,
+  height : cint;
+  shminfo : PXShmSegmentInfo
+) : PXvImage; cdecl; external libXv;
+
+implementation
+
+end.