<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Media Tips and Tricks in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900531#M11043</link>
    <description>Hmm, I can't see anything where is the player ?</description>
    <pubDate>Mon, 18 Oct 2010 17:53:26 GMT</pubDate>
    <dc:creator>JocurileUS</dc:creator>
    <dc:date>2010-10-18T17:53:26Z</dc:date>
    <item>
      <title>Media Tips and Tricks</title>
      <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900469#M10981</link>
      <description />
      <pubDate>Wed, 10 Feb 2010 18:21:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900469#M10981</guid>
      <dc:creator>Gina_H_Intel</dc:creator>
      <dc:date>2010-02-10T18:21:02Z</dc:date>
    </item>
    <item>
      <title>How to Download/Play/Convert YouTube Videos with all-in-one sof</title>
      <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900470#M10982</link>
      <description>&lt;P&gt;We often watch interesting and wonderful videos on YouTube, but the problem is if I want to enjoy the videos from YouTube on my portable devices, what should I do and how can I do this?&lt;BR /&gt;&lt;BR /&gt;Now with this powerful program-&lt;STRONG&gt;&lt;A href="http://www.topsevenreviews.com/cucusoft-youtube-mate.html" target="_blank"&gt;Cucusoft YouTube mate&lt;/A&gt;&lt;/STRONG&gt;, which can help you &lt;STRONG&gt;download, play, convert and manage&lt;/STRONG&gt; your favorite YouTube videos, now enjoy your favorite YouTube videos on your portable devices is so easy!&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Make preparation:&lt;/STRONG&gt; Download and install &lt;STRONG&gt;&lt;A href="http://www.topsevenreviews.com/download/cucusoft-youtube-mate.exe" target="_blank"&gt;Cucusoft YouTube Mate&lt;/A&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Part 1: How to play YouTube Videos on local hard disk. &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Step1:&lt;/STRONG&gt; Click "Add" Button .&lt;BR /&gt;&lt;STRONG&gt;Step2:&lt;/STRONG&gt; Select the files you would like to play. You can select multiple files one time. All the files will be displayed in the play list.&lt;BR /&gt;&lt;STRONG&gt;Step3:&lt;/STRONG&gt; Select one item you would like to play, click "Play" button to play it. Or, you can direct double click the clip in the play list.&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="http://www.macsoftreviews.com/imgs/guide/how-to-edit-youtube-videos/play-n.jpg" border="0" alt="" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Part 2: How to download YouTube Videos &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Step1:&lt;/STRONG&gt; Use an Internet Brower (IE, Firefox) to navigate YouTube. If you would like to download current YouTube Video, please go to Address Bar and press "Ctrl+C" to copy the URL in the Address Bar field.&lt;BR /&gt;&lt;STRONG&gt;Step2:&lt;/STRONG&gt; Go to Cucusoft YouTube Mate, click "Download" Button, a download setting dialog will pop up. Please press "Ctrl+V" to paste previous URL in to Video URL field.&lt;BR /&gt;&lt;STRONG&gt;Step3:&lt;/STRONG&gt; Click "OK" button, the download item will be added in the download list.&lt;BR /&gt;&lt;STRONG&gt;Step4:&lt;/STRONG&gt; After the item status becomes "Downloading Done", you can play it offline or convert it to other video formats.&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="http://www.macsoftreviews.com/imgs/guide/how-to-edit-youtube-videos/download-n.jpg" border="0" alt="" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Part 3: How to Converter YouTube videos. &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Step 1:&lt;/STRONG&gt; Click "Add" Button to select the files you would like to convert. You can select multiple files one time. All the files will be displayed in the play list.&lt;BR /&gt;&lt;STRONG&gt;Step 2:&lt;/STRONG&gt; Click "Profile" dropdown list to select a profile you need.&lt;BR /&gt;&lt;STRONG&gt;Step 3:&lt;/STRONG&gt; If you need to set an new output folder, please click the "..." button right of "Output Folder" to select a new one.&lt;BR /&gt;&lt;STRONG&gt;Step 4:&lt;/STRONG&gt; Click "Convert" button to start conversion..&lt;BR /&gt;In short while, the conversion will be finished.&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="http://www.macsoftreviews.com/imgs/guide/how-to-edit-youtube-videos/converter-n.jpg" border="0" alt="" /&gt;&lt;BR /&gt;&lt;BR /&gt;If you want to get a more statisfactory enjoying of the Youtube video which has been convertered, now this tool- Aiseesoft &lt;STRONG&gt;&lt;A href="http://www.macsoftreviews.com/aiseesoft-total-video-converter.html" target="_blank"&gt;Total Video Converter&lt;/A&gt;&lt;/STRONG&gt; which have powerful video editting functions can meet your need.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Step 1:&lt;/STRONG&gt; Download and install &lt;STRONG&gt;&lt;BR /&gt;&lt;A href="http://www.macsoftreviews.com/download/aiseesoft/as-total-video-converter-108068.exe" target="_blank"&gt;Aiseesoft Total Video Converter&lt;/A&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="http://www.macsoftreviews.com/imgs/guide/how-to-edit-youtube-videos/interface-n.jpg" border="0" alt="" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Step 2:&lt;/STRONG&gt; Click "Add File" button to select the video you want to edit&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="http://www.macsoftreviews.com/imgs/guide/how-to-edit-youtube-videos/add-n.jpg" border="0" alt="" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;The editting functions includes&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;1.Video Joiner.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;If you want to merge several videos into one file you can choose them and click the "Merge into one file" to do it.&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="http://www.macsoftreviews.com/imgs/guide/how-to-edit-youtube-videos/merge-n.jpg" border="0" alt="" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;2.Video Cutter.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;If you just want converter a clip of your video, then you can use the "Trim" icon to set the Start time and End time of the clip or you can directly drag the slide bar to the accurate position. &lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="http://www.macsoftreviews.com/imgs/guide/how-to-edit-youtube-videos/trim-n.jpg" border="0" alt="" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;3.Video Crop&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;By using the "Crop" function you can crop the black edge of your video and you can also drag the line around the video image to adjust your video to portable devices.. &lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="http://www.macsoftreviews.com/imgs/guide/how-to-edit-youtube-videos/crop-n.jpg" border="0" alt="" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;4: Capture your favorite image.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;If you like the current image of the video you can use the "Snapshot" option. Just click the "Snapshot" button the image will be saved and then click the "Open" button next to "Snapshot" button to open your picture.&lt;BR /&gt;&lt;BR /&gt;Now you can easily enjoy your favorite YouTube videos on our portable devices, what are you waiting for? Just have a try and get a wonderful experience!&lt;BR /&gt;&lt;STRONG&gt;More:&lt;/STRONG&gt;&lt;BR /&gt;Now many useful guides, tips, articles, tutorials are available on macsoftreviews. If you want to learn the tutorial about how to use a DVD Ripper, DVD Converter, Video Converter and so on. You can check the &lt;STRONG&gt;&lt;A href="http://www.macsoftreviews.com/guide.html" target="_blank"&gt;Helpful guide &lt;/A&gt;&lt;/STRONG&gt;page.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Feb 2009 03:21:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900470#M10982</guid>
      <dc:creator>chuntian8577</dc:creator>
      <dc:date>2009-02-26T03:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: How To Convert Dvds To Ipod/iphone/apple Tv/psp/mp4 Player</title>
      <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900471#M10983</link>
      <description>&lt;DIV style="margin:0px;"&gt;As there are more and more MID devices available in the market, there will always be a demand for content for them....Thanks for sharing this guide. Do you have any MID development that you could share in this forum? -Thai&lt;/DIV&gt;</description>
      <pubDate>Wed, 18 Mar 2009 22:21:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900471#M10983</guid>
      <dc:creator>Quoc-Thai_L_Intel</dc:creator>
      <dc:date>2009-03-18T22:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to Download/Play/Convert YouTube Videos with all-in-one</title>
      <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900472#M10984</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV style="margin:0px;"&gt;Thanks for sharing this guide. Do you have any MID development that you could share in this forum? -Thai&lt;/DIV&gt;</description>
      <pubDate>Wed, 18 Mar 2009 22:26:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900472#M10984</guid>
      <dc:creator>Quoc-Thai_L_Intel</dc:creator>
      <dc:date>2009-03-18T22:26:57Z</dc:date>
    </item>
    <item>
      <title>Force connection to SSID from command-line or utility</title>
      <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900473#M10985</link>
      <description>Is there any command-line switch for existing Intel Proset utilities or the iframewrk.exe that will force a Wifi adapter to connect to a specified SSID? I have a scenario where I need to be able to switch between access points by clicking a script or application.&lt;BR /&gt;&lt;BR /&gt;If not, is there a means to do this with the Mobile SDK with VB.Net?&lt;BR /&gt;</description>
      <pubDate>Tue, 29 Sep 2009 13:48:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900473#M10985</guid>
      <dc:creator>pwakeford</dc:creator>
      <dc:date>2009-09-29T13:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to Download/Play/Convert YouTube Videos with all-in-one</title>
      <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900474#M10986</link>
      <description>Excellent post... thanks a lot</description>
      <pubDate>Tue, 27 Oct 2009 02:28:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900474#M10986</guid>
      <dc:creator>avensue</dc:creator>
      <dc:date>2009-10-27T02:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: How To Convert Dvds To Ipod/iphone/apple Tv/psp/mp4 Player</title>
      <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900475#M10987</link>
      <description>&lt;DIV style="margin:0px;"&gt;Great stuff buddy..... nice tips... thanks and keep it up&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Nov 2009 07:24:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900475#M10987</guid>
      <dc:creator>avensue</dc:creator>
      <dc:date>2009-11-12T07:24:11Z</dc:date>
    </item>
    <item>
      <title>Where can i download IXA SDK.</title>
      <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900476#M10988</link>
      <description>I tried google &amp;amp; intel.com it but not found. Where can i get it now.</description>
      <pubDate>Fri, 13 Nov 2009 08:58:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900476#M10988</guid>
      <dc:creator>Jianqiu_Chen</dc:creator>
      <dc:date>2009-11-13T08:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: What is WDP,WMA,WML,WTLS,WSP,WMLSCript and wTP in j2me?</title>
      <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900477#M10989</link>
      <description>Hello, &lt;BR /&gt;&lt;BR /&gt;I am Carl.This is my first visit to site.I am new to this site,but Ive enjoyed posting in your forums.I like your defination.You are doing very great work.In feature it will be benifited to all members.&lt;BR /&gt;&lt;BR /&gt;Thank you very much and Stay connected with me.&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Dec 2009 06:52:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900477#M10989</guid>
      <dc:creator>carlhop85</dc:creator>
      <dc:date>2009-12-08T06:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: What is WDP,WMA,WML,WTLS,WSP,WMLSCript and wTP in j2me?</title>
      <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900478#M10990</link>
      <description>&lt;BR /&gt;hi iam gerssy this is my first visit to site .Thanks for your information and good dafination.</description>
      <pubDate>Wed, 16 Dec 2009 06:35:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900478#M10990</guid>
      <dc:creator>gressy</dc:creator>
      <dc:date>2009-12-16T06:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: Mplayer performance with VAAPI support</title>
      <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900479#M10991</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;
