Skip to content

Commit

Permalink
contrib: add zimg.
Browse files Browse the repository at this point in the history
  • Loading branch information
galad87 committed Jan 23, 2021
1 parent 00beb1c commit 581f601
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 6 deletions.
13 changes: 10 additions & 3 deletions contrib/ffmpeg/module.defs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__deps__ := BZIP2 ZLIB FDKAAC LIBDAV1D LIBVPX LAME LIBOPUS LIBSPEEX XZ
__deps__ := BZIP2 ZLIB FDKAAC LIBDAV1D LIBVPX LAME LIBOPUS LIBSPEEX XZ ZIMG
ifeq (1,$(FEATURE.qsv))
__deps__ += LIBMFX
endif
Expand Down Expand Up @@ -34,6 +34,7 @@ FFMPEG.CONFIGURE.extra = \
--disable-avdevice \
--disable-muxers \
--disable-network \
--enable-libzimg \
--disable-hwaccels \
--disable-vdpau \
--disable-encoders \
Expand All @@ -58,7 +59,7 @@ FFMPEG.CONFIGURE.extra = \
--enable-libdav1d \
--enable-decoder=libdav1d \
--cc="$(FFMPEG.GCC.gcc)" \
--extra-ldflags="$(call fn.ARGS,FFMPEG.GCC,*archs *sysroot *minver ?extra) -L$(call fn.ABSOLUTE,$(CONTRIB.build/)lib)"
--extra-ldflags="$(call fn.ARGS,FFMPEG.GCC,*archs *sysroot *minver ?extra) -L$(call fn.ABSOLUTE,$(CONTRIB.build/)lib) $(FFMPEG.GCC.args.extra-ldflags)"

ifeq (size-aggressive,$(GCC.O))
FFMPEG.CONFIGURE.extra += \
Expand Down Expand Up @@ -111,8 +112,14 @@ else ifeq (1-mingw,$(HOST.cross)-$(HOST.system))
--target-os=mingw32 \
--arch=$(HOST.machine) \
--cross-prefix=$(HOST.cross.prefix) \
--pkg-config=$(PKGCONFIG.exe)
--pkg-config=$(PKGCONFIG.exe) \
--pkg-config-flags="--static"
FFMPEG.GCC.args.extra += -fno-common
FFMPEG.GCC.args.extra-ldflags = -static-libgcc -static-libstdc++ -static
else ifeq (darwin,$(HOST.system))
FFMPEG.GCC.args.extra-ldflags = -lc++
else
FFMPEG.CONFIGURE.extra += --extra-libs="-lm -lstdc++"
endif

ifneq (none,$(FFMPEG.GCC.g))
Expand Down
18 changes: 18 additions & 0 deletions contrib/zimg/module.defs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
$(eval $(call import.MODULE.defs,ZIMG,zimg))
$(eval $(call import.CONTRIB.defs,ZIMG))

ZIMG.FETCH.url = https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs/zimg-3.0.1.tar.gz
ZIMG.FETCH.url += https://github.com/sekrit-twc/zimg/archive/release-3.0.1.tar.gz
ZIMG.FETCH.sha256 = c50a0922f4adac4efad77427d13520ed89b8366eef0ef2fa379572951afcc73f
ZIMG.EXTRACT.tarbase = zimg-release-3.0.1

ZIMG.CONFIGURE.bootstrap = rm -fr aclocal.m4 autom4te.cache configure; autoreconf -fiv;

ZIMG.CONFIGURE.extra += --enable-static --disable-shared

ifeq (darwin,$(HOST.system))
ifneq ($(HOST.machine),$(BUILD.machine))
ZIMG.CONFIGURE.args.host = --host=$(HOST.machine:arm64=aarch64)-$(HOST.vendor)-$(HOST.system)
ZIMG.CONFIGURE.args.build = --build=$(BUILD.machine:arm64=aarch64)-$(BUILD.vendor)-$(BUILD.system)
endif
endif
2 changes: 2 additions & 0 deletions contrib/zimg/module.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$(eval $(call import.MODULE.rules,ZIMG))
$(eval $(call import.CONTRIB.rules,ZIMG))
2 changes: 1 addition & 1 deletion gtk/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ AM_CONDITIONAL([GHB_GTK_3_16], [test "$HAVE_GTK_316" -eq 1])

AM_CONDITIONAL([MINGW], [test "x$mingw_flag" = "xyes"])

HB_LIBS="$HB_LIBS -lhandbrake -lavformat -lavfilter -lavcodec -lavutil -ldav1d -lswresample -lpostproc -ldvdnav -ldvdread -lmp3lame -lvorbis -lvorbisenc -logg -lswscale -ltheoraenc -ltheoradec -lvpx -lz -lbz2 -lbluray -lass -lfontconfig -lfreetype -lxml2 -ljansson -lopus -lspeex -lturbojpeg -llzma"
HB_LIBS="$HB_LIBS -lhandbrake -lavformat -lavfilter -lavcodec -lavutil -ldav1d -lswresample -lpostproc -ldvdnav -ldvdread -lmp3lame -lvorbis -lvorbisenc -logg -lswscale -ltheoraenc -ltheoradec -lvpx -lz -lbz2 -lbluray -lass -lfontconfig -lfreetype -lxml2 -ljansson -lopus -lspeex -lturbojpeg -llzma -lzimg"
HB_CPPFLAGS="$HB_CPPFLAGS $HBINC"

