X video extension

X video extension

The X video extension, often abbreviated as XVideo or Xv, is a video output mechanism for the X Window System. The protocol was designed by David Carver; the specification for version 2 of the protocol was written in July 1991. Its main use today is to rescale video playback in hardware (namely the graphics card), in order to enlarge a given video or to watch it in full screen mode. Without XVideo, this scaling would have to be done in software, which is possible but requires a considerable amount of processing power, sometimes to the point of slowing down/degrading the video stream. Similarly, the X video extension has the graphics card perform color space conversions. It can also be used to change contrast, brightness and hue of a displayed video stream in hardware, again saving processing power.

In order for this to work, three things have to come together:

* The graphics card hardware has to provide the required functions.
* The device driver software for the graphics card and the X server program have to support the XVideo interface.
* The video playback software has to make use of this interface.

Most modern graphics cards provide the functions required for XVideo; the feature is known as "hardware scaling and YUV acceleration" or sometimes as "2D hardware acceleration". The XFree86 X server supports XVideo since version 4.0.2. To check whether a given X server supports XVideo, one can use the utility xdpyinfo. To check whether the attached graphics card provides the required functions and whether the X device driver supports XVideo, one can use the xvinfo program.

Playback and Processing

Video playback programs that run under the X Window system, such as MPlayer, MythTV or xine, typically have an option to enable XVideo output. It is very advisable to switch on this option if the system GPU video-hardware and device drivers supports XVideo - the speedup is very noticeable even on a fast CPU.

While the protocol itself has features for reading and writing of video streams from and to video adapters, in practice today only the functions XvPutImage and XvShmPutImage are used: the client program repeatedly prepares images and passes them on to the graphics hardware to be scaled, converted and displayed.

Display

After video has been scaled and prepared for display on the video card, it must be displayed. There are a few possible ways to display accelerated video at this stage. Since full acceleration means that the graphics card is responsible for scaling, converting, and drawing the video, the technique used depends entirely on what the video is being drawn onto.

The Role of Window Manager Support and Compositing

Under Linux, how video is finally drawn depends largely on the X window manager in use. With properly installed drivers, and GPU hardware such as supported Intel, ATI, and nVidia chip sets, some window managers, called compositing window managers allow windows to be separately processed and then rendered (or composited). This involves all windows being rendered to separate output buffers in memory first, and later combined to form a complete graphical interface. While in (video) memory, individual windows can be transformed separately, and accelerated video may be added at this stage using a texture filter, before the window is composited and drawn. XVideo can also be used to accelerate video playback during the drawing of windows using an OpenGL Framebuffer Object or pbuffer.

Metacity, an X window manager uses compositing in this way. The compositing can also make use of 3D pipelines accelerations such as GLX_EXT_texture_from_pixmap. Among other things, this process allows many video outputs to share the same screen without interfering with each other. Other compositing window managers such as Beryl, Compiz and Compiz Fusion also use compositing. Compiz Fusion is included with Ubuntu Linux 7.10 and later and is automatically enabled when suitable video hardware is detected. It can also be enabled from the "Appearance" dialog, in the System->Preferences menu.

However on a system with limited OpenGL acceleration support, and specifically the lack of an OpenGL Framebuffer Object or pbuffer, the use of an OpenGL environment like XGL makes xv hardware accelerations impossible.

The Disadvantages of Chroma Keying

In the event that the window manager doesn't directly support compositing, it is more difficult to isolate where the video stream should be rendered, because by the time it can be accelerated the output has already been turned into a single image. The only way to do this is usually to employ a post processed hardware overlay, using chroma keying. After all of the windows have already been drawn, the only pieces of information we have available are the size and position of the video window's canvas. A third piece of information is required to indicate which parts of the video window's canvas are obscured by other windows and which are not. Therefore the video player draws its canvas using a solid color (we'll say green), and this color becomes a make-shift third dimension. When all windows have been drawn, windows covering the video player will block out the green color. When the video stream is added to the output, the graphics card can simply scan the co-ordinates of the canvas. When it encounters green, it knows its found a visible portion of the video window, and only draws those portions of the video. This same process was also the only available option to render hardware accelerated video under Microsoft Windows XP and earlier, since its window management features were so deeply embedded into the operating system that accelerating them would have been impossible.

If the window manager doesn't support compositing, post processed hardware overlays using chroma keying as described in the previous paragraph can make it impossible to produce a proper screenshots of Xvideo applications. It can also make it impossible to view this kind of playback on a secondary display when only one overlay is supported at the hardware level.