&lt;P&gt;I am working on Intel atom board (z530 1.60GHz) . Here I am trying to see the CPU utilization of mplayer with VAAPI support i followed steps given in below website&lt;BR /&gt; &lt;A href="http://www.splitted-desktop.com/%7Egbeauchesne/mplayer-vaapi/" title="http://www.splitted-desktop.com/~gbeauchesne/mplayer-vaapi/" rel="nofollow"&gt;http://www.splitted-desktop.com/~gbeauchesne/mplayer-vaapi/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;But while running application with ./mplayer -vo vaapi -va vaapi  this option i am getting the following error&lt;/P&gt;
&lt;P&gt;[vo_vaapi] vaInitialize(): invalid VADisplay&lt;BR /&gt; Error opening/initializing the selected video_out (-vo) device.&lt;/P&gt;
&lt;P&gt;can any one give sugisition.&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;
&lt;P&gt;Regards&lt;BR /&gt; Raj&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2009 10:13:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900479#M10991</guid>
      <dc:creator>Rajkumar</dc:creator>
      <dc:date>2009-12-21T10:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Mplayer performance with VAAPI support</title>
      <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900480#M10992</link>
      <description>Added:&lt;BR /&gt; &lt;BR /&gt;trunk/gar-minimyth/script/mediaplayers/vlc/files/vlc-1.0.0-rc4-vaapi.patch&lt;BR /&gt;&lt;BR /&gt;Log:&lt;BR /&gt;- Added VLC VAAPI patch to the build system but did not include it in the  &lt;BR /&gt;build.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Added:  &lt;BR /&gt;trunk/gar-minimyth/script/mediaplayers/vlc/files/vlc-1.0.0-rc4-vaapi.patch&lt;BR /&gt;==============================================================================&lt;BR /&gt;--- (empty file)&lt;BR /&gt;+++  &lt;BR /&gt;trunk/gar-minimyth/script/mediaplayers/vlc/files/vlc-1.0.0-rc4-vaapi.patch      &lt;BR /&gt; &lt;BR /&gt;Fri Jun 19 20:35:58 2009&lt;BR /&gt;@@ -0,0 +1,860 @@&lt;BR /&gt;+diff -Naur vlc-1.0.0-rc4-old/modules/codec/avcodec/avcodec.c  &lt;BR /&gt;vlc-1.0.0-rc4-new/modules/codec/avcodec/avcodec.c&lt;BR /&gt;+--- vlc-1.0.0-rc4-old/modules/codec/avcodec/avcodec.c  2009-05-10  &lt;BR /&gt;16:03:54.000000000 -0700&lt;BR /&gt;++++ vlc-1.0.0-rc4-new/modules/codec/avcodec/avcodec.c  2009-06-19  &lt;BR /&gt;16:31:52.000000000 -0700&lt;BR /&gt;+@@ -129,6 +129,9 @@&lt;BR /&gt;+&lt;BR /&gt;+     add_integer( "ffmpeg-debug", 0, NULL, DEBUG_TEXT, DEBUG_LONGTEXT,&lt;BR /&gt;+                  true )&lt;BR /&gt;++#ifdef HAVE_AVCODEC_VAAPI&lt;BR /&gt;++    add_bool( "ffmpeg-hw", true, NULL, HW_TEXT, HW_LONGTEXT, true )&lt;BR /&gt;++#endif&lt;BR /&gt;+&lt;BR /&gt;+ #ifdef ENABLE_SOUT&lt;BR /&gt;+     /* encoder submodule */&lt;BR /&gt;+diff -Naur vlc-1.0.0-rc4-old/modules/codec/avcodec/avcodec.h  &lt;BR /&gt;vlc-1.0.0-rc4-new/modules/codec/avcodec/avcodec.h&lt;BR /&gt;+--- vlc-1.0.0-rc4-old/modules/codec/avcodec/avcodec.h  2009-05-10  &lt;BR /&gt;16:03:54.000000000 -0700&lt;BR /&gt;++++ vlc-1.0.0-rc4-new/modules/codec/avcodec/avcodec.h  2009-06-19  &lt;BR /&gt;16:31:52.000000000 -0700&lt;BR /&gt;+@@ -127,6 +127,9 @@&lt;BR /&gt;+     "usually has a detrimental effect on quality. However it provides a  &lt;BR /&gt;big " &lt;BR /&gt;+     "speedup for high definition streams." )&lt;BR /&gt;+&lt;BR /&gt;++#define HW_TEXT N_("Hardware decoding")&lt;BR /&gt;++#define HW_LONGTEXT N_("This allows hardware decoding when available.")&lt;BR /&gt;++&lt;BR /&gt;+ /*&lt;BR /&gt;+  * Encoder options&lt;BR /&gt;+  */&lt;BR /&gt;+@@ -257,3 +260,6 @@&lt;BR /&gt;+ #   define AV_VERSION_INT(a, b, c) ((a)&amp;lt;&amp;lt;16 | (b)&amp;lt;&amp;lt;8 | (c))&lt;BR /&gt;+ #endif&lt;BR /&gt;+&lt;BR /&gt;++/* Uncomment it to enable compilation with vaapi (you also must change  &lt;BR /&gt;the build&lt;BR /&gt;++ * system) */&lt;BR /&gt;++//#define HAVE_AVCODEC_VAAPI 1&lt;BR /&gt;+diff -Naur vlc-1.0.0-rc4-old/modules/codec/avcodec/Modules.am  &lt;BR /&gt;vlc-1.0.0-rc4-new/modules/codec/avcodec/Modules.am&lt;BR /&gt;+--- vlc-1.0.0-rc4-old/modules/codec/avcodec/Modules.am 2009-05-10  &lt;BR /&gt;16:03:54.000000000 -0700&lt;BR /&gt;++++ vlc-1.0.0-rc4-new/modules/codec/avcodec/Modules.am 2009-06-19  &lt;BR /&gt;16:31:52.000000000 -0700&lt;BR /&gt;+@@ -7,6 +7,7 @@&lt;BR /&gt;+       avutil.h &lt;BR /&gt;+       fourcc.c &lt;BR /&gt;+       chroma.c &lt;BR /&gt;++      vaapi.c &lt;BR /&gt;+       $(NULL)&lt;BR /&gt;+&lt;BR /&gt;+ if ENABLE_SOUT&lt;BR /&gt;+diff -Naur vlc-1.0.0-rc4-old/modules/codec/avcodec/vaapi.c  &lt;BR /&gt;vlc-1.0.0-rc4-new/modules/codec/avcodec/vaapi.c&lt;BR /&gt;+--- vlc-1.0.0-rc4-old/modules/codec/avcodec/vaapi.c    1969-12-31  &lt;BR /&gt;16:00:00.000000000 -0800&lt;BR /&gt;++++ vlc-1.0.0-rc4-new/modules/codec/avcodec/vaapi.c    2009-06-19  &lt;BR /&gt;16:31:52.000000000 -0700&lt;BR /&gt;+@@ -0,0 +1,487 @@&lt;BR /&gt;++/*****************************************************************************&lt;BR /&gt;++ * vaapi.c: VAAPI helpers for the ffmpeg decoder&lt;BR /&gt;++  &lt;BR /&gt;*****************************************************************************&lt;BR /&gt;++ * Copyright (C) 2009 Laurent Aimar&lt;BR /&gt;++ * $Id$&lt;BR /&gt;++ *&lt;BR /&gt;++ * Authors: Laurent Aimar &lt;FENRIR_AT_ videolan="" _dot_="" org=""&gt;&lt;BR /&gt;++ *&lt;BR /&gt;++ * This program is free software; you can redistribute it and/or modify&lt;BR /&gt;++ * it under the terms of the GNU General Public License as published by&lt;BR /&gt;++ * the Free Software Foundation; either version 2 of the License, or&lt;BR /&gt;++ * (at your option) any later version.&lt;BR /&gt;++ *&lt;BR /&gt;++ * This program is distributed in the hope that it will be useful,&lt;BR /&gt;++ * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;BR /&gt;++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;BR /&gt;++ * GNU General Public License for more details.&lt;BR /&gt;++ *&lt;BR /&gt;++ * You should have received a copy of the GNU General Public License&lt;BR /&gt;++ * along with this program; if not, write to the Free Software&lt;BR /&gt;++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  &lt;BR /&gt;02110-1301, USA.&lt;BR /&gt;++  &lt;BR /&gt;*****************************************************************************/&lt;BR /&gt;++&lt;BR /&gt;++#ifdef HAVE_CONFIG_H&lt;BR /&gt;++# include "config.h"&lt;BR /&gt;++#endif&lt;BR /&gt;++&lt;BR /&gt;++#include &lt;VLC_COMMON.H&gt;&lt;BR /&gt;++#include &lt;VLC_VOUT.H&gt;&lt;BR /&gt;++#include &lt;ASSERT.H&gt;&lt;BR /&gt;++&lt;BR /&gt;++#ifdef HAVE_LIBAVCODEC_AVCODEC_H&lt;BR /&gt;++#   include &lt;LIBAVCODEC&gt;&lt;BR /&gt;++#   include &lt;LIBAVCODEC&gt;&lt;BR /&gt;++#elif defined(HAVE_FFMPEG_AVCODEC_H)&lt;BR /&gt;++#   include &lt;FFMPEG&gt;&lt;BR /&gt;++#else&lt;BR /&gt;++#   include &lt;AVCODEC.H&gt;&lt;BR /&gt;++#endif&lt;BR /&gt;++&lt;BR /&gt;++#include "avcodec.h"&lt;BR /&gt;++#include "vaapi.h"&lt;BR /&gt;++&lt;BR /&gt;++#ifdef HAVE_AVCODEC_VAAPI&lt;BR /&gt;++&lt;BR /&gt;++#include &lt;X11&gt;&lt;BR /&gt;++#include &lt;VA&gt;&lt;BR /&gt;++&lt;BR /&gt;++&lt;BR /&gt;++typedef struct&lt;BR /&gt;++{&lt;BR /&gt;++    VASurfaceID  i_id;&lt;BR /&gt;++    int          i_refcount;&lt;BR /&gt;++    unsigned int i_order;&lt;BR /&gt;++&lt;BR /&gt;++} vlc_va_surface_t;&lt;BR /&gt;++&lt;BR /&gt;++struct vlc_va_t&lt;BR /&gt;++{&lt;BR /&gt;++    /* */&lt;BR /&gt;++    Display      *p_display_x11;&lt;BR /&gt;++    VADisplay     p_display;&lt;BR /&gt;++&lt;BR /&gt;++    VAConfigID    i_config_id;&lt;BR /&gt;++    VAContextID   i_context_id;&lt;BR /&gt;++&lt;BR /&gt;++    struct vaapi_context hw_ctx;&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    int i_version_major;&lt;BR /&gt;++    int i_version_minor;&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    int          i_surface_count;&lt;BR /&gt;++    unsigned int i_surface_order;&lt;BR /&gt;++    int          i_surface_width;&lt;BR /&gt;++    int          i_surface_height;&lt;BR /&gt;++    vlc_fourcc_t i_surface_chroma;&lt;BR /&gt;++&lt;BR /&gt;++    vlc_va_surface_t *p_surface;&lt;BR /&gt;++&lt;BR /&gt;++    VAImage      image;&lt;BR /&gt;++&lt;BR /&gt;++};&lt;BR /&gt;++&lt;BR /&gt;++static int VaOpen( vlc_va_t *p_va, int i_codec_id );&lt;BR /&gt;++static void VaClose( vlc_va_t *p_va );&lt;BR /&gt;++&lt;BR /&gt;++static int VaCreateSurfaces( vlc_va_t *p_va, void **pp_hw_ctx,  &lt;BR /&gt;vlc_fourcc_t *pi_chroma,&lt;BR /&gt;++                             int i_width, int i_height );&lt;BR /&gt;++static void VaDestroySurfaces( vlc_va_t *p_va );&lt;BR /&gt;++&lt;BR /&gt;++vlc_va_t *VaNew( int i_codec_id )&lt;BR /&gt;++{&lt;BR /&gt;++    vlc_va_t *p_va = calloc( 1, sizeof(*p_va) );&lt;BR /&gt;++    if( !p_va )&lt;BR /&gt;++        return NULL;&lt;BR /&gt;++&lt;BR /&gt;++    if( VaOpen( p_va, i_codec_id ) )&lt;BR /&gt;++    {&lt;BR /&gt;++        free( p_va );&lt;BR /&gt;++        return NULL;&lt;BR /&gt;++    }&lt;BR /&gt;++    return p_va;&lt;BR /&gt;++}&lt;BR /&gt;++void VaDelete( vlc_va_t *p_va )&lt;BR /&gt;++{&lt;BR /&gt;++    VaClose( p_va );&lt;BR /&gt;++    free( p_va );&lt;BR /&gt;++}&lt;BR /&gt;++int VaSetup( vlc_va_t *p_va, void **pp_hw_ctx, vlc_fourcc_t *pi_chroma,&lt;BR /&gt;++             int i_width, int i_height )&lt;BR /&gt;++{&lt;BR /&gt;++    if( p_va-&amp;gt;i_surface_width == i_width &amp;amp;&amp;amp;&lt;BR /&gt;++        p_va-&amp;gt;i_surface_height == i_height )&lt;BR /&gt;++        return VLC_SUCCESS;&lt;BR /&gt;++&lt;BR /&gt;++    *pp_hw_ctx = NULL;&lt;BR /&gt;++    *pi_chroma = 0;&lt;BR /&gt;++    if( p_va-&amp;gt;i_surface_width || p_va-&amp;gt;i_surface_height )&lt;BR /&gt;++        VaDestroySurfaces( p_va );&lt;BR /&gt;++&lt;BR /&gt;++    if( i_width &amp;gt; 0 &amp;amp;&amp;amp; i_height &amp;gt; 0 )&lt;BR /&gt;++        return VaCreateSurfaces( p_va, pp_hw_ctx, pi_chroma, i_width,  &lt;BR /&gt;i_height );&lt;BR /&gt;++&lt;BR /&gt;++    return VLC_EGENERIC;&lt;BR /&gt;++}&lt;BR /&gt;++void VaVersion( vlc_va_t *p_va, char *psz_version, size_t i_version )&lt;BR /&gt;++{&lt;BR /&gt;++    snprintf( psz_version, i_version, "%d.%d", p_va-&amp;gt;i_version_major,  &lt;BR /&gt;p_va-&amp;gt;i_version_minor );&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++static int VaOpen( vlc_va_t *p_va, int i_codec_id )&lt;BR /&gt;++{&lt;BR /&gt;++    VAProfile i_profile;&lt;BR /&gt;++    int i_surface_count;&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    switch( i_codec_id )&lt;BR /&gt;++    {&lt;BR /&gt;++    case CODEC_ID_MPEG1VIDEO:&lt;BR /&gt;++    case CODEC_ID_MPEG2VIDEO:&lt;BR /&gt;++        i_profile = VAProfileMPEG2Main;&lt;BR /&gt;++        i_surface_count = 2+1;&lt;BR /&gt;++        break;&lt;BR /&gt;++    case CODEC_ID_MPEG4:&lt;BR /&gt;++        i_profile = VAProfileMPEG4AdvancedSimple;&lt;BR /&gt;++        i_surface_count = 2+1;&lt;BR /&gt;++        break;&lt;BR /&gt;++    case CODEC_ID_WMV3:&lt;BR /&gt;++        i_profile = VAProfileVC1Main;&lt;BR /&gt;++        i_surface_count = 2+1;&lt;BR /&gt;++        break;&lt;BR /&gt;++    case CODEC_ID_VC1:&lt;BR /&gt;++        i_profile = VAProfileVC1Advanced;&lt;BR /&gt;++        i_surface_count = 2+1;&lt;BR /&gt;++        break;&lt;BR /&gt;++    case CODEC_ID_H264:&lt;BR /&gt;++        i_profile = VAProfileH264High;&lt;BR /&gt;++        i_surface_count = 16+1;&lt;BR /&gt;++        break;&lt;BR /&gt;++    default:&lt;BR /&gt;++        return VLC_EGENERIC;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    memset( p_va, 0, sizeof(*p_va) );&lt;BR /&gt;++&lt;BR /&gt;++    /* Create a VA display */&lt;BR /&gt;++    p_va-&amp;gt;p_display_x11 = XOpenDisplay(NULL);&lt;BR /&gt;++    if( !p_va-&amp;gt;p_display_x11 )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++&lt;BR /&gt;++    p_va-&amp;gt;p_display = vaGetDisplay( p_va-&amp;gt;p_display_x11 );&lt;BR /&gt;++    if( !p_va-&amp;gt;p_display )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++&lt;BR /&gt;++    if( vaInitialize( p_va-&amp;gt;p_display, &amp;amp;p_va-&amp;gt;i_version_major,  &lt;BR /&gt;&amp;amp;p_va-&amp;gt;i_version_minor ) )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++&lt;BR /&gt;++    /* Create a VA configuration */&lt;BR /&gt;++    VAConfigAttrib attrib;&lt;BR /&gt;++    memset( &amp;amp;attrib, 0, sizeof(attrib) );&lt;BR /&gt;++    attrib.type = VAConfigAttribRTFormat;&lt;BR /&gt;++    if( vaGetConfigAttributes( p_va-&amp;gt;p_display,&lt;BR /&gt;++                               i_profile, VAEntrypointVLD, &amp;amp;attrib, 1 ) )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++&lt;BR /&gt;++    /* Not sure what to do if not, I don't have a way to test */&lt;BR /&gt;++    if( (attrib.value &amp;amp; VA_RT_FORMAT_YUV420) == 0 )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    if( vaCreateConfig( p_va-&amp;gt;p_display,&lt;BR /&gt;++                        i_profile, VAEntrypointVLD, &amp;amp;attrib, 1,  &lt;BR /&gt;&amp;amp;p_va-&amp;gt;i_config_id ) )&lt;BR /&gt;++    {&lt;BR /&gt;++        p_va-&amp;gt;i_config_id = 0;&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    p_va-&amp;gt;i_surface_count = i_surface_count;&lt;BR /&gt;++&lt;BR /&gt;++    return VLC_SUCCESS;&lt;BR /&gt;++&lt;BR /&gt;++error:&lt;BR /&gt;++    return VLC_EGENERIC;&lt;BR /&gt;++}&lt;BR /&gt;++static void VaClose( vlc_va_t *p_va )&lt;BR /&gt;++{&lt;BR /&gt;++    if( p_va-&amp;gt;i_surface_width || p_va-&amp;gt;i_surface_height )&lt;BR /&gt;++        VaDestroySurfaces( p_va );&lt;BR /&gt;++&lt;BR /&gt;++    if( p_va-&amp;gt;i_config_id )&lt;BR /&gt;++        vaDestroyConfig( p_va-&amp;gt;p_display, p_va-&amp;gt;i_config_id );&lt;BR /&gt;++    if( p_va-&amp;gt;p_display )&lt;BR /&gt;++        vaTerminate( p_va-&amp;gt;p_display );&lt;BR /&gt;++    if( p_va-&amp;gt;p_display_x11 )&lt;BR /&gt;++        XCloseDisplay( p_va-&amp;gt;p_display_x11 );&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++static int VaCreateSurfaces( vlc_va_t *p_va, void **pp_hw_ctx,  &lt;BR /&gt;vlc_fourcc_t *pi_chroma,&lt;BR /&gt;++                             int i_width, int i_height )&lt;BR /&gt;++{&lt;BR /&gt;++    assert( i_width &amp;gt; 0 &amp;amp;&amp;amp; i_height &amp;gt; 0 );&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    p_va-&amp;gt;p_surface = calloc( p_va-&amp;gt;i_surface_count,  &lt;BR /&gt;sizeof(*p_va-&amp;gt;p_surface) );&lt;BR /&gt;++    if( !p_va-&amp;gt;p_surface )&lt;BR /&gt;++        return VLC_EGENERIC;&lt;BR /&gt;++&lt;BR /&gt;++    /* Create surfaces */&lt;BR /&gt;++    VASurfaceID pi_surface_id[p_va-&amp;gt;i_surface_count];&lt;BR /&gt;++    if( vaCreateSurfaces( p_va-&amp;gt;p_display, i_width, i_height,  &lt;BR /&gt;VA_RT_FORMAT_YUV420,&lt;BR /&gt;++                          p_va-&amp;gt;i_surface_count, pi_surface_id ) )&lt;BR /&gt;++    {&lt;BR /&gt;++        for( int i = 0; i &amp;lt; p_va-&amp;gt;i_surface_count; i++ )&lt;BR /&gt;++            p_va-&amp;gt;p_surface&lt;I&gt;.i_id = VA_INVALID_SURFACE;&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    for( int i = 0; i &amp;lt; p_va-&amp;gt;i_surface_count; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        vlc_va_surface_t *p_surface = &amp;amp;p_va-&amp;gt;p_surface&lt;I&gt;;&lt;BR /&gt;++&lt;BR /&gt;++        p_surface-&amp;gt;i_id = pi_surface_id&lt;I&gt;;&lt;BR /&gt;++        p_surface-&amp;gt;i_refcount = 0;&lt;BR /&gt;++        p_surface-&amp;gt;i_order = 0;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    /* Create a context */&lt;BR /&gt;++    if( vaCreateContext( p_va-&amp;gt;p_display, p_va-&amp;gt;i_config_id,&lt;BR /&gt;++                         i_width, i_height, VA_PROGRESSIVE,&lt;BR /&gt;++                         pi_surface_id, p_va-&amp;gt;i_surface_count,  &lt;BR /&gt;&amp;amp;p_va-&amp;gt;i_context_id ) )&lt;BR /&gt;++    {&lt;BR /&gt;++        p_va-&amp;gt;i_context_id = 0;&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    /* Find a supported image chroma */&lt;BR /&gt;++    int i_fmt_count = vaMaxNumImageFormats( p_va-&amp;gt;p_display );&lt;BR /&gt;++    VAImageFormat *p_fmt = calloc( i_fmt_count, sizeof(*p_fmt) );&lt;BR /&gt;++    if( !p_fmt )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++&lt;BR /&gt;++    if( vaQueryImageFormats( p_va-&amp;gt;p_display, p_fmt, &amp;amp;i_fmt_count ) )&lt;BR /&gt;++    {&lt;BR /&gt;++        free( p_fmt );&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    vlc_fourcc_t  i_chroma = 0;&lt;BR /&gt;++    VAImageFormat fmt;&lt;BR /&gt;++    for( int i = 0; i &amp;lt; i_fmt_count; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        if( p_fmt&lt;I&gt;.fourcc == VA_FOURCC( 'Y', 'V', '1', '2' ) ||&lt;BR /&gt;++            p_fmt&lt;I&gt;.fourcc == VA_FOURCC( 'I', '4', '2', '0' ) )&lt;BR /&gt;++        {&lt;BR /&gt;++            i_chroma = VLC_FOURCC( 'I', '4', '2', '0' );&lt;BR /&gt;++            fmt = p_fmt&lt;I&gt;;&lt;BR /&gt;++        }&lt;BR /&gt;++        /* TODO: It seems that these may also be available (but not&lt;BR /&gt;++         * with my setup):&lt;BR /&gt;++         * VA_FOURCC( 'N', 'V', '1', '2')&lt;BR /&gt;++         * VA_FOURCC( 'U', 'Y', 'V', 'Y')&lt;BR /&gt;++         * VA_FOURCC( 'Y', 'U', 'Y', 'V')&lt;BR /&gt;++         */&lt;BR /&gt;++    }&lt;BR /&gt;++    free( p_fmt );&lt;BR /&gt;++    if( !i_chroma )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    *pi_chroma = i_chroma;&lt;BR /&gt;++&lt;BR /&gt;++    /* Create an image for surface extraction */&lt;BR /&gt;++    if( vaCreateImage(  p_va-&amp;gt;p_display, &amp;amp;fmt, i_width, i_height,  &lt;BR /&gt;&amp;amp;p_va-&amp;gt;image ) )&lt;BR /&gt;++    {&lt;BR /&gt;++        p_va-&amp;gt;image.image_id = 0;&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    /* Setup the ffmpeg hardware context */&lt;BR /&gt;++    *pp_hw_ctx = &amp;amp;p_va-&amp;gt;hw_ctx;&lt;BR /&gt;++&lt;BR /&gt;++    memset( &amp;amp;p_va-&amp;gt;hw_ctx, 0, sizeof(p_va-&amp;gt;hw_ctx) );&lt;BR /&gt;++    p_va-&amp;gt;hw_ctx.display    = p_va-&amp;gt;p_display;&lt;BR /&gt;++    p_va-&amp;gt;hw_ctx.config_id  = p_va-&amp;gt;i_config_id;&lt;BR /&gt;++    p_va-&amp;gt;hw_ctx.context_id = p_va-&amp;gt;i_context_id;&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    p_va-&amp;gt;i_surface_chroma = i_chroma;&lt;BR /&gt;++    p_va-&amp;gt;i_surface_width = i_width;&lt;BR /&gt;++    p_va-&amp;gt;i_surface_height = i_height;&lt;BR /&gt;++    return VLC_SUCCESS;&lt;BR /&gt;++&lt;BR /&gt;++error:&lt;BR /&gt;++    VaDestroySurfaces( p_va );&lt;BR /&gt;++    return VLC_EGENERIC;&lt;BR /&gt;++}&lt;BR /&gt;++static void VaDestroySurfaces( vlc_va_t *p_va )&lt;BR /&gt;++{&lt;BR /&gt;++    if( p_va-&amp;gt;image.image_id )&lt;BR /&gt;++        vaDestroyImage( p_va-&amp;gt;p_display, p_va-&amp;gt;image.image_id );&lt;BR /&gt;++&lt;BR /&gt;++    if( p_va-&amp;gt;i_context_id )&lt;BR /&gt;++        vaDestroyContext( p_va-&amp;gt;p_display, p_va-&amp;gt;i_context_id );&lt;BR /&gt;++&lt;BR /&gt;++    for( int i = 0; i &amp;lt; p_va-&amp;gt;i_surface_count &amp;amp;&amp;amp; p_va-&amp;gt;p_surface; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        vlc_va_surface_t *p_surface = &amp;amp;p_va-&amp;gt;p_surface&lt;I&gt;;&lt;BR /&gt;++&lt;BR /&gt;++        if( p_surface-&amp;gt;i_id != VA_INVALID_SURFACE )&lt;BR /&gt;++            vaDestroySurfaces( p_va-&amp;gt;p_display, &amp;amp;p_surface-&amp;gt;i_id, 1 );&lt;BR /&gt;++    }&lt;BR /&gt;++    free( p_va-&amp;gt;p_surface );&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    p_va-&amp;gt;image.image_id = 0;&lt;BR /&gt;++    p_va-&amp;gt;i_context_id = 0;&lt;BR /&gt;++    p_va-&amp;gt;p_surface = NULL;&lt;BR /&gt;++    p_va-&amp;gt;i_surface_width = 0;&lt;BR /&gt;++    p_va-&amp;gt;i_surface_height = 0;&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++int VaExtract( vlc_va_t *p_va, picture_t *p_picture, AVFrame *p_ff )&lt;BR /&gt;++{&lt;BR /&gt;++    VASurfaceID i_surface_id = (VASurfaceID)(uintptr_t)p_ff-&amp;gt;data[3];&lt;BR /&gt;++&lt;BR /&gt;++    if( vaSyncSurface( p_va-&amp;gt;p_display, p_va-&amp;gt;i_context_id, i_surface_id  &lt;BR /&gt;) )&lt;BR /&gt;++        return VLC_EGENERIC;&lt;BR /&gt;++&lt;BR /&gt;++    /* XXX vaDeriveImage may be better but it is not supported by&lt;BR /&gt;++     * my setup.&lt;BR /&gt;++     */&lt;BR /&gt;++&lt;BR /&gt;++    if( vaGetImage( p_va-&amp;gt;p_display, i_surface_id,&lt;BR /&gt;++                    0, 0, p_va-&amp;gt;i_surface_width, p_va-&amp;gt;i_surface_height,&lt;BR /&gt;++                    p_va-&amp;gt;image.image_id) )&lt;BR /&gt;++        return VLC_EGENERIC;&lt;BR /&gt;++&lt;BR /&gt;++    void *p_base;&lt;BR /&gt;++    if( vaMapBuffer( p_va-&amp;gt;p_display, p_va-&amp;gt;image.buf, &amp;amp;p_base ) )&lt;BR /&gt;++        return VLC_EGENERIC;&lt;BR /&gt;++&lt;BR /&gt;++    for( int i_plane = 0; i_plane &amp;lt; p_picture-&amp;gt;i_planes; i_plane++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        const int i_src_plane = ((p_va-&amp;gt;image.format.fourcc ==  &lt;BR /&gt;VA_FOURCC('Y','V','1','2' )) &amp;amp;&amp;amp; i_plane != 0) ?  (3 - i_plane) : i_plane;&lt;BR /&gt;++        const uint8_t *p_src = (uint8_t*)p_base +  &lt;BR /&gt;p_va-&amp;gt;image.offsets[i_src_plane];&lt;BR /&gt;++        const int i_src_stride = p_va-&amp;gt;image.pitches[i_src_plane];&lt;BR /&gt;++&lt;BR /&gt;++        uint8_t *p_dst = p_picture-&amp;gt;p[i_plane].p_pixels;&lt;BR /&gt;++        const int i_dst_stride = p_picture-&amp;gt;p[i_plane].i_pitch;&lt;BR /&gt;++&lt;BR /&gt;++        if( i_src_stride != i_dst_stride )&lt;BR /&gt;++        {&lt;BR /&gt;++            for( int i = 0; i &amp;lt; p_picture-&amp;gt;p[i_plane].i_visible_lines;  &lt;BR /&gt;i++ )&lt;BR /&gt;++            {&lt;BR /&gt;++                vlc_memcpy( p_dst, p_src, __MIN( i_src_stride,  &lt;BR /&gt;i_dst_stride ) );&lt;BR /&gt;++                p_src += i_src_stride;&lt;BR /&gt;++                p_dst += i_dst_stride;&lt;BR /&gt;++            }&lt;BR /&gt;++        }&lt;BR /&gt;++        else&lt;BR /&gt;++        {&lt;BR /&gt;++            vlc_memcpy( p_dst, p_src,  &lt;BR /&gt;p_picture-&amp;gt;p[i_plane].i_visible_lines * i_src_stride );&lt;BR /&gt;++        }&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    if( vaUnmapBuffer( p_va-&amp;gt;p_display, p_va-&amp;gt;image.buf ) )&lt;BR /&gt;++        return VLC_EGENERIC;&lt;BR /&gt;++&lt;BR /&gt;++    return VLC_SUCCESS;&lt;BR /&gt;++}&lt;BR /&gt;++int VaGrabSurface( vlc_va_t *p_va, AVFrame *p_ff )&lt;BR /&gt;++{&lt;BR /&gt;++    int i_old;&lt;BR /&gt;++    int i;&lt;BR /&gt;++&lt;BR /&gt;++    /* Grab an unused surface, in case none are, try the oldest&lt;BR /&gt;++     * XXX using the oldest is a workaround in case a problem happens  &lt;BR /&gt;with ffmpeg */&lt;BR /&gt;++    for( i = 0, i_old = 0; i &amp;lt; p_va-&amp;gt;i_surface_count; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        vlc_va_surface_t *p_surface = &amp;amp;p_va-&amp;gt;p_surface&lt;I&gt;;&lt;BR /&gt;++&lt;BR /&gt;++        if( !p_surface-&amp;gt;i_refcount )&lt;BR /&gt;++            break;&lt;BR /&gt;++&lt;BR /&gt;++        if( p_surface-&amp;gt;i_order &amp;lt; p_va-&amp;gt;p_surface[i_old].i_order )&lt;BR /&gt;++            i_old = i;&lt;BR /&gt;++    }&lt;BR /&gt;++    if( i &amp;gt;= p_va-&amp;gt;i_surface_count )&lt;BR /&gt;++        i = i_old;&lt;BR /&gt;++&lt;BR /&gt;++    vlc_va_surface_t *p_surface = &amp;amp;p_va-&amp;gt;p_surface&lt;I&gt;;&lt;BR /&gt;++&lt;BR /&gt;++    p_surface-&amp;gt;i_refcount = 1;&lt;BR /&gt;++    p_surface-&amp;gt;i_order = p_va-&amp;gt;i_surface_order++;&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    for( int i = 0; i &amp;lt; 4; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        p_ff-&amp;gt;data&lt;I&gt; = NULL;&lt;BR /&gt;++        p_ff-&amp;gt;linesize&lt;I&gt; = 0;&lt;BR /&gt;++&lt;BR /&gt;++        if( i == 0 || i == 3 )&lt;BR /&gt;++            p_ff-&amp;gt;data&lt;I&gt; = (void*)(uintptr_t)p_surface-&amp;gt;i_id;/* Yummie */&lt;BR /&gt;++    }&lt;BR /&gt;++    return VLC_SUCCESS;&lt;BR /&gt;++}&lt;BR /&gt;++void VaUngrabSurface( vlc_va_t *p_va, AVFrame *p_ff )&lt;BR /&gt;++{&lt;BR /&gt;++    VASurfaceID i_surface_id = (VASurfaceID)(uintptr_t)p_ff-&amp;gt;data[3];&lt;BR /&gt;++&lt;BR /&gt;++    for( int i = 0; i &amp;lt; p_va-&amp;gt;i_surface_count; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        vlc_va_surface_t *p_surface = &amp;amp;p_va-&amp;gt;p_surface&lt;I&gt;;&lt;BR /&gt;++&lt;BR /&gt;++        if( p_surface-&amp;gt;i_id == i_surface_id )&lt;BR /&gt;++            p_surface-&amp;gt;i_refcount--;&lt;BR /&gt;++    }&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++#else&lt;BR /&gt;++&lt;BR /&gt;++vlc_va_t *VaNew( int i_codec_id )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(i_codec_id);&lt;BR /&gt;++    return NULL;&lt;BR /&gt;++}&lt;BR /&gt;++void VaDelete( vlc_va_t *p_va )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(p_va);&lt;BR /&gt;++    assert( 0 );&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++void VaVersion( vlc_va_t *p_va, char *psz_version, size_t i_version )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(p_va); VLC_UNUSED(psz_version); VLC_UNUSED(i_version);&lt;BR /&gt;++    assert(0);&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++int VaSetup( vlc_va_t *p_va, void **pp_hw_ctx, vlc_fourcc_t *pi_chroma,&lt;BR /&gt;++             int i_width, int i_height )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(p_va); VLC_UNUSED(pp_hw_ctx); VLC_UNUSED(pi_chroma);&lt;BR /&gt;++    VLC_UNUSED(i_width); VLC_UNUSED(i_height);&lt;BR /&gt;++    assert(0);&lt;BR /&gt;++    return -1;&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++int VaExtract( vlc_va_t *p_va, picture_t *p_picture, AVFrame *p_ff )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(p_va); VLC_UNUSED(p_picture); VLC_UNUSED(p_ff);&lt;BR /&gt;++    assert(0);&lt;BR /&gt;++    return -1;&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++int VaGrabSurface( vlc_va_t *p_va, AVFrame *p_ff )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(p_va); VLC_UNUSED(p_ff);&lt;BR /&gt;++    assert(0);&lt;BR /&gt;++    return -1;&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++void VaUngrabSurface( vlc_va_t *p_va, AVFrame *p_ff )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(p_va); VLC_UNUSED(p_ff);&lt;BR /&gt;++    assert(0);&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++#endif&lt;BR /&gt;+diff -Naur vlc-1.0.0-rc4-old/modules/codec/avcodec/vaapi.h  &lt;BR /&gt;vlc-1.0.0-rc4-new/modules/codec/avcodec/vaapi.h&lt;BR /&gt;+--- vlc-1.0.0-rc4-old/modules/codec/avcodec/vaapi.h    1969-12-31  &lt;BR /&gt;16:00:00.000000000 -0800&lt;BR /&gt;++++ vlc-1.0.0-rc4-new/modules/codec/avcodec/vaapi.h    2009-06-19  &lt;BR /&gt;16:31:52.000000000 -0700&lt;BR /&gt;+@@ -0,0 +1,43 @@&lt;BR /&gt;++/*****************************************************************************&lt;BR /&gt;++ * vaapi.h: VAAPI helpers for the ffmpeg decoder&lt;BR /&gt;++  &lt;BR /&gt;*****************************************************************************&lt;BR /&gt;++ * Copyright (C) 2009 Laurent Aimar&lt;BR /&gt;++ * $Id$&lt;BR /&gt;++ *&lt;BR /&gt;++ * Authors: Laurent Aimar &lt;FENRIR_AT_ videolan="" _dot_="" org=""&gt;&lt;BR /&gt;++ *&lt;BR /&gt;++ * This program is free software; you can redistribute it and/or modify&lt;BR /&gt;++ * it under the terms of the GNU General Public License as published by&lt;BR /&gt;++ * the Free Software Foundation; either version 2 of the License, or&lt;BR /&gt;++ * (at your option) any later version.&lt;BR /&gt;++ *&lt;BR /&gt;++ * This program is distributed in the hope that it will be useful,&lt;BR /&gt;++ * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;BR /&gt;++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;BR /&gt;++ * GNU General Public License for more details.&lt;BR /&gt;++ *&lt;BR /&gt;++ * You should have received a copy of the GNU General Public License&lt;BR /&gt;++ * along with this program; if not, write to the Free Software&lt;BR /&gt;++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  &lt;BR /&gt;02110-1301, USA.&lt;BR /&gt;++  &lt;BR /&gt;*****************************************************************************/&lt;BR /&gt;++&lt;BR /&gt;++#ifndef _VLC_VAAPI_H&lt;BR /&gt;++#define _VLC_VAAPI_H 1&lt;BR /&gt;++&lt;BR /&gt;++typedef struct vlc_va_t vlc_va_t;&lt;BR /&gt;++&lt;BR /&gt;++vlc_va_t *VaNew( int i_codec_id );&lt;BR /&gt;++void VaDelete( vlc_va_t *p_va );&lt;BR /&gt;++&lt;BR /&gt;++void VaVersion( vlc_va_t *p_va, char *psz_version, size_t i_version );&lt;BR /&gt;++&lt;BR /&gt;++int VaSetup( vlc_va_t *p_va, void **pp_hw_ctx, vlc_fourcc_t *pi_chroma,&lt;BR /&gt;++             int i_width, int i_height );&lt;BR /&gt;++&lt;BR /&gt;++int VaExtract( vlc_va_t *p_va, picture_t *p_picture, AVFrame *p_ff );&lt;BR /&gt;++&lt;BR /&gt;++int VaGrabSurface( vlc_va_t *p_va, AVFrame *p_ff );&lt;BR /&gt;++&lt;BR /&gt;++void VaUngrabSurface( vlc_va_t *p_va, AVFrame *p_ff );&lt;BR /&gt;++&lt;BR /&gt;++#endif&lt;BR /&gt;+diff -Naur vlc-1.0.0-rc4-old/modules/codec/avcodec/video.c  &lt;BR /&gt;vlc-1.0.0-rc4-new/modules/codec/avcodec/video.c&lt;BR /&gt;+--- vlc-1.0.0-rc4-old/modules/codec/avcodec/video.c    2009-06-14  &lt;BR /&gt;11:14:59.000000000 -0700&lt;BR /&gt;++++ vlc-1.0.0-rc4-new/modules/codec/avcodec/video.c    2009-06-19  &lt;BR /&gt;16:36:25.000000000 -0700&lt;BR /&gt;+@@ -34,10 +34,14 @@&lt;BR /&gt;+ #include &lt;VLC_VOUT.H&gt;&lt;BR /&gt;+ #include &lt;VLC_CODECS.H&gt;                               /* BITMAPINFOHEADER  &lt;BR /&gt;*/&lt;BR /&gt;+ #include &lt;VLC_AVCODEC.H&gt;&lt;BR /&gt;++#include &lt;ASSERT.H&gt;&lt;BR /&gt;+&lt;BR /&gt;+ /* ffmpeg header */&lt;BR /&gt;+ #ifdef HAVE_LIBAVCODEC_AVCODEC_H&lt;BR /&gt;+ #   include &lt;LIBAVCODEC&gt;&lt;BR /&gt;++#   ifdef HAVE_AVCODEC_VAAPI&lt;BR /&gt;++#       include &lt;LIBAVCODEC&gt;&lt;BR /&gt;++#   endif&lt;BR /&gt;+ #elif defined(HAVE_FFMPEG_AVCODEC_H)&lt;BR /&gt;+ #   include &lt;FFMPEG&gt;&lt;BR /&gt;+ #else&lt;BR /&gt;+@@ -45,6 +49,7 @@&lt;BR /&gt;+ #endif&lt;BR /&gt;+&lt;BR /&gt;+ #include "avcodec.h"&lt;BR /&gt;++#include "vaapi.h"&lt;BR /&gt;+&lt;BR /&gt;+  &lt;BR /&gt;/*****************************************************************************&lt;BR /&gt;+  * decoder_sys_t : decoder descriptor&lt;BR /&gt;+@@ -85,6 +90,9 @@&lt;BR /&gt;+&lt;BR /&gt;+     /* */&lt;BR /&gt;+     bool b_flush;&lt;BR /&gt;++&lt;BR /&gt;++    /* VA API */&lt;BR /&gt;++    vlc_va_t *p_va;&lt;BR /&gt;+ };&lt;BR /&gt;+&lt;BR /&gt;+ /* FIXME (dummy palette for now) */&lt;BR /&gt;+@@ -101,6 +109,10 @@&lt;BR /&gt;+ static void ffmpeg_ReleaseFrameBuf( struct AVCodecContext *, AVFrame * );&lt;BR /&gt;+ static void ffmpeg_NextPts( decoder_t * );&lt;BR /&gt;+&lt;BR /&gt;++static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *,&lt;BR /&gt;++                                          const enum PixelFormat * );&lt;BR /&gt;++&lt;BR /&gt;++&lt;BR /&gt;+ static uint32_t ffmpeg_CodecTag( vlc_fourcc_t fcc )&lt;BR /&gt;+ {&lt;BR /&gt;+     uint8_t *p = (uint8_t*)&amp;amp;fcc;&lt;BR /&gt;+@@ -115,7 +127,7 @@&lt;BR /&gt;+ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,&lt;BR /&gt;+                                             AVCodecContext *p_context )&lt;BR /&gt;+ {&lt;BR /&gt;+-    picture_t *p_pic;&lt;BR /&gt;++    decoder_sys_t *p_sys = p_dec-&amp;gt;p_sys;&lt;BR /&gt;+&lt;BR /&gt;+     p_dec-&amp;gt;fmt_out.video.i_width = p_context-&amp;gt;width;&lt;BR /&gt;+     p_dec-&amp;gt;fmt_out.video.i_height = p_context-&amp;gt;height;&lt;BR /&gt;+@@ -125,10 +137,12 @@&lt;BR /&gt;+         return NULL; /* invalid display size */&lt;BR /&gt;+     }&lt;BR /&gt;+&lt;BR /&gt;+-    if( GetVlcChroma( &amp;amp;p_dec-&amp;gt;fmt_out.video, p_context-&amp;gt;pix_fmt ) !=  &lt;BR /&gt;VLC_SUCCESS )&lt;BR /&gt;++    if( !p_sys-&amp;gt;p_va &amp;amp;&amp;amp; GetVlcChroma( &amp;amp;p_dec-&amp;gt;fmt_out.video,  &lt;BR /&gt;p_context-&amp;gt;pix_fmt ) )&lt;BR /&gt;+     {&lt;BR /&gt;+-        /* we are doomed, but not really, because most codecs set their  &lt;BR /&gt;pix_fmt much later */&lt;BR /&gt;+-        p_dec-&amp;gt;fmt_out.i_codec = VLC_FOURCC('I','4','2','0');&lt;BR /&gt;++        /* we are doomed, but not really, because most codecs set their  &lt;BR /&gt;pix_fmt&lt;BR /&gt;++         * much later&lt;BR /&gt;++         * FIXME does it make sense here ? */&lt;BR /&gt;++        p_dec-&amp;gt;fmt_out.video.i_chroma = VLC_FOURCC('I','4','2','0');&lt;BR /&gt;+     }&lt;BR /&gt;+     p_dec-&amp;gt;fmt_out.i_codec = p_dec-&amp;gt;fmt_out.video.i_chroma;&lt;BR /&gt;+&lt;BR /&gt;+@@ -166,9 +180,7 @@&lt;BR /&gt;+         p_dec-&amp;gt;fmt_out.video.i_frame_rate_base = p_context-&amp;gt;time_base.num;&lt;BR /&gt;+     }&lt;BR /&gt;+&lt;BR /&gt;+-    p_pic = decoder_NewPicture( p_dec );&lt;BR /&gt;+-&lt;BR /&gt;+-    return p_pic;&lt;BR /&gt;++    return decoder_NewPicture( p_dec );&lt;BR /&gt;+ }&lt;BR /&gt;+&lt;BR /&gt;+  &lt;BR /&gt;/*****************************************************************************&lt;BR /&gt;+@@ -193,6 +205,7 @@&lt;BR /&gt;+     p_sys-&amp;gt;psz_namecodec = psz_namecodec;&lt;BR /&gt;+     p_sys-&amp;gt;p_ff_pic = avcodec_alloc_frame();&lt;BR /&gt;+     p_sys-&amp;gt;b_delayed_open = true;&lt;BR /&gt;++    p_sys-&amp;gt;p_va = NULL;&lt;BR /&gt;+&lt;BR /&gt;+     /* ***** Fill p_context with init values ***** */&lt;BR /&gt;+     p_sys-&amp;gt;p_context-&amp;gt;codec_tag = ffmpeg_CodecTag( p_dec-&amp;gt;fmt_in.i_codec  &lt;BR /&gt;);&lt;BR /&gt;+@@ -319,6 +332,9 @@&lt;BR /&gt;+     p_sys-&amp;gt;p_context-&amp;gt;release_buffer = ffmpeg_ReleaseFrameBuf;&lt;BR /&gt;+     p_sys-&amp;gt;p_context-&amp;gt;opaque = p_dec;&lt;BR /&gt;+&lt;BR /&gt;++    if( var_CreateGetBool( p_dec, "ffmpeg-hw" ) )&lt;BR /&gt;++        p_sys-&amp;gt;p_context-&amp;gt;get_format = ffmpeg_GetFormat;&lt;BR /&gt;++&lt;BR /&gt;+     /* ***** misc init ***** */&lt;BR /&gt;+     p_sys-&amp;gt;input_pts = p_sys-&amp;gt;input_dts = 0;&lt;BR /&gt;+     p_sys-&amp;gt;i_pts = 0;&lt;BR /&gt;+@@ -621,7 +637,7 @@&lt;BR /&gt;+             p_sys-&amp;gt;i_late_frames = 0;&lt;BR /&gt;+         }&lt;BR /&gt;+&lt;BR /&gt;+-        if( !b_drawpicture || !p_sys-&amp;gt;p_ff_pic-&amp;gt;linesize[0] )&lt;BR /&gt;++        if( !b_drawpicture || ( !p_sys-&amp;gt;p_va  &lt;BR /&gt;&amp;amp;&amp;amp; !p_sys-&amp;gt;p_ff_pic-&amp;gt;linesize[0] ) )&lt;BR /&gt;+         {&lt;BR /&gt;+             /* Do not display the picture */&lt;BR /&gt;+             p_pic = (picture_t *)p_sys-&amp;gt;p_ff_pic-&amp;gt;opaque;&lt;BR /&gt;+@@ -736,6 +752,9 @@&lt;BR /&gt;+&lt;BR /&gt;+     if( p_sys-&amp;gt;p_ff_pic ) av_free( p_sys-&amp;gt;p_ff_pic );&lt;BR /&gt;+     free( p_sys-&amp;gt;p_buffer_orig );&lt;BR /&gt;++&lt;BR /&gt;++    if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++        VaDelete( p_sys-&amp;gt;p_va );&lt;BR /&gt;+ }&lt;BR /&gt;+&lt;BR /&gt;+  &lt;BR /&gt;/*****************************************************************************&lt;BR /&gt;+@@ -838,6 +857,14 @@&lt;BR /&gt;+&lt;BR /&gt;+     p_sys-&amp;gt;b_delayed_open = false;&lt;BR /&gt;+&lt;BR /&gt;++    if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++    {&lt;BR /&gt;++        char psz_version[128];&lt;BR /&gt;++&lt;BR /&gt;++        VaVersion( p_sys-&amp;gt;p_va, psz_version, sizeof(psz_version) );&lt;BR /&gt;++        msg_Info( p_dec, "Using VA API version %s for hardware  &lt;BR /&gt;decoding.", psz_version );&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;+     return VLC_SUCCESS;&lt;BR /&gt;+ }&lt;BR /&gt;+  &lt;BR /&gt;/*****************************************************************************&lt;BR /&gt;+@@ -849,7 +876,11 @@&lt;BR /&gt;+ {&lt;BR /&gt;+     decoder_sys_t *p_sys = p_dec-&amp;gt;p_sys;&lt;BR /&gt;+&lt;BR /&gt;+-    if( TestFfmpegChroma( p_sys-&amp;gt;p_context-&amp;gt;pix_fmt, -1 ) == VLC_SUCCESS )&lt;BR /&gt;++    if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++    {&lt;BR /&gt;++        VaExtract( p_sys-&amp;gt;p_va, p_pic, p_ff_pic );&lt;BR /&gt;++    }&lt;BR /&gt;++    else if( TestFfmpegChroma( p_sys-&amp;gt;p_context-&amp;gt;pix_fmt, -1 ) ==  &lt;BR /&gt;VLC_SUCCESS )&lt;BR /&gt;+     {&lt;BR /&gt;+         int i_plane, i_size, i_line;&lt;BR /&gt;+         uint8_t *p_dst, *p_src;&lt;BR /&gt;+@@ -899,11 +930,33 @@&lt;BR /&gt;+     ffmpeg_SetFrameBufferPts( p_dec, p_ff_pic );&lt;BR /&gt;+&lt;BR /&gt;+     /* */&lt;BR /&gt;+-    p_ff_pic-&amp;gt;opaque = 0;&lt;BR /&gt;++    p_ff_pic-&amp;gt;opaque = NULL;&lt;BR /&gt;++&lt;BR /&gt;++    if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++    {&lt;BR /&gt;++        if( VaSetup( p_sys-&amp;gt;p_va,&lt;BR /&gt;++                     &amp;amp;p_sys-&amp;gt;p_context-&amp;gt;hwaccel_context,  &lt;BR /&gt;&amp;amp;p_dec-&amp;gt;fmt_out.video.i_chroma,&lt;BR /&gt;++                     p_sys-&amp;gt;p_context-&amp;gt;width, p_sys-&amp;gt;p_context-&amp;gt;height ) )&lt;BR /&gt;++        {&lt;BR /&gt;++            msg_Err( p_dec, "VaSetup failed" );&lt;BR /&gt;++            return -1;&lt;BR /&gt;++        }&lt;BR /&gt;++&lt;BR /&gt;++        /* */&lt;BR /&gt;++        p_ff_pic-&amp;gt;type = FF_BUFFER_TYPE_USER;&lt;BR /&gt;++        /* FIXME what is that, should give good value */&lt;BR /&gt;++        p_ff_pic-&amp;gt;age = 256*256*256*64; // FIXME FIXME from ffmpeg&lt;BR /&gt;+&lt;BR /&gt;+-    /* Not much to do in indirect rendering mode */&lt;BR /&gt;+-    if( !p_sys-&amp;gt;b_direct_rendering )&lt;BR /&gt;++        if( VaGrabSurface( p_sys-&amp;gt;p_va, p_ff_pic ) )&lt;BR /&gt;++        {&lt;BR /&gt;++            msg_Err( p_dec, "VaGrabSurface failed" );&lt;BR /&gt;++            return -1;&lt;BR /&gt;++        }&lt;BR /&gt;++        return 0;&lt;BR /&gt;++    }&lt;BR /&gt;++    else if( !p_sys-&amp;gt;b_direct_rendering )&lt;BR /&gt;+     {&lt;BR /&gt;++        /* Not much to do in indirect rendering mode */&lt;BR /&gt;+         return avcodec_default_get_buffer( p_context, p_ff_pic );&lt;BR /&gt;+     }&lt;BR /&gt;+&lt;BR /&gt;+@@ -1012,20 +1065,30 @@&lt;BR /&gt;+                                     AVFrame *p_ff_pic )&lt;BR /&gt;+ {&lt;BR /&gt;+     decoder_t *p_dec = (decoder_t *)p_context-&amp;gt;opaque;&lt;BR /&gt;++    decoder_sys_t *p_sys = p_dec-&amp;gt;p_sys;&lt;BR /&gt;++&lt;BR /&gt;++    if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++    {&lt;BR /&gt;++        VaUngrabSurface( p_sys-&amp;gt;p_va, p_ff_pic );&lt;BR /&gt;+&lt;BR /&gt;+-    if( !p_ff_pic-&amp;gt;opaque )&lt;BR /&gt;++        /* */&lt;BR /&gt;++        for( int i = 0; i &amp;lt; 4; i++ )&lt;BR /&gt;++            p_ff_pic-&amp;gt;data&lt;I&gt; = NULL;&lt;BR /&gt;++    }&lt;BR /&gt;++    else if( !p_ff_pic-&amp;gt;opaque )&lt;BR /&gt;+     {&lt;BR /&gt;+         avcodec_default_release_buffer( p_context, p_ff_pic );&lt;BR /&gt;+-        return;&lt;BR /&gt;+     }&lt;BR /&gt;++    else&lt;BR /&gt;++    {&lt;BR /&gt;++        picture_t *p_pic = (picture_t*)p_ff_pic-&amp;gt;opaque;&lt;BR /&gt;+&lt;BR /&gt;+-    picture_t *p_pic = (picture_t*)p_ff_pic-&amp;gt;opaque;&lt;BR /&gt;+-    decoder_UnlinkPicture( p_dec, p_pic );&lt;BR /&gt;++        decoder_UnlinkPicture( p_dec, p_pic );&lt;BR /&gt;+&lt;BR /&gt;+-    p_ff_pic-&amp;gt;data[0] = NULL;&lt;BR /&gt;+-    p_ff_pic-&amp;gt;data[1] = NULL;&lt;BR /&gt;+-    p_ff_pic-&amp;gt;data[2] = NULL;&lt;BR /&gt;+-    p_ff_pic-&amp;gt;data[3] = NULL;&lt;BR /&gt;++        /* */&lt;BR /&gt;++        for( int i = 0; i &amp;lt; 4; i++ )&lt;BR /&gt;++            p_ff_pic-&amp;gt;data&lt;I&gt; = NULL;&lt;BR /&gt;++    }&lt;BR /&gt;+ }&lt;BR /&gt;+&lt;BR /&gt;+ static void ffmpeg_NextPts( decoder_t *p_dec )&lt;BR /&gt;+@@ -1052,3 +1115,53 @@&lt;BR /&gt;+             (2 * p_sys-&amp;gt;p_context-&amp;gt;time_base.den);&lt;BR /&gt;+     }&lt;BR /&gt;+ }&lt;BR /&gt;++&lt;BR /&gt;++static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_codec,&lt;BR /&gt;++                                          const enum PixelFormat *pi_fmt )&lt;BR /&gt;++{&lt;BR /&gt;++    decoder_t *p_dec = p_codec-&amp;gt;opaque;&lt;BR /&gt;++    decoder_sys_t *p_sys = p_dec-&amp;gt;p_sys;&lt;BR /&gt;++&lt;BR /&gt;++    if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++    {&lt;BR /&gt;++        VaDelete( p_sys-&amp;gt;p_va );&lt;BR /&gt;++        p_sys-&amp;gt;p_va = NULL;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    /* Try too look for a supported hw acceleration */&lt;BR /&gt;++    for( int i = 0; pi_fmt&lt;I&gt; != PIX_FMT_NONE; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        static const char *ppsz_name[PIX_FMT_NB] = {&lt;BR /&gt;++            [PIX_FMT_VDPAU_H264] = "PIX_FMT_VDPAU_H264",&lt;BR /&gt;++            [PIX_FMT_VAAPI_IDCT] = "PIX_FMT_VAAPI_IDCT",&lt;BR /&gt;++            [PIX_FMT_VAAPI_VLD] = "PIX_FMT_VAAPI_VLD",&lt;BR /&gt;++            [PIX_FMT_VAAPI_MOCO] = "PIX_FMT_VAAPI_MOCO",&lt;BR /&gt;++            [PIX_FMT_YUYV422] = "PIX_FMT_YUYV422",&lt;BR /&gt;++            [PIX_FMT_YUV420P] = "PIX_FMT_YUV420P",&lt;BR /&gt;++        };&lt;BR /&gt;++        msg_Dbg( p_dec, "Available decoder output format %d (%s)",  &lt;BR /&gt;pi_fmt&lt;I&gt;, ppsz_name[pi_fmt&lt;I&gt;] ?: "Unknown" );&lt;BR /&gt;++&lt;BR /&gt;++        /* Only VLD supported */&lt;BR /&gt;++        if( pi_fmt&lt;I&gt; == PIX_FMT_VAAPI_VLD )&lt;BR /&gt;++        {&lt;BR /&gt;++            msg_Dbg( p_dec, "Trying VA API" );&lt;BR /&gt;++            p_sys-&amp;gt;p_va = VaNew( p_sys-&amp;gt;i_codec_id );&lt;BR /&gt;++            if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++            {&lt;BR /&gt;++                /* FIXME this will disabled direct rendering&lt;BR /&gt;++                 * even if a new pixel format is renegociated&lt;BR /&gt;++                 *&lt;BR /&gt;++                 * FIXME Try to call VaSetup when possible&lt;BR /&gt;++                 * to detect errors when possible (later is too late) */&lt;BR /&gt;++                p_sys-&amp;gt;b_direct_rendering = false;&lt;BR /&gt;++                p_sys-&amp;gt;p_context-&amp;gt;draw_horiz_band = NULL;&lt;BR /&gt;++                return pi_fmt&lt;I&gt;;&lt;BR /&gt;++            }&lt;BR /&gt;++            msg_Warn( p_dec, "Failed to open VA API" );&lt;BR /&gt;++        }&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    /* Fallback to default behaviour */&lt;BR /&gt;++    return avcodec_default_get_format( p_codec, pi_fmt );&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.blowdata4u.com" target="_blank"&gt;http://www.blowdata4u.com&lt;/A&gt;&lt;BR /&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/FFMPEG&gt;&lt;/LIBAVCODEC&gt;&lt;/LIBAVCODEC&gt;&lt;/ASSERT.H&gt;&lt;/VLC_AVCODEC.H&gt;&lt;/VLC_CODECS.H&gt;&lt;/VLC_VOUT.H&gt;&lt;/FENRIR_AT_&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/VA&gt;&lt;/X11&gt;&lt;/AVCODEC.H&gt;&lt;/FFMPEG&gt;&lt;/LIBAVCODEC&gt;&lt;/LIBAVCODEC&gt;&lt;/ASSERT.H&gt;&lt;/VLC_VOUT.H&gt;&lt;/VLC_COMMON.H&gt;&lt;/FENRIR_AT_&gt;</description>
      <pubDate>Mon, 21 Dec 2009 12:34:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900480#M10992</guid>
      <dc:creator>blowdata4u</dc:creator>
      <dc:date>2009-12-21T12:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Mplayer performance with VAAPI support</title>
      <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900481#M10993</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/456057"&gt;raj.ece03&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;P&gt;Dear All,&lt;/P&gt;
