blob: a3b08056030b2468e22f1a5b0954ed1b927f472d [file] [log] [blame] [view]
andybons3322f762015-08-24 21:37:091# Enabling hardware
2
3<video>
4
5 decode codepaths on linux
6
7Hardware acceleration of video decode on linux is [unsupported](http://crbug.com/137247) in Chrome for user-facing builds. During development (targeting other platforms) it can be useful to be able to trigger the code-paths used on HW-accelerated platforms (such as CrOS and win7) in a linux-based development environment. Here's one way to do so, with details based on a gprecise setup.
8
9 * Install pre-requisites: On Ubuntu Precise, at least, this includes:
10```
11sudo apt-get install libtool libvdpau1 libvdpau-dev
12```
13
14 * Install and configure [libva](http://cgit.freedesktop.org/libva/)
15```
16DEST=${HOME}/apps/libva
17cd /tmp
18git clone git://anongit.freedesktop.org/libva
19cd libva
20git reset --hard libva-1.2.1
21./autogen.sh && ./configure --prefix=${DEST}
22make -j32 && make install
23```
24 * Install and configure the [VDPAU](http://cgit.freedesktop.org/vaapi/vdpau-driver) VAAPI driver
25```
26DEST=${HOME}/apps/libva
27cd /tmp
28git clone git://anongit.freedesktop.org/vaapi/vdpau-driver
29cd vdpau-driver
30export PKG_CONFIG_PATH=${DEST}/lib/pkgconfig/:$PKG_CONFIG_PATH
31export LIBVA_DRIVERS_PATH=${DEST}/lib/dri
32export LIBVA_X11_DEPS_CFLAGS=-I${DEST}/include
33export LIBVA_X11_DEPS_LIBS=-L${DEST}/lib
34export LIBVA_DEPS_CFLAGS=-I${DEST}/include
35export LIBVA_DEPS_LIBS=-L${DEST}/lib
36make distclean
37unset CC CXX
38./autogen.sh && ./configure --prefix=${DEST} --enable-debug
39find . -name Makefile |xargs sed -i 'sI/usr/lib/xorg/modules/driversI${DEST}/lib/driIg'
40sed -i -e 's/_(\(VAEncH264VUIBufferType\|VAEncH264SEIBufferType\));//' src/vdpau_dump.c
41make -j32 && rm -f ${DEST}/lib/dri/{nvidia_drv_video.so,s3g_drv_video.so} && make install
42```
43 * Add to `$GYP_DEFINES`:
44 * `chromeos=1` to link in `VaapiVideoDecodeAccelerator`
45 * `proprietary_codecs=1 ffmpeg_branding=Chrome` to allow Chrome to play h.264 content, which is the only codec VAVDA knows about today.
46 * Re-run gyp (`./build/gyp_chromium` or `gclient runhooks`)
47 * Rebuild chrome
48 * Run chrome with `LD_LIBRARY_PATH=${HOME}/apps/libva/lib` in the environment, and with the --no-sandbox command line flag.
49 * If things don't work, a Debug build (to include D\*LOG's) with `--vmodule=*content/common/gpu/media/*=10,gpu_video*=1` might be enlightening.
50
51# NOTE THIS IS AN UNSUPPORTED CONFIGURATION AND LIKELY TO BE BROKEN AT ANY POINT IN TIME
52
53This page is purely here to help developers targeting supported HW
54
55<video>
56
57 decode platforms be more effective. Do not expect help if this setup fails to work.