Problems With Newer Cards

Due to the release of DirectX 10, some modern graphics cards have limited or altered texture overlay capabilities by design, including the nVidia GeForce 8 series cards and later which have scaled back some of their capabilities during the addition of DirectX 10 support in preparation for Windows Vista. The nVidia GeForce 8800 series cards including the 8800GT and 8800GTS now only support a single texture overlay on the primary monitor. Therefore they cannot properly support more than one video playback using hardware acceleration, regardless of the platform.

The result is very poor video playback performance on operating systems that don't support DirectX 10, including Windows XP and Linux using XVideo. This change also breaks many compositing window managers, such as Compiz and to some extent Metacity, although these problems may improve with future driver releases.

See also

* XvMC - X-Video Motion Compensation
* MIT-SHM - The MIT Shared Memory Extension

External links

* [http://cvsweb.xfree86.org/cvsweb/xc/doc/specs/Xv/xv-protocol-v2.txt?rev=HEAD&content-type=text/vnd.viewcvs-markup Official XVideo specification, version 2.0]
* [http://cvsweb.xfree86.org/cvsweb/xc/doc/hardcopy/Xv/video?rev=HEAD&content-type=text/vnd.viewcvs-markup Additions in XVideo version 2.2]
* [http://www.xfree86.org/4.2.1/Xv.3.html Xv man pages]
* [http://bellet.info/XVideo/testxv.c testxv.c] an example program (on most installations, it is compiled by "gcc -o testxv testxv.c -L/usr/X11R6/lib -lX11 -lXext -lXv")
* [http://www.wedesoft.demon.co.uk/downloads/testxv2.cc testxv2.cc] another example program in c++


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Video overlay — is any technique used to display a video window on a computer display while bypassing the chain of CPU > graphics card > computer monitor. This is done in order to speed up the video display, and it is commonly used, for example, by TV… …   Wikipedia

  • Extension (jeu vidéo) — Pour les articles homonymes, voir Extension. Une extension ou un addiciel (add on en anglais) est un supplément d un jeu vidéo, c’est à dire des niveaux, des équipements, des armes, des scénarios ou campagnes supplémentaires. Bien souvent, elle… …   Wikipédia en Français

  • Extension (Jeu Vidéo) — Pour les articles homonymes, voir Extension. Une extension ou un addiciel (add on en anglais) est un supplément d un jeu vidéo, c’est à dire des niveaux, des équipements, des armes, des scénarios ou campagnes supplémentaires. Bien souvent, elle… …   Wikipédia en Français

  • Extension (jeu video) — Extension (jeu vidéo) Pour les articles homonymes, voir Extension. Une extension ou un addiciel (add on en anglais) est un supplément d un jeu vidéo, c’est à dire des niveaux, des équipements, des armes, des scénarios ou campagnes supplémentaires …   Wikipédia en Français

  • Extension De Nom De Fichier — Pour les articles homonymes, voir Extension. En informatique, une extension de nom de fichier (ou simplement extension de fichier, voire extension) est un suffixe donné au nom d un fichier pour identifier son format. Ainsi, on dira qu un fichier… …   Wikipédia en Français

  • Extension de fichier — Extension de nom de fichier Pour les articles homonymes, voir Extension. En informatique, une extension de nom de fichier (ou simplement extension de fichier, voire extension) est un suffixe donné au nom d un fichier pour identifier son format.… …   Wikipédia en Français

  • Extension informatique — Extension de nom de fichier Pour les articles homonymes, voir Extension. En informatique, une extension de nom de fichier (ou simplement extension de fichier, voire extension) est un suffixe donné au nom d un fichier pour identifier son format.… …   Wikipédia en Français

  • Video card — image = Gpu connections.png Connects to Motherboard via one of: ISA MCA VLB PCI AGP PCI X PCI Express Others Display via one of: VGA connector Digital Visual Interface Composite video S Video Component video …   Wikipedia

  • VIDÉO - Histoire et techniques — Dans le vaste domaine de l’audiovisuel, les techniques vidéo concernent le traitement des images animées par des procédés électroniques, c’est à dire essentiellement la transformation des images en signaux électriques, dits signaux vidéo, la… …   Encyclopédie Universelle

  • Extensión convergente — Saltar a navegación, búsqueda La extensión convergente es uno de los procesos importantes del desarrollo embrionario, más concretamente de la gastrulación. Se trata de una clase de reordenación tisular en la cual las células se intercalan a lo… …   Wikipedia Español

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”