&lt;P&gt;I am working on Intel atom board (z530 1.60GHz) . Here I am trying to see the CPU utilization of mplayer with VAAPI support i followed steps given in below website&lt;BR /&gt; &lt;A title="http://www.splitted-desktop.com/~gbeauchesne/mplayer-vaapi/" rel="nofollow" href="http://www.splitted-desktop.com/%7Egbeauchesne/mplayer-vaapi/"&gt;http://www.splitted-desktop.com/~gbeauchesne/mplayer-vaapi/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;But while running application with ./mplayer -vo vaapi -va vaapi  this option i am getting the following error&lt;/P&gt;
&lt;P&gt;[vo_vaapi] vaInitialize(): invalid VADisplay&lt;BR /&gt; Error opening/initializing the selected video_out (-vo) device.&lt;/P&gt;
&lt;P&gt;can any one give sugisition.&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;
&lt;P&gt;Regards&lt;BR /&gt; Raj&lt;/P&gt;
&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Dec 2009 04:02:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900481#M10993</guid>
      <dc:creator>Rajkumar</dc:creator>
      <dc:date>2009-12-22T04:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Mplayer performance with VAAPI support</title>
      <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900482#M10994</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/456057"&gt;raj.ece03&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/456057"&gt;raj.ece03&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;P&gt;Dear All,&lt;/P&gt;
