README_MOZILLA
1This directory contains files used in gecko builds from FFmpeg
2(http://ffmpeg.org). The current files are from FFmpeg as of
3revision n4.2.2-1-g19bfd72126
4git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
5git checkout n4.2.2-1-g19bfd72126
6
7All source files match their path from the library's source archive.
8
9Currently, we only use the vp8, vp9, mp3, and flac portion of the library. If
10this changes, configuration files will most likely need to be updated.
11
12AVX2 must be disabled on Linux 32 bits due to the use of yasm 1.1 on the build bots.
13Once yasm is upgraded to 1.2 or later, AVX2 code could be re-enabled.
14Add --disable-avx2 to configure on those platforms.
15
16configuration files were generated as follow using the configure script:
17 ./configure --disable-all --enable-avcodec --enable-decoder=vp8,vp9,mp3,flac \
18 --enable-parser=vp8,vp9 --disable-static --enable-shared \
19 --disable-autodetect
20config*:
21replace: /HAVE_(MALLOC_H|ARC4RANDOM|LOCALTIME_R|MEMALIGN|POSIX_MEMALIGN)/d
22# sed -i bak -E '/HAVE_(MALLOC_H|ARC4RANDOM|LOCALTIME_R|MEMALIGN|POSIX_MEMALIGN)/d' config.h
23
24config_unix32.h:
25add to configure command: --disable-asm --disable-x86asm --cc='clang -m32'
26
27config_android32.h: Only mp3 and flac are enabled on this platform.
28./configure --disable-all --enable-avcodec --enable-decoder=mp3,flac \
29 --disable-static --enable-shared --disable-autodetect \
30 --enable-small --target-os=linux --arch=arm --enable-cross-compile \
31 --cc=$HOME/.mozbuild/android-ndk-r20/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi16-clang
32
33config_unix32.h/config_unix64.h/config_unix64.asm:
34replace: s/HAVE_SYSCTL 1/HAVE_SYSCTL 0
35
36config_win{32|64}.{h|asm}:
37add to configure command: --toolchain=msvc
38
39config_aarch64_win64.h: You will need to install cpp (either using msys or wsl)
40./configure --disable-all --enable-avcodec --enable-decoder=vp8,vp9,mp3,flac \
41 --enable-parser=vp8,vp9 --disable-static --enable-shared \
42 --disable-autodetect --toolchain=msvc --enable-cross-compile \
43 --target-os=win32 --arch=arm64
44
45Regenerate defaults_disabled.{h,asm} with:
46$ grep -E ".*_(INDEV|OUTDEV|DECODER|ENCODER|DEMUXER|MUXER|PARSER|FILTER|HWACCEL|PROTOCOL|ENCODERS|DECODERS|HWACCELS|INDEVS|OUTDEVS|FILTERS|DEMUXERS|MUXERS|PROTOCOLS|BSF) 0" config.h | sort -d -u > ~/Work/Mozilla/mozilla-central/media/ffvpx/defaults_disabled.h
47$ grep -E ".*_(INDEV|OUTDEV|DECODER|ENCODER|DEMUXER|MUXER|PARSER|FILTER|HWACCEL|PROTOCOL|ENCODERS|DECODERS|HWACCELS|INDEVS|OUTDEVS|FILTERS|DEMUXERS|MUXERS|PROTOCOLS|BSF) 0" config.asm | sort -d -u > ~/Work/Mozilla/mozilla-central/media/ffvpx/defaults_disabled.asm
48
49The GNU comm utility is a useful tool to compare and extract only the changes.
50
51To update the source tree, perform a diff on the files listed in FILES.
52The diffs should typically apply to the ffvpx tree.
53e.g. something like this would do:
54Run in the ffmpeg original tree:
55$ for i in `cat $PATH_CENTRAL/media/ffvpx/FILES`; do git diff $REV_LASTSYNC HEAD >> patch.diff; done
56Then apply patch.diff on the ffvpx tree.
57
58You can also directly copy existing files from new ffmpeg checkout by rsync:
59rsync -av --existing ffmpeg-new-dif ffmpeg-mozilla-dir
60
61Compilation will reveal if any files are missing.
62
63Apply linux-vaapi-build.patch patch to enable build VA-API support for Linux.
64