-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented build script and module map to support embedding FFmpeg i…
…n the Optimus Player macOS app
- Loading branch information
Darren Mo
committed
Nov 8, 2019
1 parent
1529dfb
commit 6ab4722
Showing
3 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,4 @@ | |
/src | ||
/mapfile | ||
/tools/python/__pycache__/ | ||
/optimus-player-build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# A script to build FFmpeg so that it may be embedded in the | ||
# Optimus Player macOS app. | ||
# | ||
# Copyright (c) 2019 Darren Mo. Licensed under LGPL version 2.1. | ||
# | ||
# TODO: Enable the following external libraries in order to | ||
# support more formats/codecs/protocols. | ||
# AV1: libdav1d | ||
# AviSynth: libavxsynth | ||
# BluRay: libbluray | ||
# CELT: libcelt | ||
# codec2: libcodec2 | ||
# DASH: libxml2 | ||
# DVB teletext: libzvbi | ||
# Game Music Emu: libgme | ||
# Haivision SRT: libsrt | ||
# iLBC: libilbc | ||
# MOD: libopenmpt | ||
# SAMBA: libsmbclient | ||
# SFTP: libssh | ||
# Speex: libspeex | ||
# SVG: librsvg | ||
|
||
SCRIPT_DIR="$(dirname "$BASH_SOURCE")" | ||
cd "$SCRIPT_DIR" | ||
|
||
export DESTDIR="$SCRIPT_DIR/optimus-player-build" | ||
|
||
make clean | ||
rm -rf "$DESTDIR" | ||
|
||
./configure \ | ||
--prefix="/" \ | ||
--install-name-dir="@executable_path/../Frameworks" \ | ||
--disable-static \ | ||
--enable-shared \ | ||
--disable-programs \ | ||
--disable-doc \ | ||
--disable-avdevice \ | ||
--disable-swresample \ | ||
--disable-postproc \ | ||
--disable-avfilter \ | ||
--disable-w32threads \ | ||
--disable-os2threads \ | ||
--disable-encoders \ | ||
--disable-muxers \ | ||
--disable-devices \ | ||
--disable-filters \ | ||
--disable-amf \ | ||
--disable-cuvid \ | ||
--disable-d3d11va \ | ||
--disable-dxva2 \ | ||
--disable-ffnvcodec \ | ||
--disable-nvdec \ | ||
--disable-vaapi \ | ||
--disable-vdpau \ | ||
|| exit $? | ||
|
||
make install || exit $? | ||
|
||
cp module.modulemap "$DESTDIR/include/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
module CFFmpeg { | ||
explicit module AVCodec [system] [extern_c] { | ||
link "avcodec" | ||
link "avutil" | ||
link "iconv" | ||
link "lzma" | ||
link "m" | ||
link framework "AudioToolbox" | ||
link framework "CoreFoundation" | ||
link framework "CoreMedia" | ||
link framework "CoreServices" | ||
link framework "CoreVideo" | ||
link framework "VideoToolbox" | ||
|
||
umbrella "libavcodec" | ||
exclude header "libavcodec/d3d11va.h" | ||
exclude header "libavcodec/dxva2.h" | ||
exclude header "libavcodec/qsv.h" | ||
exclude header "libavcodec/vdpau.h" | ||
exclude header "libavcodec/xvmc.h" | ||
|
||
export * | ||
} | ||
|
||
explicit module AVFormat [system] [extern_c] { | ||
link "avcodec" | ||
link "avformat" | ||
link "avutil" | ||
link "bz2" | ||
link "m" | ||
link framework "CoreFoundation" | ||
link framework "Security" | ||
|
||
umbrella "libavformat" | ||
|
||
export * | ||
} | ||
|
||
explicit module AVUtil [system] [extern_c] { | ||
link "avutil" | ||
link "m" | ||
link framework "CoreFoundation" | ||
link framework "CoreMedia" | ||
link framework "CoreServices" | ||
link framework "CoreVideo" | ||
link framework "VideoToolbox" | ||
|
||
umbrella "libavutil" | ||
exclude header "libavutil/hwcontext_cuda.h" | ||
exclude header "libavutil/hwcontext_d3d11va.h" | ||
exclude header "libavutil/hwcontext_dxva2.h" | ||
exclude header "libavutil/hwcontext_qsv.h" | ||
exclude header "libavutil/hwcontext_vaapi.h" | ||
exclude header "libavutil/hwcontext_vdpau.h" | ||
|
||
export * | ||
} | ||
|
||
explicit module SWScale [system] [extern_c] { | ||
link "avutil" | ||
link "m" | ||
link "swscale" | ||
|
||
umbrella "libswscale" | ||
|
||
export * | ||
} | ||
} |