&lt;P&gt;I am working on Intel atom board (z530 1.60GHz) . Here I am trying to see the CPU utilization of mplayer with VAAPI support i followed steps given in below website&lt;BR /&gt; &lt;A title="http://www.splitted-desktop.com/~gbeauchesne/mplayer-vaapi/" rel="nofollow" href="http://www.splitted-desktop.com/%7Egbeauchesne/mplayer-vaapi/"&gt;http://www.splitted-desktop.com/~gbeauchesne/mplayer-vaapi/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;But while running application with ./mplayer -vo vaapi -va vaapi  this option i am getting the following error&lt;/P&gt;
&lt;P&gt;[vo_vaapi] vaInitialize(): invalid VADisplay&lt;BR /&gt; Error opening/initializing the selected video_out (-vo) device.&lt;/P&gt;
&lt;P&gt;can any one give sugisition.&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;
&lt;P&gt;Regards&lt;BR /&gt; Raj&lt;/P&gt;
&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Dec 2009 04:05:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900482#M10994</guid>
      <dc:creator>Rajkumar</dc:creator>
      <dc:date>2009-12-22T04:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Mplayer performance with VAAPI support</title>
      <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900483#M10995</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/457933"&gt;blowdata4u&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Added:&lt;BR /&gt; &lt;BR /&gt;trunk/gar-minimyth/script/mediaplayers/vlc/files/vlc-1.0.0-rc4-vaapi.patch&lt;BR /&gt;&lt;BR /&gt;Log:&lt;BR /&gt;- Added VLC VAAPI patch to the build system but did not include it in the  &lt;BR /&gt;build.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Added:  &lt;BR /&gt;trunk/gar-minimyth/script/mediaplayers/vlc/files/vlc-1.0.0-rc4-vaapi.patch&lt;BR /&gt;==============================================================================&lt;BR /&gt;--- (empty file)&lt;BR /&gt;+++  &lt;BR /&gt;trunk/gar-minimyth/script/mediaplayers/vlc/files/vlc-1.0.0-rc4-vaapi.patch      &lt;BR /&gt; &lt;BR /&gt;Fri Jun 19 20:35:58 2009&lt;BR /&gt;@@ -0,0 +1,860 @@&lt;BR /&gt;+diff -Naur vlc-1.0.0-rc4-old/modules/codec/avcodec/avcodec.c  &lt;BR /&gt;vlc-1.0.0-rc4-new/modules/codec/avcodec/avcodec.c&lt;BR /&gt;+--- vlc-1.0.0-rc4-old/modules/codec/avcodec/avcodec.c  2009-05-10  &lt;BR /&gt;16:03:54.000000000 -0700&lt;BR /&gt;++++ vlc-1.0.0-rc4-new/modules/codec/avcodec/avcodec.c  2009-06-19  &lt;BR /&gt;16:31:52.000000000 -0700&lt;BR /&gt;+@@ -129,6 +129,9 @@&lt;BR /&gt;+&lt;BR /&gt;+     add_integer( "ffmpeg-debug", 0, NULL, DEBUG_TEXT, DEBUG_LONGTEXT,&lt;BR /&gt;+                  true )&lt;BR /&gt;++#ifdef HAVE_AVCODEC_VAAPI&lt;BR /&gt;++    add_bool( "ffmpeg-hw", true, NULL, HW_TEXT, HW_LONGTEXT, true )&lt;BR /&gt;++#endif&lt;BR /&gt;+&lt;BR /&gt;+ #ifdef ENABLE_SOUT&lt;BR /&gt;+     /* encoder submodule */&lt;BR /&gt;+diff -Naur vlc-1.0.0-rc4-old/modules/codec/avcodec/avcodec.h  &lt;BR /&gt;vlc-1.0.0-rc4-new/modules/codec/avcodec/avcodec.h&lt;BR /&gt;+--- vlc-1.0.0-rc4-old/modules/codec/avcodec/avcodec.h  2009-05-10  &lt;BR /&gt;16:03:54.000000000 -0700&lt;BR /&gt;++++ vlc-1.0.0-rc4-new/modules/codec/avcodec/avcodec.h  2009-06-19  &lt;BR /&gt;16:31:52.000000000 -0700&lt;BR /&gt;+@@ -127,6 +127,9 @@&lt;BR /&gt;+     "usually has a detrimental effect on quality. However it provides a  &lt;BR /&gt;big " &lt;BR /&gt;+     "speedup for high definition streams." )&lt;BR /&gt;+&lt;BR /&gt;++#define HW_TEXT N_("Hardware decoding")&lt;BR /&gt;++#define HW_LONGTEXT N_("This allows hardware decoding when available.")&lt;BR /&gt;++&lt;BR /&gt;+ /*&lt;BR /&gt;+  * Encoder options&lt;BR /&gt;+  */&lt;BR /&gt;+@@ -257,3 +260,6 @@&lt;BR /&gt;+ #   define AV_VERSION_INT(a, b, c) ((a)&amp;lt;&amp;lt;16 | (b)&amp;lt;&amp;lt;8 | (c))&lt;BR /&gt;+ #endif&lt;BR /&gt;+&lt;BR /&gt;++/* Uncomment it to enable compilation with vaapi (you also must change  &lt;BR /&gt;the build&lt;BR /&gt;++ * system) */&lt;BR /&gt;++//#define HAVE_AVCODEC_VAAPI 1&lt;BR /&gt;+diff -Naur vlc-1.0.0-rc4-old/modules/codec/avcodec/Modules.am  &lt;BR /&gt;vlc-1.0.0-rc4-new/modules/codec/avcodec/Modules.am&lt;BR /&gt;+--- vlc-1.0.0-rc4-old/modules/codec/avcodec/Modules.am 2009-05-10  &lt;BR /&gt;16:03:54.000000000 -0700&lt;BR /&gt;++++ vlc-1.0.0-rc4-new/modules/codec/avcodec/Modules.am 2009-06-19  &lt;BR /&gt;16:31:52.000000000 -0700&lt;BR /&gt;+@@ -7,6 +7,7 @@&lt;BR /&gt;+       avutil.h &lt;BR /&gt;+       fourcc.c &lt;BR /&gt;+       chroma.c &lt;BR /&gt;++      vaapi.c &lt;BR /&gt;+       $(NULL)&lt;BR /&gt;+&lt;BR /&gt;+ if ENABLE_SOUT&lt;BR /&gt;+diff -Naur vlc-1.0.0-rc4-old/modules/codec/avcodec/vaapi.c  &lt;BR /&gt;vlc-1.0.0-rc4-new/modules/codec/avcodec/vaapi.c&lt;BR /&gt;+--- vlc-1.0.0-rc4-old/modules/codec/avcodec/vaapi.c    1969-12-31  &lt;BR /&gt;16:00:00.000000000 -0800&lt;BR /&gt;++++ vlc-1.0.0-rc4-new/modules/codec/avcodec/vaapi.c    2009-06-19  &lt;BR /&gt;16:31:52.000000000 -0700&lt;BR /&gt;+@@ -0,0 +1,487 @@&lt;BR /&gt;++/*****************************************************************************&lt;BR /&gt;++ * vaapi.c: VAAPI helpers for the ffmpeg decoder&lt;BR /&gt;++  &lt;BR /&gt;*****************************************************************************&lt;BR /&gt;++ * Copyright (C) 2009 Laurent Aimar&lt;BR /&gt;++ * $Id$&lt;BR /&gt;++ *&lt;BR /&gt;++ * Authors: Laurent Aimar &lt;FENRIR_AT_ videolan="" _dot_="" org=""&gt;&lt;BR /&gt;++ *&lt;BR /&gt;++ * This program is free software; you can redistribute it and/or modify&lt;BR /&gt;++ * it under the terms of the GNU General Public License as published by&lt;BR /&gt;++ * the Free Software Foundation; either version 2 of the License, or&lt;BR /&gt;++ * (at your option) any later version.&lt;BR /&gt;++ *&lt;BR /&gt;++ * This program is distributed in the hope that it will be useful,&lt;BR /&gt;++ * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;BR /&gt;++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;BR /&gt;++ * GNU General Public License for more details.&lt;BR /&gt;++ *&lt;BR /&gt;++ * You should have received a copy of the GNU General Public License&lt;BR /&gt;++ * along with this program; if not, write to the Free Software&lt;BR /&gt;++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  &lt;BR /&gt;02110-1301, USA.&lt;BR /&gt;++  &lt;BR /&gt;*****************************************************************************/&lt;BR /&gt;++&lt;BR /&gt;++#ifdef HAVE_CONFIG_H&lt;BR /&gt;++# include "config.h"&lt;BR /&gt;++#endif&lt;BR /&gt;++&lt;BR /&gt;++#include &lt;VLC_COMMON.H&gt;&lt;BR /&gt;++#include &lt;VLC_VOUT.H&gt;&lt;BR /&gt;++#include &lt;ASSERT.H&gt;&lt;BR /&gt;++&lt;BR /&gt;++#ifdef HAVE_LIBAVCODEC_AVCODEC_H&lt;BR /&gt;++#   include &lt;LIBAVCODEC&gt;&lt;BR /&gt;++#   include &lt;LIBAVCODEC&gt;&lt;BR /&gt;++#elif defined(HAVE_FFMPEG_AVCODEC_H)&lt;BR /&gt;++#   include &lt;FFMPEG&gt;&lt;BR /&gt;++#else&lt;BR /&gt;++#   include &lt;AVCODEC.H&gt;&lt;BR /&gt;++#endif&lt;BR /&gt;++&lt;BR /&gt;++#include "avcodec.h"&lt;BR /&gt;++#include "vaapi.h"&lt;BR /&gt;++&lt;BR /&gt;++#ifdef HAVE_AVCODEC_VAAPI&lt;BR /&gt;++&lt;BR /&gt;++#include &lt;X11&gt;&lt;BR /&gt;++#include &lt;VA&gt;&lt;BR /&gt;++&lt;BR /&gt;++&lt;BR /&gt;++typedef struct&lt;BR /&gt;++{&lt;BR /&gt;++    VASurfaceID  i_id;&lt;BR /&gt;++    int          i_refcount;&lt;BR /&gt;++    unsigned int i_order;&lt;BR /&gt;++&lt;BR /&gt;++} vlc_va_surface_t;&lt;BR /&gt;++&lt;BR /&gt;++struct vlc_va_t&lt;BR /&gt;++{&lt;BR /&gt;++    /* */&lt;BR /&gt;++    Display      *p_display_x11;&lt;BR /&gt;++    VADisplay     p_display;&lt;BR /&gt;++&lt;BR /&gt;++    VAConfigID    i_config_id;&lt;BR /&gt;++    VAContextID   i_context_id;&lt;BR /&gt;++&lt;BR /&gt;++    struct vaapi_context hw_ctx;&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    int i_version_major;&lt;BR /&gt;++    int i_version_minor;&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    int          i_surface_count;&lt;BR /&gt;++    unsigned int i_surface_order;&lt;BR /&gt;++    int          i_surface_width;&lt;BR /&gt;++    int          i_surface_height;&lt;BR /&gt;++    vlc_fourcc_t i_surface_chroma;&lt;BR /&gt;++&lt;BR /&gt;++    vlc_va_surface_t *p_surface;&lt;BR /&gt;++&lt;BR /&gt;++    VAImage      image;&lt;BR /&gt;++&lt;BR /&gt;++};&lt;BR /&gt;++&lt;BR /&gt;++static int VaOpen( vlc_va_t *p_va, int i_codec_id );&lt;BR /&gt;++static void VaClose( vlc_va_t *p_va );&lt;BR /&gt;++&lt;BR /&gt;++static int VaCreateSurfaces( vlc_va_t *p_va, void **pp_hw_ctx,  &lt;BR /&gt;vlc_fourcc_t *pi_chroma,&lt;BR /&gt;++                             int i_width, int i_height );&lt;BR /&gt;++static void VaDestroySurfaces( vlc_va_t *p_va );&lt;BR /&gt;++&lt;BR /&gt;++vlc_va_t *VaNew( int i_codec_id )&lt;BR /&gt;++{&lt;BR /&gt;++    vlc_va_t *p_va = calloc( 1, sizeof(*p_va) );&lt;BR /&gt;++    if( !p_va )&lt;BR /&gt;++        return NULL;&lt;BR /&gt;++&lt;BR /&gt;++    if( VaOpen( p_va, i_codec_id ) )&lt;BR /&gt;++    {&lt;BR /&gt;++        free( p_va );&lt;BR /&gt;++        return NULL;&lt;BR /&gt;++    }&lt;BR /&gt;++    return p_va;&lt;BR /&gt;++}&lt;BR /&gt;++void VaDelete( vlc_va_t *p_va )&lt;BR /&gt;++{&lt;BR /&gt;++    VaClose( p_va );&lt;BR /&gt;++    free( p_va );&lt;BR /&gt;++}&lt;BR /&gt;++int VaSetup( vlc_va_t *p_va, void **pp_hw_ctx, vlc_fourcc_t *pi_chroma,&lt;BR /&gt;++             int i_width, int i_height )&lt;BR /&gt;++{&lt;BR /&gt;++    if( p_va-&amp;gt;i_surface_width == i_width &amp;amp;&amp;amp;&lt;BR /&gt;++        p_va-&amp;gt;i_surface_height == i_height )&lt;BR /&gt;++        return VLC_SUCCESS;&lt;BR /&gt;++&lt;BR /&gt;++    *pp_hw_ctx = NULL;&lt;BR /&gt;++    *pi_chroma = 0;&lt;BR /&gt;++    if( p_va-&amp;gt;i_surface_width || p_va-&amp;gt;i_surface_height )&lt;BR /&gt;++        VaDestroySurfaces( p_va );&lt;BR /&gt;++&lt;BR /&gt;++    if( i_width &amp;gt; 0 &amp;amp;&amp;amp; i_height &amp;gt; 0 )&lt;BR /&gt;++        return VaCreateSurfaces( p_va, pp_hw_ctx, pi_chroma, i_width,  &lt;BR /&gt;i_height );&lt;BR /&gt;++&lt;BR /&gt;++    return VLC_EGENERIC;&lt;BR /&gt;++}&lt;BR /&gt;++void VaVersion( vlc_va_t *p_va, char *psz_version, size_t i_version )&lt;BR /&gt;++{&lt;BR /&gt;++    snprintf( psz_version, i_version, "%d.%d", p_va-&amp;gt;i_version_major,  &lt;BR /&gt;p_va-&amp;gt;i_version_minor );&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++static int VaOpen( vlc_va_t *p_va, int i_codec_id )&lt;BR /&gt;++{&lt;BR /&gt;++    VAProfile i_profile;&lt;BR /&gt;++    int i_surface_count;&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    switch( i_codec_id )&lt;BR /&gt;++    {&lt;BR /&gt;++    case CODEC_ID_MPEG1VIDEO:&lt;BR /&gt;++    case CODEC_ID_MPEG2VIDEO:&lt;BR /&gt;++        i_profile = VAProfileMPEG2Main;&lt;BR /&gt;++        i_surface_count = 2+1;&lt;BR /&gt;++        break;&lt;BR /&gt;++    case CODEC_ID_MPEG4:&lt;BR /&gt;++        i_profile = VAProfileMPEG4AdvancedSimple;&lt;BR /&gt;++        i_surface_count = 2+1;&lt;BR /&gt;++        break;&lt;BR /&gt;++    case CODEC_ID_WMV3:&lt;BR /&gt;++        i_profile = VAProfileVC1Main;&lt;BR /&gt;++        i_surface_count = 2+1;&lt;BR /&gt;++        break;&lt;BR /&gt;++    case CODEC_ID_VC1:&lt;BR /&gt;++        i_profile = VAProfileVC1Advanced;&lt;BR /&gt;++        i_surface_count = 2+1;&lt;BR /&gt;++        break;&lt;BR /&gt;++    case CODEC_ID_H264:&lt;BR /&gt;++        i_profile = VAProfileH264High;&lt;BR /&gt;++        i_surface_count = 16+1;&lt;BR /&gt;++        break;&lt;BR /&gt;++    default:&lt;BR /&gt;++        return VLC_EGENERIC;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    memset( p_va, 0, sizeof(*p_va) );&lt;BR /&gt;++&lt;BR /&gt;++    /* Create a VA display */&lt;BR /&gt;++    p_va-&amp;gt;p_display_x11 = XOpenDisplay(NULL);&lt;BR /&gt;++    if( !p_va-&amp;gt;p_display_x11 )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++&lt;BR /&gt;++    p_va-&amp;gt;p_display = vaGetDisplay( p_va-&amp;gt;p_display_x11 );&lt;BR /&gt;++    if( !p_va-&amp;gt;p_display )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++&lt;BR /&gt;++    if( vaInitialize( p_va-&amp;gt;p_display, &amp;amp;p_va-&amp;gt;i_version_major,  &lt;BR /&gt;&amp;amp;p_va-&amp;gt;i_version_minor ) )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++&lt;BR /&gt;++    /* Create a VA configuration */&lt;BR /&gt;++    VAConfigAttrib attrib;&lt;BR /&gt;++    memset( &amp;amp;attrib, 0, sizeof(attrib) );&lt;BR /&gt;++    attrib.type = VAConfigAttribRTFormat;&lt;BR /&gt;++    if( vaGetConfigAttributes( p_va-&amp;gt;p_display,&lt;BR /&gt;++                               i_profile, VAEntrypointVLD, &amp;amp;attrib, 1 ) )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++&lt;BR /&gt;++    /* Not sure what to do if not, I don't have a way to test */&lt;BR /&gt;++    if( (attrib.value &amp;amp; VA_RT_FORMAT_YUV420) == 0 )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    if( vaCreateConfig( p_va-&amp;gt;p_display,&lt;BR /&gt;++                        i_profile, VAEntrypointVLD, &amp;amp;attrib, 1,  &lt;BR /&gt;&amp;amp;p_va-&amp;gt;i_config_id ) )&lt;BR /&gt;++    {&lt;BR /&gt;++        p_va-&amp;gt;i_config_id = 0;&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    p_va-&amp;gt;i_surface_count = i_surface_count;&lt;BR /&gt;++&lt;BR /&gt;++    return VLC_SUCCESS;&lt;BR /&gt;++&lt;BR /&gt;++error:&lt;BR /&gt;++    return VLC_EGENERIC;&lt;BR /&gt;++}&lt;BR /&gt;++static void VaClose( vlc_va_t *p_va )&lt;BR /&gt;++{&lt;BR /&gt;++    if( p_va-&amp;gt;i_surface_width || p_va-&amp;gt;i_surface_height )&lt;BR /&gt;++        VaDestroySurfaces( p_va );&lt;BR /&gt;++&lt;BR /&gt;++    if( p_va-&amp;gt;i_config_id )&lt;BR /&gt;++        vaDestroyConfig( p_va-&amp;gt;p_display, p_va-&amp;gt;i_config_id );&lt;BR /&gt;++    if( p_va-&amp;gt;p_display )&lt;BR /&gt;++        vaTerminate( p_va-&amp;gt;p_display );&lt;BR /&gt;++    if( p_va-&amp;gt;p_display_x11 )&lt;BR /&gt;++        XCloseDisplay( p_va-&amp;gt;p_display_x11 );&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++static int VaCreateSurfaces( vlc_va_t *p_va, void **pp_hw_ctx,  &lt;BR /&gt;vlc_fourcc_t *pi_chroma,&lt;BR /&gt;++                             int i_width, int i_height )&lt;BR /&gt;++{&lt;BR /&gt;++    assert( i_width &amp;gt; 0 &amp;amp;&amp;amp; i_height &amp;gt; 0 );&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    p_va-&amp;gt;p_surface = calloc( p_va-&amp;gt;i_surface_count,  &lt;BR /&gt;sizeof(*p_va-&amp;gt;p_surface) );&lt;BR /&gt;++    if( !p_va-&amp;gt;p_surface )&lt;BR /&gt;++        return VLC_EGENERIC;&lt;BR /&gt;++&lt;BR /&gt;++    /* Create surfaces */&lt;BR /&gt;++    VASurfaceID pi_surface_id[p_va-&amp;gt;i_surface_count];&lt;BR /&gt;++    if( vaCreateSurfaces( p_va-&amp;gt;p_display, i_width, i_height,  &lt;BR /&gt;VA_RT_FORMAT_YUV420,&lt;BR /&gt;++                          p_va-&amp;gt;i_surface_count, pi_surface_id ) )&lt;BR /&gt;++    {&lt;BR /&gt;++        for( int i = 0; i &amp;lt; p_va-&amp;gt;i_surface_count; i++ )&lt;BR /&gt;++            p_va-&amp;gt;p_surface&lt;I&gt;.i_id = VA_INVALID_SURFACE;&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    for( int i = 0; i &amp;lt; p_va-&amp;gt;i_surface_count; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        vlc_va_surface_t *p_surface = &amp;amp;p_va-&amp;gt;p_surface&lt;I&gt;;&lt;BR /&gt;++&lt;BR /&gt;++        p_surface-&amp;gt;i_id = pi_surface_id&lt;I&gt;;&lt;BR /&gt;++        p_surface-&amp;gt;i_refcount = 0;&lt;BR /&gt;++        p_surface-&amp;gt;i_order = 0;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    /* Create a context */&lt;BR /&gt;++    if( vaCreateContext( p_va-&amp;gt;p_display, p_va-&amp;gt;i_config_id,&lt;BR /&gt;++                         i_width, i_height, VA_PROGRESSIVE,&lt;BR /&gt;++                         pi_surface_id, p_va-&amp;gt;i_surface_count,  &lt;BR /&gt;&amp;amp;p_va-&amp;gt;i_context_id ) )&lt;BR /&gt;++    {&lt;BR /&gt;++        p_va-&amp;gt;i_context_id = 0;&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    /* Find a supported image chroma */&lt;BR /&gt;++    int i_fmt_count = vaMaxNumImageFormats( p_va-&amp;gt;p_display );&lt;BR /&gt;++    VAImageFormat *p_fmt = calloc( i_fmt_count, sizeof(*p_fmt) );&lt;BR /&gt;++    if( !p_fmt )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++&lt;BR /&gt;++    if( vaQueryImageFormats( p_va-&amp;gt;p_display, p_fmt, &amp;amp;i_fmt_count ) )&lt;BR /&gt;++    {&lt;BR /&gt;++        free( p_fmt );&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    vlc_fourcc_t  i_chroma = 0;&lt;BR /&gt;++    VAImageFormat fmt;&lt;BR /&gt;++    for( int i = 0; i &amp;lt; i_fmt_count; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        if( p_fmt&lt;I&gt;.fourcc == VA_FOURCC( 'Y', 'V', '1', '2' ) ||&lt;BR /&gt;++            p_fmt&lt;I&gt;.fourcc == VA_FOURCC( 'I', '4', '2', '0' ) )&lt;BR /&gt;++        {&lt;BR /&gt;++            i_chroma = VLC_FOURCC( 'I', '4', '2', '0' );&lt;BR /&gt;++            fmt = p_fmt&lt;I&gt;;&lt;BR /&gt;++        }&lt;BR /&gt;++        /* TODO: It seems that these may also be available (but not&lt;BR /&gt;++         * with my setup):&lt;BR /&gt;++         * VA_FOURCC( 'N', 'V', '1', '2')&lt;BR /&gt;++         * VA_FOURCC( 'U', 'Y', 'V', 'Y')&lt;BR /&gt;++         * VA_FOURCC( 'Y', 'U', 'Y', 'V')&lt;BR /&gt;++         */&lt;BR /&gt;++    }&lt;BR /&gt;++    free( p_fmt );&lt;BR /&gt;++    if( !i_chroma )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    *pi_chroma = i_chroma;&lt;BR /&gt;++&lt;BR /&gt;++    /* Create an image for surface extraction */&lt;BR /&gt;++    if( vaCreateImage(  p_va-&amp;gt;p_display, &amp;amp;fmt, i_width, i_height,  &lt;BR /&gt;&amp;amp;p_va-&amp;gt;image ) )&lt;BR /&gt;++    {&lt;BR /&gt;++        p_va-&amp;gt;image.image_id = 0;&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    /* Setup the ffmpeg hardware context */&lt;BR /&gt;++    *pp_hw_ctx = &amp;amp;p_va-&amp;gt;hw_ctx;&lt;BR /&gt;++&lt;BR /&gt;++    memset( &amp;amp;p_va-&amp;gt;hw_ctx, 0, sizeof(p_va-&amp;gt;hw_ctx) );&lt;BR /&gt;++    p_va-&amp;gt;hw_ctx.display    = p_va-&amp;gt;p_display;&lt;BR /&gt;++    p_va-&amp;gt;hw_ctx.config_id  = p_va-&amp;gt;i_config_id;&lt;BR /&gt;++    p_va-&amp;gt;hw_ctx.context_id = p_va-&amp;gt;i_context_id;&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    p_va-&amp;gt;i_surface_chroma = i_chroma;&lt;BR /&gt;++    p_va-&amp;gt;i_surface_width = i_width;&lt;BR /&gt;++    p_va-&amp;gt;i_surface_height = i_height;&lt;BR /&gt;++    return VLC_SUCCESS;&lt;BR /&gt;++&lt;BR /&gt;++error:&lt;BR /&gt;++    VaDestroySurfaces( p_va );&lt;BR /&gt;++    return VLC_EGENERIC;&lt;BR /&gt;++}&lt;BR /&gt;++static void VaDestroySurfaces( vlc_va_t *p_va )&lt;BR /&gt;++{&lt;BR /&gt;++    if( p_va-&amp;gt;image.image_id )&lt;BR /&gt;++        vaDestroyImage( p_va-&amp;gt;p_display, p_va-&amp;gt;image.image_id );&lt;BR /&gt;++&lt;BR /&gt;++    if( p_va-&amp;gt;i_context_id )&lt;BR /&gt;++        vaDestroyContext( p_va-&amp;gt;p_display, p_va-&amp;gt;i_context_id );&lt;BR /&gt;++&lt;BR /&gt;++    for( int i = 0; i &amp;lt; p_va-&amp;gt;i_surface_count &amp;amp;&amp;amp; p_va-&amp;gt;p_surface; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        vlc_va_surface_t *p_surface = &amp;amp;p_va-&amp;gt;p_surface&lt;I&gt;;&lt;BR /&gt;++&lt;BR /&gt;++        if( p_surface-&amp;gt;i_id != VA_INVALID_SURFACE )&lt;BR /&gt;++            vaDestroySurfaces( p_va-&amp;gt;p_display, &amp;amp;p_surface-&amp;gt;i_id, 1 );&lt;BR /&gt;++    }&lt;BR /&gt;++    free( p_va-&amp;gt;p_surface );&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    p_va-&amp;gt;image.image_id = 0;&lt;BR /&gt;++    p_va-&amp;gt;i_context_id = 0;&lt;BR /&gt;++    p_va-&amp;gt;p_surface = NULL;&lt;BR /&gt;++    p_va-&amp;gt;i_surface_width = 0;&lt;BR /&gt;++    p_va-&amp;gt;i_surface_height = 0;&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++int VaExtract( vlc_va_t *p_va, picture_t *p_picture, AVFrame *p_ff )&lt;BR /&gt;++{&lt;BR /&gt;++    VASurfaceID i_surface_id = (VASurfaceID)(uintptr_t)p_ff-&amp;gt;data[3];&lt;BR /&gt;++&lt;BR /&gt;++    if( vaSyncSurface( p_va-&amp;gt;p_display, p_va-&amp;gt;i_context_id, i_surface_id  &lt;BR /&gt;) )&lt;BR /&gt;++        return VLC_EGENERIC;&lt;BR /&gt;++&lt;BR /&gt;++    /* XXX vaDeriveImage may be better but it is not supported by&lt;BR /&gt;++     * my setup.&lt;BR /&gt;++     */&lt;BR /&gt;++&lt;BR /&gt;++    if( vaGetImage( p_va-&amp;gt;p_display, i_surface_id,&lt;BR /&gt;++                    0, 0, p_va-&amp;gt;i_surface_width, p_va-&amp;gt;i_surface_height,&lt;BR /&gt;++                    p_va-&amp;gt;image.image_id) )&lt;BR /&gt;++        return VLC_EGENERIC;&lt;BR /&gt;++&lt;BR /&gt;++    void *p_base;&lt;BR /&gt;++    if( vaMapBuffer( p_va-&amp;gt;p_display, p_va-&amp;gt;image.buf, &amp;amp;p_base ) )&lt;BR /&gt;++        return VLC_EGENERIC;&lt;BR /&gt;++&lt;BR /&gt;++    for( int i_plane = 0; i_plane &amp;lt; p_picture-&amp;gt;i_planes; i_plane++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        const int i_src_plane = ((p_va-&amp;gt;image.format.fourcc ==  &lt;BR /&gt;VA_FOURCC('Y','V','1','2' )) &amp;amp;&amp;amp; i_plane != 0) ?  (3 - i_plane) : i_plane;&lt;BR /&gt;++        const uint8_t *p_src = (uint8_t*)p_base +  &lt;BR /&gt;p_va-&amp;gt;image.offsets[i_src_plane];&lt;BR /&gt;++        const int i_src_stride = p_va-&amp;gt;image.pitches[i_src_plane];&lt;BR /&gt;++&lt;BR /&gt;++        uint8_t *p_dst = p_picture-&amp;gt;p[i_plane].p_pixels;&lt;BR /&gt;++        const int i_dst_stride = p_picture-&amp;gt;p[i_plane].i_pitch;&lt;BR /&gt;++&lt;BR /&gt;++        if( i_src_stride != i_dst_stride )&lt;BR /&gt;++        {&lt;BR /&gt;++            for( int i = 0; i &amp;lt; p_picture-&amp;gt;p[i_plane].i_visible_lines;  &lt;BR /&gt;i++ )&lt;BR /&gt;++            {&lt;BR /&gt;++                vlc_memcpy( p_dst, p_src, __MIN( i_src_stride,  &lt;BR /&gt;i_dst_stride ) );&lt;BR /&gt;++                p_src += i_src_stride;&lt;BR /&gt;++                p_dst += i_dst_stride;&lt;BR /&gt;++            }&lt;BR /&gt;++        }&lt;BR /&gt;++        else&lt;BR /&gt;++        {&lt;BR /&gt;++            vlc_memcpy( p_dst, p_src,  &lt;BR /&gt;p_picture-&amp;gt;p[i_plane].i_visible_lines * i_src_stride );&lt;BR /&gt;++        }&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    if( vaUnmapBuffer( p_va-&amp;gt;p_display, p_va-&amp;gt;image.buf ) )&lt;BR /&gt;++        return VLC_EGENERIC;&lt;BR /&gt;++&lt;BR /&gt;++    return VLC_SUCCESS;&lt;BR /&gt;++}&lt;BR /&gt;++int VaGrabSurface( vlc_va_t *p_va, AVFrame *p_ff )&lt;BR /&gt;++{&lt;BR /&gt;++    int i_old;&lt;BR /&gt;++    int i;&lt;BR /&gt;++&lt;BR /&gt;++    /* Grab an unused surface, in case none are, try the oldest&lt;BR /&gt;++     * XXX using the oldest is a workaround in case a problem happens  &lt;BR /&gt;with ffmpeg */&lt;BR /&gt;++    for( i = 0, i_old = 0; i &amp;lt; p_va-&amp;gt;i_surface_count; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        vlc_va_surface_t *p_surface = &amp;amp;p_va-&amp;gt;p_surface&lt;I&gt;;&lt;BR /&gt;++&lt;BR /&gt;++        if( !p_surface-&amp;gt;i_refcount )&lt;BR /&gt;++            break;&lt;BR /&gt;++&lt;BR /&gt;++        if( p_surface-&amp;gt;i_order &amp;lt; p_va-&amp;gt;p_surface[i_old].i_order )&lt;BR /&gt;++            i_old = i;&lt;BR /&gt;++    }&lt;BR /&gt;++    if( i &amp;gt;= p_va-&amp;gt;i_surface_count )&lt;BR /&gt;++        i = i_old;&lt;BR /&gt;++&lt;BR /&gt;++    vlc_va_surface_t *p_surface = &amp;amp;p_va-&amp;gt;p_surface&lt;I&gt;;&lt;BR /&gt;++&lt;BR /&gt;++    p_surface-&amp;gt;i_refcount = 1;&lt;BR /&gt;++    p_surface-&amp;gt;i_order = p_va-&amp;gt;i_surface_order++;&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    for( int i = 0; i &amp;lt; 4; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        p_ff-&amp;gt;data&lt;I&gt; = NULL;&lt;BR /&gt;++        p_ff-&amp;gt;linesize&lt;I&gt; = 0;&lt;BR /&gt;++&lt;BR /&gt;++        if( i == 0 || i == 3 )&lt;BR /&gt;++            p_ff-&amp;gt;data&lt;I&gt; = (void*)(uintptr_t)p_surface-&amp;gt;i_id;/* Yummie */&lt;BR /&gt;++    }&lt;BR /&gt;++    return VLC_SUCCESS;&lt;BR /&gt;++}&lt;BR /&gt;++void VaUngrabSurface( vlc_va_t *p_va, AVFrame *p_ff )&lt;BR /&gt;++{&lt;BR /&gt;++    VASurfaceID i_surface_id = (VASurfaceID)(uintptr_t)p_ff-&amp;gt;data[3];&lt;BR /&gt;++&lt;BR /&gt;++    for( int i = 0; i &amp;lt; p_va-&amp;gt;i_surface_count; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        vlc_va_surface_t *p_surface = &amp;amp;p_va-&amp;gt;p_surface&lt;I&gt;;&lt;BR /&gt;++&lt;BR /&gt;++        if( p_surface-&amp;gt;i_id == i_surface_id )&lt;BR /&gt;++            p_surface-&amp;gt;i_refcount--;&lt;BR /&gt;++    }&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++#else&lt;BR /&gt;++&lt;BR /&gt;++vlc_va_t *VaNew( int i_codec_id )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(i_codec_id);&lt;BR /&gt;++    return NULL;&lt;BR /&gt;++}&lt;BR /&gt;++void VaDelete( vlc_va_t *p_va )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(p_va);&lt;BR /&gt;++    assert( 0 );&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++void VaVersion( vlc_va_t *p_va, char *psz_version, size_t i_version )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(p_va); VLC_UNUSED(psz_version); VLC_UNUSED(i_version);&lt;BR /&gt;++    assert(0);&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++int VaSetup( vlc_va_t *p_va, void **pp_hw_ctx, vlc_fourcc_t *pi_chroma,&lt;BR /&gt;++             int i_width, int i_height )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(p_va); VLC_UNUSED(pp_hw_ctx); VLC_UNUSED(pi_chroma);&lt;BR /&gt;++    VLC_UNUSED(i_width); VLC_UNUSED(i_height);&lt;BR /&gt;++    assert(0);&lt;BR /&gt;++    return -1;&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++int VaExtract( vlc_va_t *p_va, picture_t *p_picture, AVFrame *p_ff )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(p_va); VLC_UNUSED(p_picture); VLC_UNUSED(p_ff);&lt;BR /&gt;++    assert(0);&lt;BR /&gt;++    return -1;&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++int VaGrabSurface( vlc_va_t *p_va, AVFrame *p_ff )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(p_va); VLC_UNUSED(p_ff);&lt;BR /&gt;++    assert(0);&lt;BR /&gt;++    return -1;&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++void VaUngrabSurface( vlc_va_t *p_va, AVFrame *p_ff )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(p_va); VLC_UNUSED(p_ff);&lt;BR /&gt;++    assert(0);&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++#endif&lt;BR /&gt;+diff -Naur vlc-1.0.0-rc4-old/modules/codec/avcodec/vaapi.h  &lt;BR /&gt;vlc-1.0.0-rc4-new/modules/codec/avcodec/vaapi.h&lt;BR /&gt;+--- vlc-1.0.0-rc4-old/modules/codec/avcodec/vaapi.h    1969-12-31  &lt;BR /&gt;16:00:00.000000000 -0800&lt;BR /&gt;++++ vlc-1.0.0-rc4-new/modules/codec/avcodec/vaapi.h    2009-06-19  &lt;BR /&gt;16:31:52.000000000 -0700&lt;BR /&gt;+@@ -0,0 +1,43 @@&lt;BR /&gt;++/*****************************************************************************&lt;BR /&gt;++ * vaapi.h: VAAPI helpers for the ffmpeg decoder&lt;BR /&gt;++  &lt;BR /&gt;*****************************************************************************&lt;BR /&gt;++ * Copyright (C) 2009 Laurent Aimar&lt;BR /&gt;++ * $Id$&lt;BR /&gt;++ *&lt;BR /&gt;++ * Authors: Laurent Aimar &lt;FENRIR_AT_ videolan="" _dot_="" org=""&gt;&lt;BR /&gt;++ *&lt;BR /&gt;++ * This program is free software; you can redistribute it and/or modify&lt;BR /&gt;++ * it under the terms of the GNU General Public License as published by&lt;BR /&gt;++ * the Free Software Foundation; either version 2 of the License, or&lt;BR /&gt;++ * (at your option) any later version.&lt;BR /&gt;++ *&lt;BR /&gt;++ * This program is distributed in the hope that it will be useful,&lt;BR /&gt;++ * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;BR /&gt;++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;BR /&gt;++ * GNU General Public License for more details.&lt;BR /&gt;++ *&lt;BR /&gt;++ * You should have received a copy of the GNU General Public License&lt;BR /&gt;++ * along with this program; if not, write to the Free Software&lt;BR /&gt;++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  &lt;BR /&gt;02110-1301, USA.&lt;BR /&gt;++  &lt;BR /&gt;*****************************************************************************/&lt;BR /&gt;++&lt;BR /&gt;++#ifndef _VLC_VAAPI_H&lt;BR /&gt;++#define _VLC_VAAPI_H 1&lt;BR /&gt;++&lt;BR /&gt;++typedef struct vlc_va_t vlc_va_t;&lt;BR /&gt;++&lt;BR /&gt;++vlc_va_t *VaNew( int i_codec_id );&lt;BR /&gt;++void VaDelete( vlc_va_t *p_va );&lt;BR /&gt;++&lt;BR /&gt;++void VaVersion( vlc_va_t *p_va, char *psz_version, size_t i_version );&lt;BR /&gt;++&lt;BR /&gt;++int VaSetup( vlc_va_t *p_va, void **pp_hw_ctx, vlc_fourcc_t *pi_chroma,&lt;BR /&gt;++             int i_width, int i_height );&lt;BR /&gt;++&lt;BR /&gt;++int VaExtract( vlc_va_t *p_va, picture_t *p_picture, AVFrame *p_ff );&lt;BR /&gt;++&lt;BR /&gt;++int VaGrabSurface( vlc_va_t *p_va, AVFrame *p_ff );&lt;BR /&gt;++&lt;BR /&gt;++void VaUngrabSurface( vlc_va_t *p_va, AVFrame *p_ff );&lt;BR /&gt;++&lt;BR /&gt;++#endif&lt;BR /&gt;+diff -Naur vlc-1.0.0-rc4-old/modules/codec/avcodec/video.c  &lt;BR /&gt;vlc-1.0.0-rc4-new/modules/codec/avcodec/video.c&lt;BR /&gt;+--- vlc-1.0.0-rc4-old/modules/codec/avcodec/video.c    2009-06-14  &lt;BR /&gt;11:14:59.000000000 -0700&lt;BR /&gt;++++ vlc-1.0.0-rc4-new/modules/codec/avcodec/video.c    2009-06-19  &lt;BR /&gt;16:36:25.000000000 -0700&lt;BR /&gt;+@@ -34,10 +34,14 @@&lt;BR /&gt;+ #include &lt;VLC_VOUT.H&gt;&lt;BR /&gt;+ #include &lt;VLC_CODECS.H&gt;                               /* BITMAPINFOHEADER  &lt;BR /&gt;*/&lt;BR /&gt;+ #include &lt;VLC_AVCODEC.H&gt;&lt;BR /&gt;++#include &lt;ASSERT.H&gt;&lt;BR /&gt;+&lt;BR /&gt;+ /* ffmpeg header */&lt;BR /&gt;+ #ifdef HAVE_LIBAVCODEC_AVCODEC_H&lt;BR /&gt;+ #   include &lt;LIBAVCODEC&gt;&lt;BR /&gt;++#   ifdef HAVE_AVCODEC_VAAPI&lt;BR /&gt;++#       include &lt;LIBAVCODEC&gt;&lt;BR /&gt;++#   endif&lt;BR /&gt;+ #elif defined(HAVE_FFMPEG_AVCODEC_H)&lt;BR /&gt;+ #   include &lt;FFMPEG&gt;&lt;BR /&gt;+ #else&lt;BR /&gt;+@@ -45,6 +49,7 @@&lt;BR /&gt;+ #endif&lt;BR /&gt;+&lt;BR /&gt;+ #include "avcodec.h"&lt;BR /&gt;++#include "vaapi.h"&lt;BR /&gt;+&lt;BR /&gt;+  &lt;BR /&gt;/*****************************************************************************&lt;BR /&gt;+  * decoder_sys_t : decoder descriptor&lt;BR /&gt;+@@ -85,6 +90,9 @@&lt;BR /&gt;+&lt;BR /&gt;+     /* */&lt;BR /&gt;+     bool b_flush;&lt;BR /&gt;++&lt;BR /&gt;++    /* VA API */&lt;BR /&gt;++    vlc_va_t *p_va;&lt;BR /&gt;+ };&lt;BR /&gt;+&lt;BR /&gt;+ /* FIXME (dummy palette for now) */&lt;BR /&gt;+@@ -101,6 +109,10 @@&lt;BR /&gt;+ static void ffmpeg_ReleaseFrameBuf( struct AVCodecContext *, AVFrame * );&lt;BR /&gt;+ static void ffmpeg_NextPts( decoder_t * );&lt;BR /&gt;+&lt;BR /&gt;++static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *,&lt;BR /&gt;++                                          const enum PixelFormat * );&lt;BR /&gt;++&lt;BR /&gt;++&lt;BR /&gt;+ static uint32_t ffmpeg_CodecTag( vlc_fourcc_t fcc )&lt;BR /&gt;+ {&lt;BR /&gt;+     uint8_t *p = (uint8_t*)&amp;amp;fcc;&lt;BR /&gt;+@@ -115,7 +127,7 @@&lt;BR /&gt;+ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,&lt;BR /&gt;+                                             AVCodecContext *p_context )&lt;BR /&gt;+ {&lt;BR /&gt;+-    picture_t *p_pic;&lt;BR /&gt;++    decoder_sys_t *p_sys = p_dec-&amp;gt;p_sys;&lt;BR /&gt;+&lt;BR /&gt;+     p_dec-&amp;gt;fmt_out.video.i_width = p_context-&amp;gt;width;&lt;BR /&gt;+     p_dec-&amp;gt;fmt_out.video.i_height = p_context-&amp;gt;height;&lt;BR /&gt;+@@ -125,10 +137,12 @@&lt;BR /&gt;+         return NULL; /* invalid display size */&lt;BR /&gt;+     }&lt;BR /&gt;+&lt;BR /&gt;+-    if( GetVlcChroma( &amp;amp;p_dec-&amp;gt;fmt_out.video, p_context-&amp;gt;pix_fmt ) !=  &lt;BR /&gt;VLC_SUCCESS )&lt;BR /&gt;++    if( !p_sys-&amp;gt;p_va &amp;amp;&amp;amp; GetVlcChroma( &amp;amp;p_dec-&amp;gt;fmt_out.video,  &lt;BR /&gt;p_context-&amp;gt;pix_fmt ) )&lt;BR /&gt;+     {&lt;BR /&gt;+-        /* we are doomed, but not really, because most codecs set their  &lt;BR /&gt;pix_fmt much later */&lt;BR /&gt;+-        p_dec-&amp;gt;fmt_out.i_codec = VLC_FOURCC('I','4','2','0');&lt;BR /&gt;++        /* we are doomed, but not really, because most codecs set their  &lt;BR /&gt;pix_fmt&lt;BR /&gt;++         * much later&lt;BR /&gt;++         * FIXME does it make sense here ? */&lt;BR /&gt;++        p_dec-&amp;gt;fmt_out.video.i_chroma = VLC_FOURCC('I','4','2','0');&lt;BR /&gt;+     }&lt;BR /&gt;+     p_dec-&amp;gt;fmt_out.i_codec = p_dec-&amp;gt;fmt_out.video.i_chroma;&lt;BR /&gt;+&lt;BR /&gt;+@@ -166,9 +180,7 @@&lt;BR /&gt;+         p_dec-&amp;gt;fmt_out.video.i_frame_rate_base = p_context-&amp;gt;time_base.num;&lt;BR /&gt;+     }&lt;BR /&gt;+&lt;BR /&gt;+-    p_pic = decoder_NewPicture( p_dec );&lt;BR /&gt;+-&lt;BR /&gt;+-    return p_pic;&lt;BR /&gt;++    return decoder_NewPicture( p_dec );&lt;BR /&gt;+ }&lt;BR /&gt;+&lt;BR /&gt;+  &lt;BR /&gt;/*****************************************************************************&lt;BR /&gt;+@@ -193,6 +205,7 @@&lt;BR /&gt;+     p_sys-&amp;gt;psz_namecodec = psz_namecodec;&lt;BR /&gt;+     p_sys-&amp;gt;p_ff_pic = avcodec_alloc_frame();&lt;BR /&gt;+     p_sys-&amp;gt;b_delayed_open = true;&lt;BR /&gt;++    p_sys-&amp;gt;p_va = NULL;&lt;BR /&gt;+&lt;BR /&gt;+     /* ***** Fill p_context with init values ***** */&lt;BR /&gt;+     p_sys-&amp;gt;p_context-&amp;gt;codec_tag = ffmpeg_CodecTag( p_dec-&amp;gt;fmt_in.i_codec  &lt;BR /&gt;);&lt;BR /&gt;+@@ -319,6 +332,9 @@&lt;BR /&gt;+     p_sys-&amp;gt;p_context-&amp;gt;release_buffer = ffmpeg_ReleaseFrameBuf;&lt;BR /&gt;+     p_sys-&amp;gt;p_context-&amp;gt;opaque = p_dec;&lt;BR /&gt;+&lt;BR /&gt;++    if( var_CreateGetBool( p_dec, "ffmpeg-hw" ) )&lt;BR /&gt;++        p_sys-&amp;gt;p_context-&amp;gt;get_format = ffmpeg_GetFormat;&lt;BR /&gt;++&lt;BR /&gt;+     /* ***** misc init ***** */&lt;BR /&gt;+     p_sys-&amp;gt;input_pts = p_sys-&amp;gt;input_dts = 0;&lt;BR /&gt;+     p_sys-&amp;gt;i_pts = 0;&lt;BR /&gt;+@@ -621,7 +637,7 @@&lt;BR /&gt;+             p_sys-&amp;gt;i_late_frames = 0;&lt;BR /&gt;+         }&lt;BR /&gt;+&lt;BR /&gt;+-        if( !b_drawpicture || !p_sys-&amp;gt;p_ff_pic-&amp;gt;linesize[0] )&lt;BR /&gt;++        if( !b_drawpicture || ( !p_sys-&amp;gt;p_va  &lt;BR /&gt;&amp;amp;&amp;amp; !p_sys-&amp;gt;p_ff_pic-&amp;gt;linesize[0] ) )&lt;BR /&gt;+         {&lt;BR /&gt;+             /* Do not display the picture */&lt;BR /&gt;+             p_pic = (picture_t *)p_sys-&amp;gt;p_ff_pic-&amp;gt;opaque;&lt;BR /&gt;+@@ -736,6 +752,9 @@&lt;BR /&gt;+&lt;BR /&gt;+     if( p_sys-&amp;gt;p_ff_pic ) av_free( p_sys-&amp;gt;p_ff_pic );&lt;BR /&gt;+     free( p_sys-&amp;gt;p_buffer_orig );&lt;BR /&gt;++&lt;BR /&gt;++    if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++        VaDelete( p_sys-&amp;gt;p_va );&lt;BR /&gt;+ }&lt;BR /&gt;+&lt;BR /&gt;+  &lt;BR /&gt;/*****************************************************************************&lt;BR /&gt;+@@ -838,6 +857,14 @@&lt;BR /&gt;+&lt;BR /&gt;+     p_sys-&amp;gt;b_delayed_open = false;&lt;BR /&gt;+&lt;BR /&gt;++    if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++    {&lt;BR /&gt;++        char psz_version[128];&lt;BR /&gt;++&lt;BR /&gt;++        VaVersion( p_sys-&amp;gt;p_va, psz_version, sizeof(psz_version) );&lt;BR /&gt;++        msg_Info( p_dec, "Using VA API version %s for hardware  &lt;BR /&gt;decoding.", psz_version );&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;+     return VLC_SUCCESS;&lt;BR /&gt;+ }&lt;BR /&gt;+  &lt;BR /&gt;/*****************************************************************************&lt;BR /&gt;+@@ -849,7 +876,11 @@&lt;BR /&gt;+ {&lt;BR /&gt;+     decoder_sys_t *p_sys = p_dec-&amp;gt;p_sys;&lt;BR /&gt;+&lt;BR /&gt;+-    if( TestFfmpegChroma( p_sys-&amp;gt;p_context-&amp;gt;pix_fmt, -1 ) == VLC_SUCCESS )&lt;BR /&gt;++    if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++    {&lt;BR /&gt;++        VaExtract( p_sys-&amp;gt;p_va, p_pic, p_ff_pic );&lt;BR /&gt;++    }&lt;BR /&gt;++    else if( TestFfmpegChroma( p_sys-&amp;gt;p_context-&amp;gt;pix_fmt, -1 ) ==  &lt;BR /&gt;VLC_SUCCESS )&lt;BR /&gt;+     {&lt;BR /&gt;+         int i_plane, i_size, i_line;&lt;BR /&gt;+         uint8_t *p_dst, *p_src;&lt;BR /&gt;+@@ -899,11 +930,33 @@&lt;BR /&gt;+     ffmpeg_SetFrameBufferPts( p_dec, p_ff_pic );&lt;BR /&gt;+&lt;BR /&gt;+     /* */&lt;BR /&gt;+-    p_ff_pic-&amp;gt;opaque = 0;&lt;BR /&gt;++    p_ff_pic-&amp;gt;opaque = NULL;&lt;BR /&gt;++&lt;BR /&gt;++    if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++    {&lt;BR /&gt;++        if( VaSetup( p_sys-&amp;gt;p_va,&lt;BR /&gt;++                     &amp;amp;p_sys-&amp;gt;p_context-&amp;gt;hwaccel_context,  &lt;BR /&gt;&amp;amp;p_dec-&amp;gt;fmt_out.video.i_chroma,&lt;BR /&gt;++                     p_sys-&amp;gt;p_context-&amp;gt;width, p_sys-&amp;gt;p_context-&amp;gt;height ) )&lt;BR /&gt;++        {&lt;BR /&gt;++            msg_Err( p_dec, "VaSetup failed" );&lt;BR /&gt;++            return -1;&lt;BR /&gt;++        }&lt;BR /&gt;++&lt;BR /&gt;++        /* */&lt;BR /&gt;++        p_ff_pic-&amp;gt;type = FF_BUFFER_TYPE_USER;&lt;BR /&gt;++        /* FIXME what is that, should give good value */&lt;BR /&gt;++        p_ff_pic-&amp;gt;age = 256*256*256*64; // FIXME FIXME from ffmpeg&lt;BR /&gt;+&lt;BR /&gt;+-    /* Not much to do in indirect rendering mode */&lt;BR /&gt;+-    if( !p_sys-&amp;gt;b_direct_rendering )&lt;BR /&gt;++        if( VaGrabSurface( p_sys-&amp;gt;p_va, p_ff_pic ) )&lt;BR /&gt;++        {&lt;BR /&gt;++            msg_Err( p_dec, "VaGrabSurface failed" );&lt;BR /&gt;++            return -1;&lt;BR /&gt;++        }&lt;BR /&gt;++        return 0;&lt;BR /&gt;++    }&lt;BR /&gt;++    else if( !p_sys-&amp;gt;b_direct_rendering )&lt;BR /&gt;+     {&lt;BR /&gt;++        /* Not much to do in indirect rendering mode */&lt;BR /&gt;+         return avcodec_default_get_buffer( p_context, p_ff_pic );&lt;BR /&gt;+     }&lt;BR /&gt;+&lt;BR /&gt;+@@ -1012,20 +1065,30 @@&lt;BR /&gt;+                                     AVFrame *p_ff_pic )&lt;BR /&gt;+ {&lt;BR /&gt;+     decoder_t *p_dec = (decoder_t *)p_context-&amp;gt;opaque;&lt;BR /&gt;++    decoder_sys_t *p_sys = p_dec-&amp;gt;p_sys;&lt;BR /&gt;++&lt;BR /&gt;++    if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++    {&lt;BR /&gt;++        VaUngrabSurface( p_sys-&amp;gt;p_va, p_ff_pic );&lt;BR /&gt;+&lt;BR /&gt;+-    if( !p_ff_pic-&amp;gt;opaque )&lt;BR /&gt;++        /* */&lt;BR /&gt;++        for( int i = 0; i &amp;lt; 4; i++ )&lt;BR /&gt;++            p_ff_pic-&amp;gt;data&lt;I&gt; = NULL;&lt;BR /&gt;++    }&lt;BR /&gt;++    else if( !p_ff_pic-&amp;gt;opaque )&lt;BR /&gt;+     {&lt;BR /&gt;+         avcodec_default_release_buffer( p_context, p_ff_pic );&lt;BR /&gt;+-        return;&lt;BR /&gt;+     }&lt;BR /&gt;++    else&lt;BR /&gt;++    {&lt;BR /&gt;++        picture_t *p_pic = (picture_t*)p_ff_pic-&amp;gt;opaque;&lt;BR /&gt;+&lt;BR /&gt;+-    picture_t *p_pic = (picture_t*)p_ff_pic-&amp;gt;opaque;&lt;BR /&gt;+-    decoder_UnlinkPicture( p_dec, p_pic );&lt;BR /&gt;++        decoder_UnlinkPicture( p_dec, p_pic );&lt;BR /&gt;+&lt;BR /&gt;+-    p_ff_pic-&amp;gt;data[0] = NULL;&lt;BR /&gt;+-    p_ff_pic-&amp;gt;data[1] = NULL;&lt;BR /&gt;+-    p_ff_pic-&amp;gt;data[2] = NULL;&lt;BR /&gt;+-    p_ff_pic-&amp;gt;data[3] = NULL;&lt;BR /&gt;++        /* */&lt;BR /&gt;++        for( int i = 0; i &amp;lt; 4; i++ )&lt;BR /&gt;++            p_ff_pic-&amp;gt;data&lt;I&gt; = NULL;&lt;BR /&gt;++    }&lt;BR /&gt;+ }&lt;BR /&gt;+&lt;BR /&gt;+ static void ffmpeg_NextPts( decoder_t *p_dec )&lt;BR /&gt;+@@ -1052,3 +1115,53 @@&lt;BR /&gt;+             (2 * p_sys-&amp;gt;p_context-&amp;gt;time_base.den);&lt;BR /&gt;+     }&lt;BR /&gt;+ }&lt;BR /&gt;++&lt;BR /&gt;++static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_codec,&lt;BR /&gt;++                                          const enum PixelFormat *pi_fmt )&lt;BR /&gt;++{&lt;BR /&gt;++    decoder_t *p_dec = p_codec-&amp;gt;opaque;&lt;BR /&gt;++    decoder_sys_t *p_sys = p_dec-&amp;gt;p_sys;&lt;BR /&gt;++&lt;BR /&gt;++    if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++    {&lt;BR /&gt;++        VaDelete( p_sys-&amp;gt;p_va );&lt;BR /&gt;++        p_sys-&amp;gt;p_va = NULL;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    /* Try too look for a supported hw acceleration */&lt;BR /&gt;++    for( int i = 0; pi_fmt&lt;I&gt; != PIX_FMT_NONE; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        static const char *ppsz_name[PIX_FMT_NB] = {&lt;BR /&gt;++            [PIX_FMT_VDPAU_H264] = "PIX_FMT_VDPAU_H264",&lt;BR /&gt;++            [PIX_FMT_VAAPI_IDCT] = "PIX_FMT_VAAPI_IDCT",&lt;BR /&gt;++            [PIX_FMT_VAAPI_VLD] = "PIX_FMT_VAAPI_VLD",&lt;BR /&gt;++            [PIX_FMT_VAAPI_MOCO] = "PIX_FMT_VAAPI_MOCO",&lt;BR /&gt;++            [PIX_FMT_YUYV422] = "PIX_FMT_YUYV422",&lt;BR /&gt;++            [PIX_FMT_YUV420P] = "PIX_FMT_YUV420P",&lt;BR /&gt;++        };&lt;BR /&gt;++        msg_Dbg( p_dec, "Available decoder output format %d (%s)",  &lt;BR /&gt;pi_fmt&lt;I&gt;, ppsz_name[pi_fmt&lt;I&gt;] ?: "Unknown" );&lt;BR /&gt;++&lt;BR /&gt;++        /* Only VLD supported */&lt;BR /&gt;++        if( pi_fmt&lt;I&gt; == PIX_FMT_VAAPI_VLD )&lt;BR /&gt;++        {&lt;BR /&gt;++            msg_Dbg( p_dec, "Trying VA API" );&lt;BR /&gt;++            p_sys-&amp;gt;p_va = VaNew( p_sys-&amp;gt;i_codec_id );&lt;BR /&gt;++            if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++            {&lt;BR /&gt;++                /* FIXME this will disabled direct rendering&lt;BR /&gt;++                 * even if a new pixel format is renegociated&lt;BR /&gt;++                 *&lt;BR /&gt;++                 * FIXME Try to call VaSetup when possible&lt;BR /&gt;++                 * to detect errors when possible (later is too late) */&lt;BR /&gt;++                p_sys-&amp;gt;b_direct_rendering = false;&lt;BR /&gt;++                p_sys-&amp;gt;p_context-&amp;gt;draw_horiz_band = NULL;&lt;BR /&gt;++                return pi_fmt&lt;I&gt;;&lt;BR /&gt;++            }&lt;BR /&gt;++            msg_Warn( p_dec, "Failed to open VA API" );&lt;BR /&gt;++        }&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    /* Fallback to default behaviour */&lt;BR /&gt;++    return avcodec_default_get_format( p_codec, pi_fmt );&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.blowdata4u.com" target="_blank"&gt;http://www.blowdata4u.com&lt;/A&gt;&lt;BR /&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/FFMPEG&gt;&lt;/LIBAVCODEC&gt;&lt;/LIBAVCODEC&gt;&lt;/ASSERT.H&gt;&lt;/VLC_AVCODEC.H&gt;&lt;/VLC_CODECS.H&gt;&lt;/VLC_VOUT.H&gt;&lt;/FENRIR_AT_&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/VA&gt;&lt;/X11&gt;&lt;/AVCODEC.H&gt;&lt;/FFMPEG&gt;&lt;/LIBAVCODEC&gt;&lt;/LIBAVCODEC&gt;&lt;/ASSERT.H&gt;&lt;/VLC_VOUT.H&gt;&lt;/VLC_COMMON.H&gt;&lt;/FENRIR_AT_&gt;&lt;/EM&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Dec 2009 05:06:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900483#M10995</guid>
      <dc:creator>Rajkumar</dc:creator>
      <dc:date>2009-12-22T05:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Mplayer performance with VAAPI support</title>
      <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900484#M10996</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/456057"&gt;raj.ece03&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/457933"&gt;blowdata4u&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Added:&lt;BR /&gt; &lt;BR /&gt;trunk/gar-minimyth/script/mediaplayers/vlc/files/vlc-1.0.0-rc4-vaapi.patch&lt;BR /&gt;&lt;BR /&gt;Log:&lt;BR /&gt;- Added VLC VAAPI patch to the build system but did not include it in the  &lt;BR /&gt;build.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Added:  &lt;BR /&gt;trunk/gar-minimyth/script/mediaplayers/vlc/files/vlc-1.0.0-rc4-vaapi.patch&lt;BR /&gt;==============================================================================&lt;BR /&gt;--- (empty file)&lt;BR /&gt;+++  &lt;BR /&gt;trunk/gar-minimyth/script/mediaplayers/vlc/files/vlc-1.0.0-rc4-vaapi.patch      &lt;BR /&gt; &lt;BR /&gt;Fri Jun 19 20:35:58 2009&lt;BR /&gt;@@ -0,0 +1,860 @@&lt;BR /&gt;+diff -Naur vlc-1.0.0-rc4-old/modules/codec/avcodec/avcodec.c  &lt;BR /&gt;vlc-1.0.0-rc4-new/modules/codec/avcodec/avcodec.c&lt;BR /&gt;+--- vlc-1.0.0-rc4-old/modules/codec/avcodec/avcodec.c  2009-05-10  &lt;BR /&gt;16:03:54.000000000 -0700&lt;BR /&gt;++++ vlc-1.0.0-rc4-new/modules/codec/avcodec/avcodec.c  2009-06-19  &lt;BR /&gt;16:31:52.000000000 -0700&lt;BR /&gt;+@@ -129,6 +129,9 @@&lt;BR /&gt;+&lt;BR /&gt;+     add_integer( "ffmpeg-debug", 0, NULL, DEBUG_TEXT, DEBUG_LONGTEXT,&lt;BR /&gt;+                  true )&lt;BR /&gt;++#ifdef HAVE_AVCODEC_VAAPI&lt;BR /&gt;++    add_bool( "ffmpeg-hw", true, NULL, HW_TEXT, HW_LONGTEXT, true )&lt;BR /&gt;++#endif&lt;BR /&gt;+&lt;BR /&gt;+ #ifdef ENABLE_SOUT&lt;BR /&gt;+     /* encoder submodule */&lt;BR /&gt;+diff -Naur vlc-1.0.0-rc4-old/modules/codec/avcodec/avcodec.h  &lt;BR /&gt;vlc-1.0.0-rc4-new/modules/codec/avcodec/avcodec.h&lt;BR /&gt;+--- vlc-1.0.0-rc4-old/modules/codec/avcodec/avcodec.h  2009-05-10  &lt;BR /&gt;16:03:54.000000000 -0700&lt;BR /&gt;++++ vlc-1.0.0-rc4-new/modules/codec/avcodec/avcodec.h  2009-06-19  &lt;BR /&gt;16:31:52.000000000 -0700&lt;BR /&gt;+@@ -127,6 +127,9 @@&lt;BR /&gt;+     "usually has a detrimental effect on quality. However it provides a  &lt;BR /&gt;big " &lt;BR /&gt;+     "speedup for high definition streams." )&lt;BR /&gt;+&lt;BR /&gt;++#define HW_TEXT N_("Hardware decoding")&lt;BR /&gt;++#define HW_LONGTEXT N_("This allows hardware decoding when available.")&lt;BR /&gt;++&lt;BR /&gt;+ /*&lt;BR /&gt;+  * Encoder options&lt;BR /&gt;+  */&lt;BR /&gt;+@@ -257,3 +260,6 @@&lt;BR /&gt;+ #   define AV_VERSION_INT(a, b, c) ((a)&amp;lt;&amp;lt;16 | (b)&amp;lt;&amp;lt;8 | (c))&lt;BR /&gt;+ #endif&lt;BR /&gt;+&lt;BR /&gt;++/* Uncomment it to enable compilation with vaapi (you also must change  &lt;BR /&gt;the build&lt;BR /&gt;++ * system) */&lt;BR /&gt;++//#define HAVE_AVCODEC_VAAPI 1&lt;BR /&gt;+diff -Naur vlc-1.0.0-rc4-old/modules/codec/avcodec/Modules.am  &lt;BR /&gt;vlc-1.0.0-rc4-new/modules/codec/avcodec/Modules.am&lt;BR /&gt;+--- vlc-1.0.0-rc4-old/modules/codec/avcodec/Modules.am 2009-05-10  &lt;BR /&gt;16:03:54.000000000 -0700&lt;BR /&gt;++++ vlc-1.0.0-rc4-new/modules/codec/avcodec/Modules.am 2009-06-19  &lt;BR /&gt;16:31:52.000000000 -0700&lt;BR /&gt;+@@ -7,6 +7,7 @@&lt;BR /&gt;+       avutil.h &lt;BR /&gt;+       fourcc.c &lt;BR /&gt;+       chroma.c &lt;BR /&gt;++      vaapi.c &lt;BR /&gt;+       $(NULL)&lt;BR /&gt;+&lt;BR /&gt;+ if ENABLE_SOUT&lt;BR /&gt;+diff -Naur vlc-1.0.0-rc4-old/modules/codec/avcodec/vaapi.c  &lt;BR /&gt;vlc-1.0.0-rc4-new/modules/codec/avcodec/vaapi.c&lt;BR /&gt;+--- vlc-1.0.0-rc4-old/modules/codec/avcodec/vaapi.c    1969-12-31  &lt;BR /&gt;16:00:00.000000000 -0800&lt;BR /&gt;++++ vlc-1.0.0-rc4-new/modules/codec/avcodec/vaapi.c    2009-06-19  &lt;BR /&gt;16:31:52.000000000 -0700&lt;BR /&gt;+@@ -0,0 +1,487 @@&lt;BR /&gt;++/*****************************************************************************&lt;BR /&gt;++ * vaapi.c: VAAPI helpers for the ffmpeg decoder&lt;BR /&gt;++  &lt;BR /&gt;*****************************************************************************&lt;BR /&gt;++ * Copyright (C) 2009 Laurent Aimar&lt;BR /&gt;++ * $Id$&lt;BR /&gt;++ *&lt;BR /&gt;++ * Authors: Laurent Aimar &lt;FENRIR_AT_ videolan="" _dot_="" org=""&gt;&lt;BR /&gt;++ *&lt;BR /&gt;++ * This program is free software; you can redistribute it and/or modify&lt;BR /&gt;++ * it under the terms of the GNU General Public License as published by&lt;BR /&gt;++ * the Free Software Foundation; either version 2 of the License, or&lt;BR /&gt;++ * (at your option) any later version.&lt;BR /&gt;++ *&lt;BR /&gt;++ * This program is distributed in the hope that it will be useful,&lt;BR /&gt;++ * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;BR /&gt;++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;BR /&gt;++ * GNU General Public License for more details.&lt;BR /&gt;++ *&lt;BR /&gt;++ * You should have received a copy of the GNU General Public License&lt;BR /&gt;++ * along with this program; if not, write to the Free Software&lt;BR /&gt;++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  &lt;BR /&gt;02110-1301, USA.&lt;BR /&gt;++  &lt;BR /&gt;*****************************************************************************/&lt;BR /&gt;++&lt;BR /&gt;++#ifdef HAVE_CONFIG_H&lt;BR /&gt;++# include "config.h"&lt;BR /&gt;++#endif&lt;BR /&gt;++&lt;BR /&gt;++#include &lt;VLC_COMMON.H&gt;&lt;BR /&gt;++#include &lt;VLC_VOUT.H&gt;&lt;BR /&gt;++#include &lt;ASSERT.H&gt;&lt;BR /&gt;++&lt;BR /&gt;++#ifdef HAVE_LIBAVCODEC_AVCODEC_H&lt;BR /&gt;++#   include &lt;LIBAVCODEC&gt;&lt;BR /&gt;++#   include &lt;LIBAVCODEC&gt;&lt;BR /&gt;++#elif defined(HAVE_FFMPEG_AVCODEC_H)&lt;BR /&gt;++#   include &lt;FFMPEG&gt;&lt;BR /&gt;++#else&lt;BR /&gt;++#   include &lt;AVCODEC.H&gt;&lt;BR /&gt;++#endif&lt;BR /&gt;++&lt;BR /&gt;++#include "avcodec.h"&lt;BR /&gt;++#include "vaapi.h"&lt;BR /&gt;++&lt;BR /&gt;++#ifdef HAVE_AVCODEC_VAAPI&lt;BR /&gt;++&lt;BR /&gt;++#include &lt;X11&gt;&lt;BR /&gt;++#include &lt;VA&gt;&lt;BR /&gt;++&lt;BR /&gt;++&lt;BR /&gt;++typedef struct&lt;BR /&gt;++{&lt;BR /&gt;++    VASurfaceID  i_id;&lt;BR /&gt;++    int          i_refcount;&lt;BR /&gt;++    unsigned int i_order;&lt;BR /&gt;++&lt;BR /&gt;++} vlc_va_surface_t;&lt;BR /&gt;++&lt;BR /&gt;++struct vlc_va_t&lt;BR /&gt;++{&lt;BR /&gt;++    /* */&lt;BR /&gt;++    Display      *p_display_x11;&lt;BR /&gt;++    VADisplay     p_display;&lt;BR /&gt;++&lt;BR /&gt;++    VAConfigID    i_config_id;&lt;BR /&gt;++    VAContextID   i_context_id;&lt;BR /&gt;++&lt;BR /&gt;++    struct vaapi_context hw_ctx;&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    int i_version_major;&lt;BR /&gt;++    int i_version_minor;&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    int          i_surface_count;&lt;BR /&gt;++    unsigned int i_surface_order;&lt;BR /&gt;++    int          i_surface_width;&lt;BR /&gt;++    int          i_surface_height;&lt;BR /&gt;++    vlc_fourcc_t i_surface_chroma;&lt;BR /&gt;++&lt;BR /&gt;++    vlc_va_surface_t *p_surface;&lt;BR /&gt;++&lt;BR /&gt;++    VAImage      image;&lt;BR /&gt;++&lt;BR /&gt;++};&lt;BR /&gt;++&lt;BR /&gt;++static int VaOpen( vlc_va_t *p_va, int i_codec_id );&lt;BR /&gt;++static void VaClose( vlc_va_t *p_va );&lt;BR /&gt;++&lt;BR /&gt;++static int VaCreateSurfaces( vlc_va_t *p_va, void **pp_hw_ctx,  &lt;BR /&gt;vlc_fourcc_t *pi_chroma,&lt;BR /&gt;++                             int i_width, int i_height );&lt;BR /&gt;++static void VaDestroySurfaces( vlc_va_t *p_va );&lt;BR /&gt;++&lt;BR /&gt;++vlc_va_t *VaNew( int i_codec_id )&lt;BR /&gt;++{&lt;BR /&gt;++    vlc_va_t *p_va = calloc( 1, sizeof(*p_va) );&lt;BR /&gt;++    if( !p_va )&lt;BR /&gt;++        return NULL;&lt;BR /&gt;++&lt;BR /&gt;++    if( VaOpen( p_va, i_codec_id ) )&lt;BR /&gt;++    {&lt;BR /&gt;++        free( p_va );&lt;BR /&gt;++        return NULL;&lt;BR /&gt;++    }&lt;BR /&gt;++    return p_va;&lt;BR /&gt;++}&lt;BR /&gt;++void VaDelete( vlc_va_t *p_va )&lt;BR /&gt;++{&lt;BR /&gt;++    VaClose( p_va );&lt;BR /&gt;++    free( p_va );&lt;BR /&gt;++}&lt;BR /&gt;++int VaSetup( vlc_va_t *p_va, void **pp_hw_ctx, vlc_fourcc_t *pi_chroma,&lt;BR /&gt;++             int i_width, int i_height )&lt;BR /&gt;++{&lt;BR /&gt;++    if( p_va-&amp;gt;i_surface_width == i_width &amp;amp;&amp;amp;&lt;BR /&gt;++        p_va-&amp;gt;i_surface_height == i_height )&lt;BR /&gt;++        return VLC_SUCCESS;&lt;BR /&gt;++&lt;BR /&gt;++    *pp_hw_ctx = NULL;&lt;BR /&gt;++    *pi_chroma = 0;&lt;BR /&gt;++    if( p_va-&amp;gt;i_surface_width || p_va-&amp;gt;i_surface_height )&lt;BR /&gt;++        VaDestroySurfaces( p_va );&lt;BR /&gt;++&lt;BR /&gt;++    if( i_width &amp;gt; 0 &amp;amp;&amp;amp; i_height &amp;gt; 0 )&lt;BR /&gt;++        return VaCreateSurfaces( p_va, pp_hw_ctx, pi_chroma, i_width,  &lt;BR /&gt;i_height );&lt;BR /&gt;++&lt;BR /&gt;++    return VLC_EGENERIC;&lt;BR /&gt;++}&lt;BR /&gt;++void VaVersion( vlc_va_t *p_va, char *psz_version, size_t i_version )&lt;BR /&gt;++{&lt;BR /&gt;++    snprintf( psz_version, i_version, "%d.%d", p_va-&amp;gt;i_version_major,  &lt;BR /&gt;p_va-&amp;gt;i_version_minor );&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++static int VaOpen( vlc_va_t *p_va, int i_codec_id )&lt;BR /&gt;++{&lt;BR /&gt;++    VAProfile i_profile;&lt;BR /&gt;++    int i_surface_count;&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    switch( i_codec_id )&lt;BR /&gt;++    {&lt;BR /&gt;++    case CODEC_ID_MPEG1VIDEO:&lt;BR /&gt;++    case CODEC_ID_MPEG2VIDEO:&lt;BR /&gt;++        i_profile = VAProfileMPEG2Main;&lt;BR /&gt;++        i_surface_count = 2+1;&lt;BR /&gt;++        break;&lt;BR /&gt;++    case CODEC_ID_MPEG4:&lt;BR /&gt;++        i_profile = VAProfileMPEG4AdvancedSimple;&lt;BR /&gt;++        i_surface_count = 2+1;&lt;BR /&gt;++        break;&lt;BR /&gt;++    case CODEC_ID_WMV3:&lt;BR /&gt;++        i_profile = VAProfileVC1Main;&lt;BR /&gt;++        i_surface_count = 2+1;&lt;BR /&gt;++        break;&lt;BR /&gt;++    case CODEC_ID_VC1:&lt;BR /&gt;++        i_profile = VAProfileVC1Advanced;&lt;BR /&gt;++        i_surface_count = 2+1;&lt;BR /&gt;++        break;&lt;BR /&gt;++    case CODEC_ID_H264:&lt;BR /&gt;++        i_profile = VAProfileH264High;&lt;BR /&gt;++        i_surface_count = 16+1;&lt;BR /&gt;++        break;&lt;BR /&gt;++    default:&lt;BR /&gt;++        return VLC_EGENERIC;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    memset( p_va, 0, sizeof(*p_va) );&lt;BR /&gt;++&lt;BR /&gt;++    /* Create a VA display */&lt;BR /&gt;++    p_va-&amp;gt;p_display_x11 = XOpenDisplay(NULL);&lt;BR /&gt;++    if( !p_va-&amp;gt;p_display_x11 )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++&lt;BR /&gt;++    p_va-&amp;gt;p_display = vaGetDisplay( p_va-&amp;gt;p_display_x11 );&lt;BR /&gt;++    if( !p_va-&amp;gt;p_display )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++&lt;BR /&gt;++    if( vaInitialize( p_va-&amp;gt;p_display, &amp;amp;p_va-&amp;gt;i_version_major,  &lt;BR /&gt;&amp;amp;p_va-&amp;gt;i_version_minor ) )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++&lt;BR /&gt;++    /* Create a VA configuration */&lt;BR /&gt;++    VAConfigAttrib attrib;&lt;BR /&gt;++    memset( &amp;amp;attrib, 0, sizeof(attrib) );&lt;BR /&gt;++    attrib.type = VAConfigAttribRTFormat;&lt;BR /&gt;++    if( vaGetConfigAttributes( p_va-&amp;gt;p_display,&lt;BR /&gt;++                               i_profile, VAEntrypointVLD, &amp;amp;attrib, 1 ) )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++&lt;BR /&gt;++    /* Not sure what to do if not, I don't have a way to test */&lt;BR /&gt;++    if( (attrib.value &amp;amp; VA_RT_FORMAT_YUV420) == 0 )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    if( vaCreateConfig( p_va-&amp;gt;p_display,&lt;BR /&gt;++                        i_profile, VAEntrypointVLD, &amp;amp;attrib, 1,  &lt;BR /&gt;&amp;amp;p_va-&amp;gt;i_config_id ) )&lt;BR /&gt;++    {&lt;BR /&gt;++        p_va-&amp;gt;i_config_id = 0;&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    p_va-&amp;gt;i_surface_count = i_surface_count;&lt;BR /&gt;++&lt;BR /&gt;++    return VLC_SUCCESS;&lt;BR /&gt;++&lt;BR /&gt;++error:&lt;BR /&gt;++    return VLC_EGENERIC;&lt;BR /&gt;++}&lt;BR /&gt;++static void VaClose( vlc_va_t *p_va )&lt;BR /&gt;++{&lt;BR /&gt;++    if( p_va-&amp;gt;i_surface_width || p_va-&amp;gt;i_surface_height )&lt;BR /&gt;++        VaDestroySurfaces( p_va );&lt;BR /&gt;++&lt;BR /&gt;++    if( p_va-&amp;gt;i_config_id )&lt;BR /&gt;++        vaDestroyConfig( p_va-&amp;gt;p_display, p_va-&amp;gt;i_config_id );&lt;BR /&gt;++    if( p_va-&amp;gt;p_display )&lt;BR /&gt;++        vaTerminate( p_va-&amp;gt;p_display );&lt;BR /&gt;++    if( p_va-&amp;gt;p_display_x11 )&lt;BR /&gt;++        XCloseDisplay( p_va-&amp;gt;p_display_x11 );&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++static int VaCreateSurfaces( vlc_va_t *p_va, void **pp_hw_ctx,  &lt;BR /&gt;vlc_fourcc_t *pi_chroma,&lt;BR /&gt;++                             int i_width, int i_height )&lt;BR /&gt;++{&lt;BR /&gt;++    assert( i_width &amp;gt; 0 &amp;amp;&amp;amp; i_height &amp;gt; 0 );&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    p_va-&amp;gt;p_surface = calloc( p_va-&amp;gt;i_surface_count,  &lt;BR /&gt;sizeof(*p_va-&amp;gt;p_surface) );&lt;BR /&gt;++    if( !p_va-&amp;gt;p_surface )&lt;BR /&gt;++        return VLC_EGENERIC;&lt;BR /&gt;++&lt;BR /&gt;++    /* Create surfaces */&lt;BR /&gt;++    VASurfaceID pi_surface_id[p_va-&amp;gt;i_surface_count];&lt;BR /&gt;++    if( vaCreateSurfaces( p_va-&amp;gt;p_display, i_width, i_height,  &lt;BR /&gt;VA_RT_FORMAT_YUV420,&lt;BR /&gt;++                          p_va-&amp;gt;i_surface_count, pi_surface_id ) )&lt;BR /&gt;++    {&lt;BR /&gt;++        for( int i = 0; i &amp;lt; p_va-&amp;gt;i_surface_count; i++ )&lt;BR /&gt;++            p_va-&amp;gt;p_surface&lt;I&gt;.i_id = VA_INVALID_SURFACE;&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    for( int i = 0; i &amp;lt; p_va-&amp;gt;i_surface_count; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        vlc_va_surface_t *p_surface = &amp;amp;p_va-&amp;gt;p_surface&lt;I&gt;;&lt;BR /&gt;++&lt;BR /&gt;++        p_surface-&amp;gt;i_id = pi_surface_id&lt;I&gt;;&lt;BR /&gt;++        p_surface-&amp;gt;i_refcount = 0;&lt;BR /&gt;++        p_surface-&amp;gt;i_order = 0;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    /* Create a context */&lt;BR /&gt;++    if( vaCreateContext( p_va-&amp;gt;p_display, p_va-&amp;gt;i_config_id,&lt;BR /&gt;++                         i_width, i_height, VA_PROGRESSIVE,&lt;BR /&gt;++                         pi_surface_id, p_va-&amp;gt;i_surface_count,  &lt;BR /&gt;&amp;amp;p_va-&amp;gt;i_context_id ) )&lt;BR /&gt;++    {&lt;BR /&gt;++        p_va-&amp;gt;i_context_id = 0;&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    /* Find a supported image chroma */&lt;BR /&gt;++    int i_fmt_count = vaMaxNumImageFormats( p_va-&amp;gt;p_display );&lt;BR /&gt;++    VAImageFormat *p_fmt = calloc( i_fmt_count, sizeof(*p_fmt) );&lt;BR /&gt;++    if( !p_fmt )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++&lt;BR /&gt;++    if( vaQueryImageFormats( p_va-&amp;gt;p_display, p_fmt, &amp;amp;i_fmt_count ) )&lt;BR /&gt;++    {&lt;BR /&gt;++        free( p_fmt );&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    vlc_fourcc_t  i_chroma = 0;&lt;BR /&gt;++    VAImageFormat fmt;&lt;BR /&gt;++    for( int i = 0; i &amp;lt; i_fmt_count; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        if( p_fmt&lt;I&gt;.fourcc == VA_FOURCC( 'Y', 'V', '1', '2' ) ||&lt;BR /&gt;++            p_fmt&lt;I&gt;.fourcc == VA_FOURCC( 'I', '4', '2', '0' ) )&lt;BR /&gt;++        {&lt;BR /&gt;++            i_chroma = VLC_FOURCC( 'I', '4', '2', '0' );&lt;BR /&gt;++            fmt = p_fmt&lt;I&gt;;&lt;BR /&gt;++        }&lt;BR /&gt;++        /* TODO: It seems that these may also be available (but not&lt;BR /&gt;++         * with my setup):&lt;BR /&gt;++         * VA_FOURCC( 'N', 'V', '1', '2')&lt;BR /&gt;++         * VA_FOURCC( 'U', 'Y', 'V', 'Y')&lt;BR /&gt;++         * VA_FOURCC( 'Y', 'U', 'Y', 'V')&lt;BR /&gt;++         */&lt;BR /&gt;++    }&lt;BR /&gt;++    free( p_fmt );&lt;BR /&gt;++    if( !i_chroma )&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    *pi_chroma = i_chroma;&lt;BR /&gt;++&lt;BR /&gt;++    /* Create an image for surface extraction */&lt;BR /&gt;++    if( vaCreateImage(  p_va-&amp;gt;p_display, &amp;amp;fmt, i_width, i_height,  &lt;BR /&gt;&amp;amp;p_va-&amp;gt;image ) )&lt;BR /&gt;++    {&lt;BR /&gt;++        p_va-&amp;gt;image.image_id = 0;&lt;BR /&gt;++        goto error;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    /* Setup the ffmpeg hardware context */&lt;BR /&gt;++    *pp_hw_ctx = &amp;amp;p_va-&amp;gt;hw_ctx;&lt;BR /&gt;++&lt;BR /&gt;++    memset( &amp;amp;p_va-&amp;gt;hw_ctx, 0, sizeof(p_va-&amp;gt;hw_ctx) );&lt;BR /&gt;++    p_va-&amp;gt;hw_ctx.display    = p_va-&amp;gt;p_display;&lt;BR /&gt;++    p_va-&amp;gt;hw_ctx.config_id  = p_va-&amp;gt;i_config_id;&lt;BR /&gt;++    p_va-&amp;gt;hw_ctx.context_id = p_va-&amp;gt;i_context_id;&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    p_va-&amp;gt;i_surface_chroma = i_chroma;&lt;BR /&gt;++    p_va-&amp;gt;i_surface_width = i_width;&lt;BR /&gt;++    p_va-&amp;gt;i_surface_height = i_height;&lt;BR /&gt;++    return VLC_SUCCESS;&lt;BR /&gt;++&lt;BR /&gt;++error:&lt;BR /&gt;++    VaDestroySurfaces( p_va );&lt;BR /&gt;++    return VLC_EGENERIC;&lt;BR /&gt;++}&lt;BR /&gt;++static void VaDestroySurfaces( vlc_va_t *p_va )&lt;BR /&gt;++{&lt;BR /&gt;++    if( p_va-&amp;gt;image.image_id )&lt;BR /&gt;++        vaDestroyImage( p_va-&amp;gt;p_display, p_va-&amp;gt;image.image_id );&lt;BR /&gt;++&lt;BR /&gt;++    if( p_va-&amp;gt;i_context_id )&lt;BR /&gt;++        vaDestroyContext( p_va-&amp;gt;p_display, p_va-&amp;gt;i_context_id );&lt;BR /&gt;++&lt;BR /&gt;++    for( int i = 0; i &amp;lt; p_va-&amp;gt;i_surface_count &amp;amp;&amp;amp; p_va-&amp;gt;p_surface; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        vlc_va_surface_t *p_surface = &amp;amp;p_va-&amp;gt;p_surface&lt;I&gt;;&lt;BR /&gt;++&lt;BR /&gt;++        if( p_surface-&amp;gt;i_id != VA_INVALID_SURFACE )&lt;BR /&gt;++            vaDestroySurfaces( p_va-&amp;gt;p_display, &amp;amp;p_surface-&amp;gt;i_id, 1 );&lt;BR /&gt;++    }&lt;BR /&gt;++    free( p_va-&amp;gt;p_surface );&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    p_va-&amp;gt;image.image_id = 0;&lt;BR /&gt;++    p_va-&amp;gt;i_context_id = 0;&lt;BR /&gt;++    p_va-&amp;gt;p_surface = NULL;&lt;BR /&gt;++    p_va-&amp;gt;i_surface_width = 0;&lt;BR /&gt;++    p_va-&amp;gt;i_surface_height = 0;&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++int VaExtract( vlc_va_t *p_va, picture_t *p_picture, AVFrame *p_ff )&lt;BR /&gt;++{&lt;BR /&gt;++    VASurfaceID i_surface_id = (VASurfaceID)(uintptr_t)p_ff-&amp;gt;data[3];&lt;BR /&gt;++&lt;BR /&gt;++    if( vaSyncSurface( p_va-&amp;gt;p_display, p_va-&amp;gt;i_context_id, i_surface_id  &lt;BR /&gt;) )&lt;BR /&gt;++        return VLC_EGENERIC;&lt;BR /&gt;++&lt;BR /&gt;++    /* XXX vaDeriveImage may be better but it is not supported by&lt;BR /&gt;++     * my setup.&lt;BR /&gt;++     */&lt;BR /&gt;++&lt;BR /&gt;++    if( vaGetImage( p_va-&amp;gt;p_display, i_surface_id,&lt;BR /&gt;++                    0, 0, p_va-&amp;gt;i_surface_width, p_va-&amp;gt;i_surface_height,&lt;BR /&gt;++                    p_va-&amp;gt;image.image_id) )&lt;BR /&gt;++        return VLC_EGENERIC;&lt;BR /&gt;++&lt;BR /&gt;++    void *p_base;&lt;BR /&gt;++    if( vaMapBuffer( p_va-&amp;gt;p_display, p_va-&amp;gt;image.buf, &amp;amp;p_base ) )&lt;BR /&gt;++        return VLC_EGENERIC;&lt;BR /&gt;++&lt;BR /&gt;++    for( int i_plane = 0; i_plane &amp;lt; p_picture-&amp;gt;i_planes; i_plane++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        const int i_src_plane = ((p_va-&amp;gt;image.format.fourcc ==  &lt;BR /&gt;VA_FOURCC('Y','V','1','2' )) &amp;amp;&amp;amp; i_plane != 0) ?  (3 - i_plane) : i_plane;&lt;BR /&gt;++        const uint8_t *p_src = (uint8_t*)p_base +  &lt;BR /&gt;p_va-&amp;gt;image.offsets[i_src_plane];&lt;BR /&gt;++        const int i_src_stride = p_va-&amp;gt;image.pitches[i_src_plane];&lt;BR /&gt;++&lt;BR /&gt;++        uint8_t *p_dst = p_picture-&amp;gt;p[i_plane].p_pixels;&lt;BR /&gt;++        const int i_dst_stride = p_picture-&amp;gt;p[i_plane].i_pitch;&lt;BR /&gt;++&lt;BR /&gt;++        if( i_src_stride != i_dst_stride )&lt;BR /&gt;++        {&lt;BR /&gt;++            for( int i = 0; i &amp;lt; p_picture-&amp;gt;p[i_plane].i_visible_lines;  &lt;BR /&gt;i++ )&lt;BR /&gt;++            {&lt;BR /&gt;++                vlc_memcpy( p_dst, p_src, __MIN( i_src_stride,  &lt;BR /&gt;i_dst_stride ) );&lt;BR /&gt;++                p_src += i_src_stride;&lt;BR /&gt;++                p_dst += i_dst_stride;&lt;BR /&gt;++            }&lt;BR /&gt;++        }&lt;BR /&gt;++        else&lt;BR /&gt;++        {&lt;BR /&gt;++            vlc_memcpy( p_dst, p_src,  &lt;BR /&gt;p_picture-&amp;gt;p[i_plane].i_visible_lines * i_src_stride );&lt;BR /&gt;++        }&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    if( vaUnmapBuffer( p_va-&amp;gt;p_display, p_va-&amp;gt;image.buf ) )&lt;BR /&gt;++        return VLC_EGENERIC;&lt;BR /&gt;++&lt;BR /&gt;++    return VLC_SUCCESS;&lt;BR /&gt;++}&lt;BR /&gt;++int VaGrabSurface( vlc_va_t *p_va, AVFrame *p_ff )&lt;BR /&gt;++{&lt;BR /&gt;++    int i_old;&lt;BR /&gt;++    int i;&lt;BR /&gt;++&lt;BR /&gt;++    /* Grab an unused surface, in case none are, try the oldest&lt;BR /&gt;++     * XXX using the oldest is a workaround in case a problem happens  &lt;BR /&gt;with ffmpeg */&lt;BR /&gt;++    for( i = 0, i_old = 0; i &amp;lt; p_va-&amp;gt;i_surface_count; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        vlc_va_surface_t *p_surface = &amp;amp;p_va-&amp;gt;p_surface&lt;I&gt;;&lt;BR /&gt;++&lt;BR /&gt;++        if( !p_surface-&amp;gt;i_refcount )&lt;BR /&gt;++            break;&lt;BR /&gt;++&lt;BR /&gt;++        if( p_surface-&amp;gt;i_order &amp;lt; p_va-&amp;gt;p_surface[i_old].i_order )&lt;BR /&gt;++            i_old = i;&lt;BR /&gt;++    }&lt;BR /&gt;++    if( i &amp;gt;= p_va-&amp;gt;i_surface_count )&lt;BR /&gt;++        i = i_old;&lt;BR /&gt;++&lt;BR /&gt;++    vlc_va_surface_t *p_surface = &amp;amp;p_va-&amp;gt;p_surface&lt;I&gt;;&lt;BR /&gt;++&lt;BR /&gt;++    p_surface-&amp;gt;i_refcount = 1;&lt;BR /&gt;++    p_surface-&amp;gt;i_order = p_va-&amp;gt;i_surface_order++;&lt;BR /&gt;++&lt;BR /&gt;++    /* */&lt;BR /&gt;++    for( int i = 0; i &amp;lt; 4; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        p_ff-&amp;gt;data&lt;I&gt; = NULL;&lt;BR /&gt;++        p_ff-&amp;gt;linesize&lt;I&gt; = 0;&lt;BR /&gt;++&lt;BR /&gt;++        if( i == 0 || i == 3 )&lt;BR /&gt;++            p_ff-&amp;gt;data&lt;I&gt; = (void*)(uintptr_t)p_surface-&amp;gt;i_id;/* Yummie */&lt;BR /&gt;++    }&lt;BR /&gt;++    return VLC_SUCCESS;&lt;BR /&gt;++}&lt;BR /&gt;++void VaUngrabSurface( vlc_va_t *p_va, AVFrame *p_ff )&lt;BR /&gt;++{&lt;BR /&gt;++    VASurfaceID i_surface_id = (VASurfaceID)(uintptr_t)p_ff-&amp;gt;data[3];&lt;BR /&gt;++&lt;BR /&gt;++    for( int i = 0; i &amp;lt; p_va-&amp;gt;i_surface_count; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        vlc_va_surface_t *p_surface = &amp;amp;p_va-&amp;gt;p_surface&lt;I&gt;;&lt;BR /&gt;++&lt;BR /&gt;++        if( p_surface-&amp;gt;i_id == i_surface_id )&lt;BR /&gt;++            p_surface-&amp;gt;i_refcount--;&lt;BR /&gt;++    }&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++#else&lt;BR /&gt;++&lt;BR /&gt;++vlc_va_t *VaNew( int i_codec_id )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(i_codec_id);&lt;BR /&gt;++    return NULL;&lt;BR /&gt;++}&lt;BR /&gt;++void VaDelete( vlc_va_t *p_va )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(p_va);&lt;BR /&gt;++    assert( 0 );&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++void VaVersion( vlc_va_t *p_va, char *psz_version, size_t i_version )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(p_va); VLC_UNUSED(psz_version); VLC_UNUSED(i_version);&lt;BR /&gt;++    assert(0);&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++int VaSetup( vlc_va_t *p_va, void **pp_hw_ctx, vlc_fourcc_t *pi_chroma,&lt;BR /&gt;++             int i_width, int i_height )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(p_va); VLC_UNUSED(pp_hw_ctx); VLC_UNUSED(pi_chroma);&lt;BR /&gt;++    VLC_UNUSED(i_width); VLC_UNUSED(i_height);&lt;BR /&gt;++    assert(0);&lt;BR /&gt;++    return -1;&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++int VaExtract( vlc_va_t *p_va, picture_t *p_picture, AVFrame *p_ff )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(p_va); VLC_UNUSED(p_picture); VLC_UNUSED(p_ff);&lt;BR /&gt;++    assert(0);&lt;BR /&gt;++    return -1;&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++int VaGrabSurface( vlc_va_t *p_va, AVFrame *p_ff )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(p_va); VLC_UNUSED(p_ff);&lt;BR /&gt;++    assert(0);&lt;BR /&gt;++    return -1;&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++void VaUngrabSurface( vlc_va_t *p_va, AVFrame *p_ff )&lt;BR /&gt;++{&lt;BR /&gt;++    VLC_UNUSED(p_va); VLC_UNUSED(p_ff);&lt;BR /&gt;++    assert(0);&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;++#endif&lt;BR /&gt;+diff -Naur vlc-1.0.0-rc4-old/modules/codec/avcodec/vaapi.h  &lt;BR /&gt;vlc-1.0.0-rc4-new/modules/codec/avcodec/vaapi.h&lt;BR /&gt;+--- vlc-1.0.0-rc4-old/modules/codec/avcodec/vaapi.h    1969-12-31  &lt;BR /&gt;16:00:00.000000000 -0800&lt;BR /&gt;++++ vlc-1.0.0-rc4-new/modules/codec/avcodec/vaapi.h    2009-06-19  &lt;BR /&gt;16:31:52.000000000 -0700&lt;BR /&gt;+@@ -0,0 +1,43 @@&lt;BR /&gt;++/*****************************************************************************&lt;BR /&gt;++ * vaapi.h: VAAPI helpers for the ffmpeg decoder&lt;BR /&gt;++  &lt;BR /&gt;*****************************************************************************&lt;BR /&gt;++ * Copyright (C) 2009 Laurent Aimar&lt;BR /&gt;++ * $Id$&lt;BR /&gt;++ *&lt;BR /&gt;++ * Authors: Laurent Aimar &lt;FENRIR_AT_ videolan="" _dot_="" org=""&gt;&lt;BR /&gt;++ *&lt;BR /&gt;++ * This program is free software; you can redistribute it and/or modify&lt;BR /&gt;++ * it under the terms of the GNU General Public License as published by&lt;BR /&gt;++ * the Free Software Foundation; either version 2 of the License, or&lt;BR /&gt;++ * (at your option) any later version.&lt;BR /&gt;++ *&lt;BR /&gt;++ * This program is distributed in the hope that it will be useful,&lt;BR /&gt;++ * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;BR /&gt;++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;BR /&gt;++ * GNU General Public License for more details.&lt;BR /&gt;++ *&lt;BR /&gt;++ * You should have received a copy of the GNU General Public License&lt;BR /&gt;++ * along with this program; if not, write to the Free Software&lt;BR /&gt;++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  &lt;BR /&gt;02110-1301, USA.&lt;BR /&gt;++  &lt;BR /&gt;*****************************************************************************/&lt;BR /&gt;++&lt;BR /&gt;++#ifndef _VLC_VAAPI_H&lt;BR /&gt;++#define _VLC_VAAPI_H 1&lt;BR /&gt;++&lt;BR /&gt;++typedef struct vlc_va_t vlc_va_t;&lt;BR /&gt;++&lt;BR /&gt;++vlc_va_t *VaNew( int i_codec_id );&lt;BR /&gt;++void VaDelete( vlc_va_t *p_va );&lt;BR /&gt;++&lt;BR /&gt;++void VaVersion( vlc_va_t *p_va, char *psz_version, size_t i_version );&lt;BR /&gt;++&lt;BR /&gt;++int VaSetup( vlc_va_t *p_va, void **pp_hw_ctx, vlc_fourcc_t *pi_chroma,&lt;BR /&gt;++             int i_width, int i_height );&lt;BR /&gt;++&lt;BR /&gt;++int VaExtract( vlc_va_t *p_va, picture_t *p_picture, AVFrame *p_ff );&lt;BR /&gt;++&lt;BR /&gt;++int VaGrabSurface( vlc_va_t *p_va, AVFrame *p_ff );&lt;BR /&gt;++&lt;BR /&gt;++void VaUngrabSurface( vlc_va_t *p_va, AVFrame *p_ff );&lt;BR /&gt;++&lt;BR /&gt;++#endif&lt;BR /&gt;+diff -Naur vlc-1.0.0-rc4-old/modules/codec/avcodec/video.c  &lt;BR /&gt;vlc-1.0.0-rc4-new/modules/codec/avcodec/video.c&lt;BR /&gt;+--- vlc-1.0.0-rc4-old/modules/codec/avcodec/video.c    2009-06-14  &lt;BR /&gt;11:14:59.000000000 -0700&lt;BR /&gt;++++ vlc-1.0.0-rc4-new/modules/codec/avcodec/video.c    2009-06-19  &lt;BR /&gt;16:36:25.000000000 -0700&lt;BR /&gt;+@@ -34,10 +34,14 @@&lt;BR /&gt;+ #include &lt;VLC_VOUT.H&gt;&lt;BR /&gt;+ #include &lt;VLC_CODECS.H&gt;                               /* BITMAPINFOHEADER  &lt;BR /&gt;*/&lt;BR /&gt;+ #include &lt;VLC_AVCODEC.H&gt;&lt;BR /&gt;++#include &lt;ASSERT.H&gt;&lt;BR /&gt;+&lt;BR /&gt;+ /* ffmpeg header */&lt;BR /&gt;+ #ifdef HAVE_LIBAVCODEC_AVCODEC_H&lt;BR /&gt;+ #   include &lt;LIBAVCODEC&gt;&lt;BR /&gt;++#   ifdef HAVE_AVCODEC_VAAPI&lt;BR /&gt;++#       include &lt;LIBAVCODEC&gt;&lt;BR /&gt;++#   endif&lt;BR /&gt;+ #elif defined(HAVE_FFMPEG_AVCODEC_H)&lt;BR /&gt;+ #   include &lt;FFMPEG&gt;&lt;BR /&gt;+ #else&lt;BR /&gt;+@@ -45,6 +49,7 @@&lt;BR /&gt;+ #endif&lt;BR /&gt;+&lt;BR /&gt;+ #include "avcodec.h"&lt;BR /&gt;++#include "vaapi.h"&lt;BR /&gt;+&lt;BR /&gt;+  &lt;BR /&gt;/*****************************************************************************&lt;BR /&gt;+  * decoder_sys_t : decoder descriptor&lt;BR /&gt;+@@ -85,6 +90,9 @@&lt;BR /&gt;+&lt;BR /&gt;+     /* */&lt;BR /&gt;+     bool b_flush;&lt;BR /&gt;++&lt;BR /&gt;++    /* VA API */&lt;BR /&gt;++    vlc_va_t *p_va;&lt;BR /&gt;+ };&lt;BR /&gt;+&lt;BR /&gt;+ /* FIXME (dummy palette for now) */&lt;BR /&gt;+@@ -101,6 +109,10 @@&lt;BR /&gt;+ static void ffmpeg_ReleaseFrameBuf( struct AVCodecContext *, AVFrame * );&lt;BR /&gt;+ static void ffmpeg_NextPts( decoder_t * );&lt;BR /&gt;+&lt;BR /&gt;++static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *,&lt;BR /&gt;++                                          const enum PixelFormat * );&lt;BR /&gt;++&lt;BR /&gt;++&lt;BR /&gt;+ static uint32_t ffmpeg_CodecTag( vlc_fourcc_t fcc )&lt;BR /&gt;+ {&lt;BR /&gt;+     uint8_t *p = (uint8_t*)&amp;amp;fcc;&lt;BR /&gt;+@@ -115,7 +127,7 @@&lt;BR /&gt;+ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,&lt;BR /&gt;+                                             AVCodecContext *p_context )&lt;BR /&gt;+ {&lt;BR /&gt;+-    picture_t *p_pic;&lt;BR /&gt;++    decoder_sys_t *p_sys = p_dec-&amp;gt;p_sys;&lt;BR /&gt;+&lt;BR /&gt;+     p_dec-&amp;gt;fmt_out.video.i_width = p_context-&amp;gt;width;&lt;BR /&gt;+     p_dec-&amp;gt;fmt_out.video.i_height = p_context-&amp;gt;height;&lt;BR /&gt;+@@ -125,10 +137,12 @@&lt;BR /&gt;+         return NULL; /* invalid display size */&lt;BR /&gt;+     }&lt;BR /&gt;+&lt;BR /&gt;+-    if( GetVlcChroma( &amp;amp;p_dec-&amp;gt;fmt_out.video, p_context-&amp;gt;pix_fmt ) !=  &lt;BR /&gt;VLC_SUCCESS )&lt;BR /&gt;++    if( !p_sys-&amp;gt;p_va &amp;amp;&amp;amp; GetVlcChroma( &amp;amp;p_dec-&amp;gt;fmt_out.video,  &lt;BR /&gt;p_context-&amp;gt;pix_fmt ) )&lt;BR /&gt;+     {&lt;BR /&gt;+-        /* we are doomed, but not really, because most codecs set their  &lt;BR /&gt;pix_fmt much later */&lt;BR /&gt;+-        p_dec-&amp;gt;fmt_out.i_codec = VLC_FOURCC('I','4','2','0');&lt;BR /&gt;++        /* we are doomed, but not really, because most codecs set their  &lt;BR /&gt;pix_fmt&lt;BR /&gt;++         * much later&lt;BR /&gt;++         * FIXME does it make sense here ? */&lt;BR /&gt;++        p_dec-&amp;gt;fmt_out.video.i_chroma = VLC_FOURCC('I','4','2','0');&lt;BR /&gt;+     }&lt;BR /&gt;+     p_dec-&amp;gt;fmt_out.i_codec = p_dec-&amp;gt;fmt_out.video.i_chroma;&lt;BR /&gt;+&lt;BR /&gt;+@@ -166,9 +180,7 @@&lt;BR /&gt;+         p_dec-&amp;gt;fmt_out.video.i_frame_rate_base = p_context-&amp;gt;time_base.num;&lt;BR /&gt;+     }&lt;BR /&gt;+&lt;BR /&gt;+-    p_pic = decoder_NewPicture( p_dec );&lt;BR /&gt;+-&lt;BR /&gt;+-    return p_pic;&lt;BR /&gt;++    return decoder_NewPicture( p_dec );&lt;BR /&gt;+ }&lt;BR /&gt;+&lt;BR /&gt;+  &lt;BR /&gt;/*****************************************************************************&lt;BR /&gt;+@@ -193,6 +205,7 @@&lt;BR /&gt;+     p_sys-&amp;gt;psz_namecodec = psz_namecodec;&lt;BR /&gt;+     p_sys-&amp;gt;p_ff_pic = avcodec_alloc_frame();&lt;BR /&gt;+     p_sys-&amp;gt;b_delayed_open = true;&lt;BR /&gt;++    p_sys-&amp;gt;p_va = NULL;&lt;BR /&gt;+&lt;BR /&gt;+     /* ***** Fill p_context with init values ***** */&lt;BR /&gt;+     p_sys-&amp;gt;p_context-&amp;gt;codec_tag = ffmpeg_CodecTag( p_dec-&amp;gt;fmt_in.i_codec  &lt;BR /&gt;);&lt;BR /&gt;+@@ -319,6 +332,9 @@&lt;BR /&gt;+     p_sys-&amp;gt;p_context-&amp;gt;release_buffer = ffmpeg_ReleaseFrameBuf;&lt;BR /&gt;+     p_sys-&amp;gt;p_context-&amp;gt;opaque = p_dec;&lt;BR /&gt;+&lt;BR /&gt;++    if( var_CreateGetBool( p_dec, "ffmpeg-hw" ) )&lt;BR /&gt;++        p_sys-&amp;gt;p_context-&amp;gt;get_format = ffmpeg_GetFormat;&lt;BR /&gt;++&lt;BR /&gt;+     /* ***** misc init ***** */&lt;BR /&gt;+     p_sys-&amp;gt;input_pts = p_sys-&amp;gt;input_dts = 0;&lt;BR /&gt;+     p_sys-&amp;gt;i_pts = 0;&lt;BR /&gt;+@@ -621,7 +637,7 @@&lt;BR /&gt;+             p_sys-&amp;gt;i_late_frames = 0;&lt;BR /&gt;+         }&lt;BR /&gt;+&lt;BR /&gt;+-        if( !b_drawpicture || !p_sys-&amp;gt;p_ff_pic-&amp;gt;linesize[0] )&lt;BR /&gt;++        if( !b_drawpicture || ( !p_sys-&amp;gt;p_va  &lt;BR /&gt;&amp;amp;&amp;amp; !p_sys-&amp;gt;p_ff_pic-&amp;gt;linesize[0] ) )&lt;BR /&gt;+         {&lt;BR /&gt;+             /* Do not display the picture */&lt;BR /&gt;+             p_pic = (picture_t *)p_sys-&amp;gt;p_ff_pic-&amp;gt;opaque;&lt;BR /&gt;+@@ -736,6 +752,9 @@&lt;BR /&gt;+&lt;BR /&gt;+     if( p_sys-&amp;gt;p_ff_pic ) av_free( p_sys-&amp;gt;p_ff_pic );&lt;BR /&gt;+     free( p_sys-&amp;gt;p_buffer_orig );&lt;BR /&gt;++&lt;BR /&gt;++    if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++        VaDelete( p_sys-&amp;gt;p_va );&lt;BR /&gt;+ }&lt;BR /&gt;+&lt;BR /&gt;+  &lt;BR /&gt;/*****************************************************************************&lt;BR /&gt;+@@ -838,6 +857,14 @@&lt;BR /&gt;+&lt;BR /&gt;+     p_sys-&amp;gt;b_delayed_open = false;&lt;BR /&gt;+&lt;BR /&gt;++    if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++    {&lt;BR /&gt;++        char psz_version[128];&lt;BR /&gt;++&lt;BR /&gt;++        VaVersion( p_sys-&amp;gt;p_va, psz_version, sizeof(psz_version) );&lt;BR /&gt;++        msg_Info( p_dec, "Using VA API version %s for hardware  &lt;BR /&gt;decoding.", psz_version );&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;+     return VLC_SUCCESS;&lt;BR /&gt;+ }&lt;BR /&gt;+  &lt;BR /&gt;/*****************************************************************************&lt;BR /&gt;+@@ -849,7 +876,11 @@&lt;BR /&gt;+ {&lt;BR /&gt;+     decoder_sys_t *p_sys = p_dec-&amp;gt;p_sys;&lt;BR /&gt;+&lt;BR /&gt;+-    if( TestFfmpegChroma( p_sys-&amp;gt;p_context-&amp;gt;pix_fmt, -1 ) == VLC_SUCCESS )&lt;BR /&gt;++    if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++    {&lt;BR /&gt;++        VaExtract( p_sys-&amp;gt;p_va, p_pic, p_ff_pic );&lt;BR /&gt;++    }&lt;BR /&gt;++    else if( TestFfmpegChroma( p_sys-&amp;gt;p_context-&amp;gt;pix_fmt, -1 ) ==  &lt;BR /&gt;VLC_SUCCESS )&lt;BR /&gt;+     {&lt;BR /&gt;+         int i_plane, i_size, i_line;&lt;BR /&gt;+         uint8_t *p_dst, *p_src;&lt;BR /&gt;+@@ -899,11 +930,33 @@&lt;BR /&gt;+     ffmpeg_SetFrameBufferPts( p_dec, p_ff_pic );&lt;BR /&gt;+&lt;BR /&gt;+     /* */&lt;BR /&gt;+-    p_ff_pic-&amp;gt;opaque = 0;&lt;BR /&gt;++    p_ff_pic-&amp;gt;opaque = NULL;&lt;BR /&gt;++&lt;BR /&gt;++    if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++    {&lt;BR /&gt;++        if( VaSetup( p_sys-&amp;gt;p_va,&lt;BR /&gt;++                     &amp;amp;p_sys-&amp;gt;p_context-&amp;gt;hwaccel_context,  &lt;BR /&gt;&amp;amp;p_dec-&amp;gt;fmt_out.video.i_chroma,&lt;BR /&gt;++                     p_sys-&amp;gt;p_context-&amp;gt;width, p_sys-&amp;gt;p_context-&amp;gt;height ) )&lt;BR /&gt;++        {&lt;BR /&gt;++            msg_Err( p_dec, "VaSetup failed" );&lt;BR /&gt;++            return -1;&lt;BR /&gt;++        }&lt;BR /&gt;++&lt;BR /&gt;++        /* */&lt;BR /&gt;++        p_ff_pic-&amp;gt;type = FF_BUFFER_TYPE_USER;&lt;BR /&gt;++        /* FIXME what is that, should give good value */&lt;BR /&gt;++        p_ff_pic-&amp;gt;age = 256*256*256*64; // FIXME FIXME from ffmpeg&lt;BR /&gt;+&lt;BR /&gt;+-    /* Not much to do in indirect rendering mode */&lt;BR /&gt;+-    if( !p_sys-&amp;gt;b_direct_rendering )&lt;BR /&gt;++        if( VaGrabSurface( p_sys-&amp;gt;p_va, p_ff_pic ) )&lt;BR /&gt;++        {&lt;BR /&gt;++            msg_Err( p_dec, "VaGrabSurface failed" );&lt;BR /&gt;++            return -1;&lt;BR /&gt;++        }&lt;BR /&gt;++        return 0;&lt;BR /&gt;++    }&lt;BR /&gt;++    else if( !p_sys-&amp;gt;b_direct_rendering )&lt;BR /&gt;+     {&lt;BR /&gt;++        /* Not much to do in indirect rendering mode */&lt;BR /&gt;+         return avcodec_default_get_buffer( p_context, p_ff_pic );&lt;BR /&gt;+     }&lt;BR /&gt;+&lt;BR /&gt;+@@ -1012,20 +1065,30 @@&lt;BR /&gt;+                                     AVFrame *p_ff_pic )&lt;BR /&gt;+ {&lt;BR /&gt;+     decoder_t *p_dec = (decoder_t *)p_context-&amp;gt;opaque;&lt;BR /&gt;++    decoder_sys_t *p_sys = p_dec-&amp;gt;p_sys;&lt;BR /&gt;++&lt;BR /&gt;++    if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++    {&lt;BR /&gt;++        VaUngrabSurface( p_sys-&amp;gt;p_va, p_ff_pic );&lt;BR /&gt;+&lt;BR /&gt;+-    if( !p_ff_pic-&amp;gt;opaque )&lt;BR /&gt;++        /* */&lt;BR /&gt;++        for( int i = 0; i &amp;lt; 4; i++ )&lt;BR /&gt;++            p_ff_pic-&amp;gt;data&lt;I&gt; = NULL;&lt;BR /&gt;++    }&lt;BR /&gt;++    else if( !p_ff_pic-&amp;gt;opaque )&lt;BR /&gt;+     {&lt;BR /&gt;+         avcodec_default_release_buffer( p_context, p_ff_pic );&lt;BR /&gt;+-        return;&lt;BR /&gt;+     }&lt;BR /&gt;++    else&lt;BR /&gt;++    {&lt;BR /&gt;++        picture_t *p_pic = (picture_t*)p_ff_pic-&amp;gt;opaque;&lt;BR /&gt;+&lt;BR /&gt;+-    picture_t *p_pic = (picture_t*)p_ff_pic-&amp;gt;opaque;&lt;BR /&gt;+-    decoder_UnlinkPicture( p_dec, p_pic );&lt;BR /&gt;++        decoder_UnlinkPicture( p_dec, p_pic );&lt;BR /&gt;+&lt;BR /&gt;+-    p_ff_pic-&amp;gt;data[0] = NULL;&lt;BR /&gt;+-    p_ff_pic-&amp;gt;data[1] = NULL;&lt;BR /&gt;+-    p_ff_pic-&amp;gt;data[2] = NULL;&lt;BR /&gt;+-    p_ff_pic-&amp;gt;data[3] = NULL;&lt;BR /&gt;++        /* */&lt;BR /&gt;++        for( int i = 0; i &amp;lt; 4; i++ )&lt;BR /&gt;++            p_ff_pic-&amp;gt;data&lt;I&gt; = NULL;&lt;BR /&gt;++    }&lt;BR /&gt;+ }&lt;BR /&gt;+&lt;BR /&gt;+ static void ffmpeg_NextPts( decoder_t *p_dec )&lt;BR /&gt;+@@ -1052,3 +1115,53 @@&lt;BR /&gt;+             (2 * p_sys-&amp;gt;p_context-&amp;gt;time_base.den);&lt;BR /&gt;+     }&lt;BR /&gt;+ }&lt;BR /&gt;++&lt;BR /&gt;++static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_codec,&lt;BR /&gt;++                                          const enum PixelFormat *pi_fmt )&lt;BR /&gt;++{&lt;BR /&gt;++    decoder_t *p_dec = p_codec-&amp;gt;opaque;&lt;BR /&gt;++    decoder_sys_t *p_sys = p_dec-&amp;gt;p_sys;&lt;BR /&gt;++&lt;BR /&gt;++    if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++    {&lt;BR /&gt;++        VaDelete( p_sys-&amp;gt;p_va );&lt;BR /&gt;++        p_sys-&amp;gt;p_va = NULL;&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    /* Try too look for a supported hw acceleration */&lt;BR /&gt;++    for( int i = 0; pi_fmt&lt;I&gt; != PIX_FMT_NONE; i++ )&lt;BR /&gt;++    {&lt;BR /&gt;++        static const char *ppsz_name[PIX_FMT_NB] = {&lt;BR /&gt;++            [PIX_FMT_VDPAU_H264] = "PIX_FMT_VDPAU_H264",&lt;BR /&gt;++            [PIX_FMT_VAAPI_IDCT] = "PIX_FMT_VAAPI_IDCT",&lt;BR /&gt;++            [PIX_FMT_VAAPI_VLD] = "PIX_FMT_VAAPI_VLD",&lt;BR /&gt;++            [PIX_FMT_VAAPI_MOCO] = "PIX_FMT_VAAPI_MOCO",&lt;BR /&gt;++            [PIX_FMT_YUYV422] = "PIX_FMT_YUYV422",&lt;BR /&gt;++            [PIX_FMT_YUV420P] = "PIX_FMT_YUV420P",&lt;BR /&gt;++        };&lt;BR /&gt;++        msg_Dbg( p_dec, "Available decoder output format %d (%s)",  &lt;BR /&gt;pi_fmt&lt;I&gt;, ppsz_name[pi_fmt&lt;I&gt;] ?: "Unknown" );&lt;BR /&gt;++&lt;BR /&gt;++        /* Only VLD supported */&lt;BR /&gt;++        if( pi_fmt&lt;I&gt; == PIX_FMT_VAAPI_VLD )&lt;BR /&gt;++        {&lt;BR /&gt;++            msg_Dbg( p_dec, "Trying VA API" );&lt;BR /&gt;++            p_sys-&amp;gt;p_va = VaNew( p_sys-&amp;gt;i_codec_id );&lt;BR /&gt;++            if( p_sys-&amp;gt;p_va )&lt;BR /&gt;++            {&lt;BR /&gt;++                /* FIXME this will disabled direct rendering&lt;BR /&gt;++                 * even if a new pixel format is renegociated&lt;BR /&gt;++                 *&lt;BR /&gt;++                 * FIXME Try to call VaSetup when possible&lt;BR /&gt;++                 * to detect errors when possible (later is too late) */&lt;BR /&gt;++                p_sys-&amp;gt;b_direct_rendering = false;&lt;BR /&gt;++                p_sys-&amp;gt;p_context-&amp;gt;draw_horiz_band = NULL;&lt;BR /&gt;++                return pi_fmt&lt;I&gt;;&lt;BR /&gt;++            }&lt;BR /&gt;++            msg_Warn( p_dec, "Failed to open VA API" );&lt;BR /&gt;++        }&lt;BR /&gt;++    }&lt;BR /&gt;++&lt;BR /&gt;++    /* Fallback to default behaviour */&lt;BR /&gt;++    return avcodec_default_get_format( p_codec, pi_fmt );&lt;BR /&gt;++}&lt;BR /&gt;++&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.blowdata4u.com" target="_blank"&gt;http://www.blowdata4u.com&lt;/A&gt;&lt;BR /&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/FFMPEG&gt;&lt;/LIBAVCODEC&gt;&lt;/LIBAVCODEC&gt;&lt;/ASSERT.H&gt;&lt;/VLC_AVCODEC.H&gt;&lt;/VLC_CODECS.H&gt;&lt;/VLC_VOUT.H&gt;&lt;/FENRIR_AT_&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/VA&gt;&lt;/X11&gt;&lt;/AVCODEC.H&gt;&lt;/FFMPEG&gt;&lt;/LIBAVCODEC&gt;&lt;/LIBAVCODEC&gt;&lt;/ASSERT.H&gt;&lt;/VLC_VOUT.H&gt;&lt;/VLC_COMMON.H&gt;&lt;/FENRIR_AT_&gt;&lt;/EM&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Hi Thanq for your reply&lt;BR /&gt;&lt;BR /&gt;but i am trying with MPlayer not with vlc.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Dec 2009 05:12:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900484#M10996</guid>
      <dc:creator>Rajkumar</dc:creator>
      <dc:date>2009-12-22T05:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Mplayer performance with VAAPI support</title>
      <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900485#M10997</link>
      <description>Thanks for the good opportunity to learn from you posts. &lt;BR /&gt;regards &lt;BR /&gt;&lt;A href="http://essayshelp.org/service.php"&gt;online essay service&lt;/A&gt;</description>
      <pubDate>Tue, 22 Dec 2009 07:49:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900485#M10997</guid>
      <dc:creator>duzyatko2yahoo_com</dc:creator>
      <dc:date>2009-12-22T07:49:04Z</dc:date>
    </item>
    <item>
      <title>How to Transfer SMS/ Contacts for Windows Mobile Phone</title>
      <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900486#M10998</link>
      <description>&lt;P&gt;3GMobile SMS + Contacts Backup is an app used to backup sms and outlook contacts on windows mobile. You could use this software to save your mobile outlook contacts and sms as .xml or txt file;Restore sms and outlook contacts from pc to mobile phone;Manage sms &amp;amp; outlook contacts on pc.&lt;/P&gt;