PKG_CHECK_MODULES([x264], [x264], sys_x264=yes, sys_x264=no)
Expand Down
2 changes: 1 addition & 1 deletion libhb/module.defs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ LIBHB.lib = $(LIBHB.build/)hb.lib
LIBHB.dll.libs = $(foreach n, \
ass avformat avfilter avcodec avutil swresample postproc dvdnav dvdread \
freetype mp3lame swscale vpx theora vorbis vorbisenc ogg x264 xml2 \
bluray jansson harfbuzz opus speex dav1d turbojpeg, \
bluray jansson harfbuzz opus speex dav1d turbojpeg zimg, \
$(CONTRIB.build/)lib/lib$(n).a )

ifeq (1,$(FEATURE.fdk_aac))
Expand Down
8 changes: 8 additions & 0 deletions macosx/HandBrake.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@
A98C29C41977B10600AF5DED /* HBLanguagesSelection.m in Sources */ = {isa = PBXBuildFile; fileRef = A98C29C31977B10600AF5DED /* HBLanguagesSelection.m */; };
A9906B2C1A710920001D82D5 /* HBQueueController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9906B2B1A710920001D82D5 /* HBQueueController.m */; };
A990C55322FF4FBA00E07CE2 /* HandBrakeKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9736F021C7DA5FE008F1D18 /* HandBrakeKit.framework */; };
A9935865256C346F00A6875E /* libzimg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9935852256C346F00A6875E /* libzimg.a */; };
A9935866256C347800A6875E /* libzimg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9935852256C346F00A6875E /* libzimg.a */; };
A99F40CF1B624E7E00750170 /* HBPictureViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A99F40CD1B624E7E00750170 /* HBPictureViewController.m */; };
A9A0CBE81CCEA3670045B3DF /* HBPlayerTrack.m in Sources */ = {isa = PBXBuildFile; fileRef = A9A0CBE61CCEA1D10045B3DF /* HBPlayerTrack.m */; };
A9A25D9C21182741005A8A0F /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9A25D9B21182741005A8A0F /* CoreMedia.framework */; };
Expand Down Expand Up @@ -899,6 +901,8 @@
A990C55222FF4EBA00E07CE2 /* HandBrakeXPCService.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = HandBrakeXPCService.entitlements; sourceTree = "<group>"; };
A990D9051A64562200139032 /* HBJob+HBJobConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "HBJob+HBJobConversion.h"; sourceTree = "<group>"; };
A990D9061A64562200139032 /* HBJob+HBJobConversion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "HBJob+HBJobConversion.m"; sourceTree = "<group>"; };
A9935852256C346F00A6875E /* libzimg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libzimg.a; path = external/contrib/lib/libzimg.a; sourceTree = "<group>"; };
A9935867256C349B00A6875E /* libzimg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libzimg.a; path = external/contrib/lib/libzimg.a; sourceTree = BUILT_PRODUCTS_DIR; };
A99422DE1B1887B000DDB077 /* NSJSONSerialization+HBAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSJSONSerialization+HBAdditions.h"; sourceTree = "<group>"; };
A99422DF1B1887B000DDB077 /* NSJSONSerialization+HBAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSJSONSerialization+HBAdditions.m"; sourceTree = "<group>"; };
A997D8EB1A4ABB0900E19B6F /* HBPresetCoding.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HBPresetCoding.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1156,6 +1160,7 @@
27D6C77314B102DA00B785E4 /* libxml2.a in Frameworks */,
A955128B1A320B02001BFC6F /* libjansson.a in Frameworks */,
1C6D76551CD7733300F5B943 /* libharfbuzz.a in Frameworks */,
A9935865256C346F00A6875E /* libzimg.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1246,6 +1251,7 @@
A91CE2C81C7DABBC0068F46F /* libx264.a in Frameworks */,
A91CE2C91C7DABBC0068F46F /* libx265.a in Frameworks */,
A91CE2CA1C7DABBC0068F46F /* libxml2.a in Frameworks */,
A9935866256C347800A6875E /* libzimg.a in Frameworks */,
A91CE2B11C7DAA530068F46F /* libhandbrake.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -1293,6 +1299,7 @@
A95512881A320A12001BFC6F /* libjansson.a */,
A9E165511C523016003EF30E /* libavfilter.a */,
1C15C82B1CD7722500368223 /* libharfbuzz.a */,
A9935867256C349B00A6875E /* libzimg.a */,
);
name = "Static Libraries";
sourceTree = "<group>";
Expand Down Expand Up @@ -1350,6 +1357,7 @@
273F203414ADBAC30021BE6D /* Frameworks */ = {
isa = PBXGroup;
children = (
A9935852256C346F00A6875E /* libzimg.a */,
A9442CDD24DABFED005EDF62 /* Sparkle.xcodeproj */,
A9A25D9B21182741005A8A0F /* CoreMedia.framework */,
A9AB9AA721181CC700BB3C7E /* CoreVideo.framework */,
Expand Down
1 change: 1 addition & 0 deletions make/include/main.defs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ ifeq (1,$(FEATURE.x265))
endif

MODULES += contrib/libdav1d
MODULES += contrib/zimg
MODULES += contrib/ffmpeg
MODULES += contrib/libdvdread
MODULES += contrib/libdvdnav
Expand Down
2 changes: 1 addition & 1 deletion test/module.defs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ TEST.GCC.l = \
ass avformat avfilter avcodec avutil swresample postproc mp3lame dvdnav \
dvdread fribidi swscale vpx theoraenc theoradec vorbis vorbisenc ogg \
x264 bluray freetype xml2 bz2 z jansson harfbuzz opus speex lzma dav1d \
turbojpeg
turbojpeg zimg

ifeq (,$(filter $(HOST.system),darwin cygwin mingw))
TEST.GCC.l += fontconfig
Expand Down

0 comments on commit 581f601

Please sign in to comment.