2OF1 · the depletionmode zineLinkedIn · X
← back to the issue

22 July 2010

Direct2D vout patch for VLC

Originally published on the old depletionmode / 2of1 blog (archived copy).

I submitted a Direct2D vout patch for inclusion in VLC.

Direct2D should in theory provide comparable performance to the Direct3D out.
The only issue at the moment is that there is no YUV conversion API within Direct2D itself – and Direct2D can’t deal with bitmaps in YUV format.
This means that it requires a YUV->RGB conversion on each frame – which is currently done in software.

The solution to this might be a Direct3D/Direct2D interop and I hope to explore this sometime in the future.

However one of the main advantages of Direct2D is the seamless software-render fallback.
This is especially useful for older machines and virtual machines.

Hopefully the patch will be included in VLC 1.2.0. In the meantime you can try it…

Get latest version of vlc from the git repro:

listing text
git clone git://git.videolan.org/vlc.git

Download D2D1 headers for MinGW and install:
Update: There is currently an issue with these headers. Read about it here…

listing text
tar xvjf 2of1-d2d1headers*.tar.gz
cd 2of1-d2d1headers-<hash>
cp *.h /usr/win32/include/

Get the patch and apply:

listing text
cd vlc
git apply 0001-Direct2D-video-output-module.patch

Change the extras/package/win32/configure-mingw.sh file to appear as follows:

listing text
#!/bin/sh
 
root=$(echo $0|sed 's#extras/package/win32/configure-mingw.sh##')./
 
if [ -n "$1" ]
then
	CONTRIBS="$1"
else
	CONTRIBS="/usr/win32"
fi
export CONTRIBS
 
PATH="$CONTRIBS/bin:$PATH" \
PKG_CONFIG_LIBDIR=$CONTRIBS/lib/pkgconfig \
CPPFLAGS="-I$CONTRIBS/include -I$CONTRIBS/include/ebml" \
LDFLAGS="-L$CONTRIBS/lib" \
CC=i586-mingw32msvc-gcc CXX=i586-mingw32msvc-g++ \
CONFIG="${root}configure --host=i586-mingw32msvc --build=i386-linux
 --disable-dirac --enable-mkv --enable-taglib --enable-debug --disable-projectm --disable-lub --enable-direct2d" \
sh ${root}extras/package/win32/configure-common.sh

Configure and compile:

listing text
sh extras/package/win32/configure-mingw.sh
make && make package-win32-base-zip

You should now have vlc-1.2.0-git-win32.zip ready for transfer to your Window Vista w/ PU or Windows 7 machine.

→ end of entry

2/1
@depletionmode
security research & systems engineering