&lt;P&gt;With 3GMobile SMS + Contacts Backup, you can:&lt;/P&gt;
&lt;P&gt;Backup SMS Messages for windows mobile into txt file or .xml backup file and save onto your computer&lt;/P&gt;
&lt;P&gt;Restore SMS Messages from a .xml backup file&lt;/P&gt;
&lt;P&gt;Support all SMS default folders (Inbox, Outbox, Drafts, Sent Items, Deleted Items) and custom folders.&lt;/P&gt;
&lt;P&gt;Export your outlook contacts into txt file or .xml backup file format and save onto your pc&lt;/P&gt;
&lt;P&gt;Edit outlook contacts info on computer directly&lt;/P&gt;
&lt;P&gt;Restore outlook contacts from the .xml backup file&lt;/P&gt;
&lt;P&gt;Support unlimited outlook contacts and SMS backup/restore.&lt;/P&gt;
&lt;P&gt;Fast backup and restore speed&lt;/P&gt;
&lt;P&gt;Fully Support Windows Mobile 5/6.0/6.1/6.5&lt;/P&gt;
&lt;P&gt;Easy to use&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.3gmobiletool.com/" target="_blank"&gt;https://www.3gmobiletool.com/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2010 10:53:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900486#M10998</guid>
      <dc:creator>cobby034</dc:creator>
      <dc:date>2010-01-14T10:53:58Z</dc:date>
    </item>
    <item>
      <title>How To Convert or Rip Blu-ray DVD to HD AVI, HD WMV, HD MPEG, H</title>
      <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900487#M10999</link>
      <description>&lt;P&gt;Have you ever been confused about how to convert or rip Blu-ray dvd movies to HD (High Definition) videos such as HD WMV, HD MOV, HD AVI, HD H.264/MPEG-4 AVC, MPEG-2 TS HD Video, etc.? Here we'd like to introduce you a powerful and easy-to use Blu-ray to HD Video Converter software - BestHD &lt;A href="http://www.besthdsoft.com/blu-ray-to-hd-video-converter.html"&gt;&lt;I&gt;&lt;B&gt;Blu-Ray To HD Video&lt;/B&gt;&lt;/I&gt;&lt;/A&gt; which can help you rip and convert Blu-ray movies to all popular HD and SD videos with high video and audio quality.&lt;/P&gt;
&lt;P&gt;During using course, I think there are many profits to be praised! The followings are some ranks I list!&lt;/P&gt;
&lt;P&gt;Convert Blu-ray and general DVD movie to more HD Video formats, as HD AVI, HD MPEG-4, HD MPEG-4 AVCHD MOV, HD MPEG-2 TS, HD MPEG2, HD WMV. &lt;BR /&gt; Set begin and end time to convert any part you like &lt;BR /&gt; Convert with higher definition and conversion speed. &lt;BR /&gt; Preview your movies. &lt;BR /&gt; Select windows mode you like after conversion from output settings. &lt;BR /&gt; Capture beautiful pictures from your movie to enrich your collection.&lt;/P&gt;
&lt;P&gt;More info you can visit: &lt;A href="http://www.besthdsoft.com/"&gt;http://www.besthdsoft.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;More Blu-ray Ripper software reviews: &lt;A href="http://blurayripper.blogspot.com/"&gt;http://blurayripper.blogspot.com/&lt;/A&gt;&lt;BR clear="all" /&gt;&lt;/P&gt;
&lt;P&gt;More Related Products : * &lt;A href="http://www.besthdsoft.com/best-hd-blu-ray-dvd-ripper.html"&gt;Blu-ray*&lt;/A&gt; * &lt;A href="http://www.besthdsoft.com/best-hd-blu-ray-ripper.html"&gt;Blu-ray To HD Video&lt;/A&gt; * &lt;A href="http://www.besthdsoft.com/best-hd-blu-ray-ripper.html"&gt;Blu-ray Converter&lt;/A&gt; * &lt;A href="http://www.besthdsoft.com/blu-ray-to-avi-converter.html"&gt;Blu-ray To AVI&lt;/A&gt; *&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jan 2010 02:09:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900487#M10999</guid>
      <dc:creator>hope2010s</dc:creator>
      <dc:date>2010-01-16T02:09:30Z</dc:date>
    </item>
    <item>
      <title>To share my experience of Blu-ray to ipod converter, Want to he</title>
      <link>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900488#M11000</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I have always wanted an iPod classic, but the price was really scary. I dont think I can afford that in the recent 3 months. So the only thing I did was taking my boyfriend to the iPod store "by Accident", then I almost looked at that iPod for 2 minutes, I guess he got my intention, so the next thing I did was waiting. I have to say that I am not proud of that, but I dont do that a lot, I only do it when I really like something and the price is way too high for me. All I need to do is going to the store with my BF accidently and staring at the thing I want, then, I know it will just show up when we have dinner or watching movie at home. It works all the time. So I was not surprised that the iPod I wanted for so long was lying in my Christmas socks. I like so much, and its capacity is like 160Gega Bytes. I can put all the things I like watching and listening in it. But I have to say I am really not good at electronic products, I copied all the things I like from my blue ray DVD to my iPod, but it didn't work, I couldn't play them. That really drove me crazy, I have to ask help from my boyfriend. Since he was working when I called him, he didn't answer, instead, he sent me a website address:http://www.besthdsoft.com.&lt;/P&gt;
&lt;P&gt;I checked it, surprisingly, I found something is just designed for converting &lt;A href="http://www.besthdsoft.com/blu-ray-to-ipod-converter.html"&gt;blu-ray to iPod&lt;/A&gt;. I was really excited about that, plus they were having 15% off discount at that time. What I also like about that BestHDsoft website was that the instruction was really useful for someone like me who knows nothing about electronic products, they even have images guiding people how to do it step by step. After I read those detail instructions, I decided to get one for myself. Now I am&lt;BR /&gt; always busy with watching the latest movies and listening to my favorite music, I guess my boyfriend is actually getting jealous because I spend so much time with my&lt;BR /&gt; iPod.&lt;/P&gt;
&lt;P&gt;More info you can visit: &lt;A href="http://www.besthdsoft.com/"&gt;http://www.besthdsoft.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;More Blu-ray Ripper software reviews: &lt;A href="http://blurayripper.blogspot.com/"&gt;http://blurayripper.blogspot.com/&lt;/A&gt;&lt;BR clear="all" /&gt;&lt;/P&gt;
&lt;P&gt;More Related Products :&lt;A href="http://www.besthdsoft.com/best-hd-blu-ray-ripper.html"&gt;Blu-Ray Ripper&lt;/A&gt;, &lt;A href="http://www.besthdsoft.com/blu-ray-to-avi-converter.html"&gt;Blu-Ray To AVI&lt;/A&gt;, &lt;A href="http://www.besthdsoft.com/blu-ray-to-ipod-converter.html"&gt;Blu-Ray To iPod&lt;/A&gt;, &lt;A href="http://www.besthdsoft.com/blu-ray-to-mp3-converter.html"&gt;Blu-Ray To MP3&lt;/A&gt;, &lt;A href="http://www.besthdsoft.com/blu-ray-to-mp4-converter.html"&gt;Blu-Ray To MP4&lt;/A&gt;, &lt;A href="http://www.besthdsoft.com/blu-ray-to-mpeg-converter.html"&gt;Blu-Ray To MPEG&lt;/A&gt;, &lt;A href="http://www.besthdsoft.com/blu-ray-to-ps3-converter.html"&gt;Blu-Ray To PS3&lt;/A&gt;, &lt;A href="http://www.besthdsoft.com/blu-ray-to-wmv-converter.html"&gt;Blu-Ray To WMV&lt;/A&gt;, &lt;A href="http://www.besthdsoft.com/blu-ray-to-hd-video-converter.html"&gt;Blu-Ray To HD Video&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jan 2010 02:10:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Media-Tips-and-Tricks/m-p/900488#M11000</guid>
      <dc:creator>hope2010s</dc:creator>
      <dc:date>2010-01-16T02:10:38Z</dc:date>
    </item>
  </channel>
</rss>

