Skip to content

Commit

Permalink
Merge branch 'master' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavriloaie Eugen-Andrei committed Feb 3, 2021
2 parents 30fdc0c + 59c0609 commit a5428f1
Show file tree
Hide file tree
Showing 204 changed files with 3,770 additions and 2,404 deletions.
254 changes: 254 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
stages:
- build
- test
- release

.variables-debian-amd64: &variables-debian-amd64
_TRIPLET: ""
_PLATFORMSUFFIX: ""
_WRAPPER: ""

.variables-debian-aarch64: &variables-debian-aarch64
_TRIPLET: ""
_PLATFORMSUFFIX: ""
_WRAPPER: ""

.variables-win32: &variables-win32
_TRIPLET: "i686-w64-mingw32"
_PLATFORMSUFFIX: ".exe"
_WRAPPER: "wine"
_CONTRIB_URL: "https://artifacts.videolan.org/vlc/win32/"

.variables-win64: &variables-win64
_TRIPLET: "x86_64-w64-mingw32"
_PLATFORMSUFFIX: ".exe"
_WRAPPER: "wine64"
_CONTRIB_URL: "https://artifacts.videolan.org/vlc/win64/"

.variables-win-armv7: &variables-win-armv7
_TRIPLET: "armv7-w64-mingw32"
_PLATFORMSUFFIX: ".exe"
_WRAPPER: ""

.variables-win-aarch64: &variables-win-aarch64
_TRIPLET: "aarch64-w64-mingw32"
_PLATFORMSUFFIX: ".exe"
_WRAPPER: ""

.variables-macos: &variables-macos
_TRIPLET: "x86_64-apple-darwin19"
_PLATFORMSUFFIX: ""
_WRAPPER: ""
_CONTRIB_URL: "https://artifacts.videolan.org/vlc/macos/"

.build:
stage: build
script: |
set -x
LOCAL_INSTALL_DIR=`pwd`/local_install
export PKG_CONFIG_LIBDIR=${LOCAL_INSTALL_DIR}/lib/pkgconfig
git clone --depth 1 --branch master https://git.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
./configure --prefix="${LOCAL_INSTALL_DIR}" --enable-pic --disable-debug --extra-ldflags="-static" --disable-programs --disable-doc --disable-avdevice --disable-postproc --disable-avfilter --disable-network --disable-encoders --disable-muxers
make -j$(getconf _NPROCESSORS_ONLN)
make -j$(getconf _NPROCESSORS_ONLN) install
cd ..
git clone --depth 1 --branch master https://github.com/l-smash/l-smash.git lsmash
cd lsmash
./configure --prefix="${LOCAL_INSTALL_DIR}" --extra-ldflags="-static"
make -j$(getconf _NPROCESSORS_ONLN)
make -j$(getconf _NPROCESSORS_ONLN) install
cd ..
./configure --enable-pic --enable-strip --extra-ldflags="-static"
make -j$(getconf _NPROCESSORS_ONLN) x264 checkasm
artifacts:
name: "$CI_PROJECT_PATH_SLUG-$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- x264${_PLATFORMSUFFIX}
- checkasm8${_PLATFORMSUFFIX}
- checkasm10${_PLATFORMSUFFIX}
expire_in: 1 week

build-debian-amd64:
extends: .build
image: registry.videolan.org/x264-debian-unstable:20190404162201
tags:
- docker
- amd64
variables: *variables-debian-amd64

build-debian-aarch64:
extends: .build
image: registry.videolan.org/x264-debian-unstable-aarch64:20190716192245
tags:
- docker
- aarch64
variables: *variables-debian-aarch64

.build-win:
extends: build-debian-amd64
script: |
set -x
LOCAL_INSTALL_DIR=`pwd`/${_TRIPLET}
export PKG_CONFIG_LIBDIR=${LOCAL_INSTALL_DIR}/lib/pkgconfig
curl -f -o vlc-contrib.txt ${_CONTRIB_URL}
CONTRIB_NAME=$(sed -n -e "s@.*href=\"\(vlc-contrib-${_TRIPLET}-[^\"]*\.tar\.bz2\)\".*@\1@p" vlc-contrib.txt | sed -n -e '1p')
curl -f -o vlc-contrib-${_TRIPLET}-latest.tar.bz2 ${_CONTRIB_URL}${CONTRIB_NAME}
bunzip2 vlc-contrib-${_TRIPLET}-latest.tar.bz2
tar xvf vlc-contrib-${_TRIPLET}-latest.tar
sed -i.bak -e "s#@@CONTRIB_PREFIX@@#${LOCAL_INSTALL_DIR}#g" ${PKG_CONFIG_LIBDIR}/*.pc
git clone --depth 1 --branch master https://github.com/l-smash/l-smash.git lsmash
cd lsmash
./configure --prefix="${LOCAL_INSTALL_DIR}" --target-os="${_TRIPLET}" --cross-prefix="${_TRIPLET}-"
make -j$(getconf _NPROCESSORS_ONLN)
make -j$(getconf _NPROCESSORS_ONLN) install
cd ..
./configure --host="${_TRIPLET}" --cross-prefix="${_TRIPLET}-" --enable-pic --enable-strip
make -j$(getconf _NPROCESSORS_ONLN) x264 checkasm
build-win32:
extends: .build-win
variables: *variables-win32

build-win64:
extends: .build-win
variables: *variables-win64

.build-llvm-mingw:
extends: .build
image: registry.videolan.org/vlc-debian-llvm-mingw:20200703084018
tags:
- docker
- amd64
script: |
set -x
PKGCONFIG=pkg-config ./configure --host="${_TRIPLET}" --cross-prefix="${_TRIPLET}-" --enable-pic --enable-strip
make -j$(getconf _NPROCESSORS_ONLN) x264 checkasm
build-llvm-mingw-armv7:
extends: .build-llvm-mingw
variables: *variables-win-armv7

build-llvm-mingw-aarch64:
extends: .build-llvm-mingw
variables: *variables-win-aarch64

build-macos:
extends: .build
tags:
- amd64
- catalina
script: |
set -x
LOCAL_INSTALL_DIR=`pwd`/${_TRIPLET}
export PKG_CONFIG_LIBDIR=${LOCAL_INSTALL_DIR}/lib/pkgconfig
curl -f -o vlc-contrib.txt ${_CONTRIB_URL}
CONTRIB_NAME=$(sed -n -e "s@.*href=\"\(vlc-contrib-${_TRIPLET}-[^\"]*\.tar\.bz2\)\".*@\1@p" vlc-contrib.txt | sed -n -e '1p')
curl -f -o vlc-contrib-${_TRIPLET}-latest.tar.bz2 ${_CONTRIB_URL}${CONTRIB_NAME}
bunzip2 vlc-contrib-${_TRIPLET}-latest.tar.bz2
tar xvf vlc-contrib-${_TRIPLET}-latest.tar
sed -i.bak -e "s#@@CONTRIB_PREFIX@@#${LOCAL_INSTALL_DIR}#g" ${PKG_CONFIG_LIBDIR}/*.pc
git clone --depth 1 --branch master https://github.com/l-smash/l-smash.git lsmash
cd lsmash
./configure --prefix="${LOCAL_INSTALL_DIR}"
make -j$(getconf _NPROCESSORS_ONLN)
make -j$(getconf _NPROCESSORS_ONLN) install
cd ..
./configure --enable-pic --enable-strip
make -j$(getconf _NPROCESSORS_ONLN) x264 checkasm
variables: *variables-macos

.test: &test
stage: test
script: |
set -x
${_WRAPPER} ./checkasm8${_PLATFORMSUFFIX}
${_WRAPPER} ./checkasm10${_PLATFORMSUFFIX}
artifacts:
expire_in: 10 minutes

test-debian-amd64:
<<: *test
extends: build-debian-amd64
dependencies:
- build-debian-amd64
variables: *variables-debian-amd64

test-debian-aarch64:
<<: *test
extends: build-debian-aarch64
dependencies:
- build-debian-aarch64
variables: *variables-debian-aarch64

test-win32:
<<: *test
extends: build-win32
dependencies:
- build-win32
variables: *variables-win32

test-win64:
<<: *test
extends: build-win64
dependencies:
- build-win64
variables: *variables-win64

test-macos:
<<: *test
extends: build-macos
dependencies:
- build-macos
variables: *variables-macos

.release: &release
stage: release
script: |
set -x
_VERSION=$(./version.sh | grep _VERSION -| cut -d\ -f4-| sed 's, ,-,g' | sed 's,",,')
mv x264${_PLATFORMSUFFIX} x264-${_VERSION}${_PLATFORMSUFFIX}
when: manual
only:
- master@videolan/x264
- stable@videolan/x264
artifacts:
name: "$CI_PROJECT_PATH_SLUG-$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- x264-*${_PLATFORMSUFFIX}
expire_in: '10 minutes'

release-debian-amd64:
<<: *release
extends: build-debian-amd64
dependencies:
- build-debian-amd64
variables: *variables-debian-amd64

release-debian-aarch64:
<<: *release
extends: build-debian-aarch64
dependencies:
- build-debian-aarch64
variables: *variables-debian-aarch64

release-win32:
<<: *release
extends: build-win32
dependencies:
- build-win32
variables: *variables-win32

release-win64:
<<: *release
extends: build-win64
dependencies:
- build-win64
variables: *variables-win64

release-macos:
<<: *release
extends: build-macos
dependencies:
- build-macos
variables: *variables-macos
30 changes: 24 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ vpath %.h $(SRCPATH)
vpath %.S $(SRCPATH)
vpath %.asm $(SRCPATH)
vpath %.rc $(SRCPATH)
vpath %.manifest $(SRCPATH)

CFLAGS += $(CFLAGSPROF)
LDFLAGS += $(LDFLAGSPROF)

GENERATED =

Expand All @@ -27,8 +31,8 @@ SRCS_X = common/counters.c common/mc.c common/predict.c common/pixel.c common/ma

SRCS_8 =

SRCCLI = x264.c input/input.c input/timecode.c input/raw.c input/y4m.c \
output/raw.c output/matroska.c output/matroska_ebml.c \
SRCCLI = x264.c autocomplete.c input/input.c input/timecode.c input/raw.c \
input/y4m.c output/raw.c output/matroska.c output/matroska_ebml.c \
output/flv.c output/flv_bytestream.c filters/filters.c \
filters/video/video.c filters/video/source.c filters/video/internal.c \
filters/video/resize.c filters/video/fix_vfr_pts.c \
Expand Down Expand Up @@ -246,6 +250,8 @@ $(LIBX264): $(GENERATED) .depend $(OBJS) $(OBJASM)
$(SONAME): $(GENERATED) .depend $(OBJS) $(OBJASM) $(OBJSO)
$(LD)$@ $(OBJS) $(OBJASM) $(OBJSO) $(SOFLAGS) $(LDFLAGS)

$(IMPLIBNAME): $(SONAME)

ifneq ($(EXE),)
.PHONY: x264 checkasm8 checkasm10 example
x264: x264$(EXE)
Expand All @@ -266,6 +272,9 @@ checkasm10$(EXE): $(GENERATED) .depend $(OBJCHK) $(OBJCHK_10) $(LIBX264)
example$(EXE): $(GENERATED) .depend $(OBJEXAMPLE) $(LIBX264)
$(LD)$@ $(OBJEXAMPLE) $(LIBX264) $(LDFLAGS)

$(OBJS) $(OBJSO): CFLAGS += $(CFLAGSSO)
$(OBJCLI): CFLAGS += $(CFLAGSCLI)

$(OBJS) $(OBJASM) $(OBJSO) $(OBJCLI) $(OBJCHK) $(OBJCHK_8) $(OBJCHK_10) $(OBJEXAMPLE): .depend

%.o: %.c
Expand Down Expand Up @@ -304,7 +313,7 @@ $(OBJS) $(OBJASM) $(OBJSO) $(OBJCLI) $(OBJCHK) $(OBJCHK_8) $(OBJCHK_10) $(OBJEXA
%.dll.o: %.rc x264.h
$(RC) $(RCFLAGS)$@ -DDLL $<

%.o: %.rc x264.h
%.o: %.rc x264.h x264res.manifest
$(RC) $(RCFLAGS)$@ $<

.depend: config.mak
Expand Down Expand Up @@ -336,7 +345,7 @@ ifneq ($(wildcard .depend),)
include .depend
endif

OBJPROF = $(OBJS) $(OBJCLI)
OBJPROF = $(OBJS) $(OBJSO) $(OBJCLI)
# These should cover most of the important codepaths
OPT0 = --crf 30 -b1 -m1 -r1 --me dia --no-cabac --direct temporal --ssim --no-weightb
OPT1 = --crf 16 -b2 -m3 -r3 --me hex --no-8x8dct --direct spatial --no-dct-decimate -t0 --slice-max-mbs 50
Expand All @@ -354,15 +363,15 @@ fprofiled:
@echo 'i.e. YUV with resolution in the filename, y4m, or avisynth.'
else
fprofiled: clean
$(MAKE) x264$(EXE) CFLAGS="$(CFLAGS) $(PROF_GEN_CC)" LDFLAGS="$(LDFLAGS) $(PROF_GEN_LD)"
$(MAKE) x264$(EXE) CFLAGSPROF="$(PROF_GEN_CC)" LDFLAGSPROF="$(PROF_GEN_LD)"
$(foreach V, $(VIDS), $(foreach I, 0 1 2 3 4 5 6 7, ./x264$(EXE) $(OPT$I) --threads 1 $(V) -o $(DEVNULL) ;))
ifeq ($(COMPILER),CL)
# Because Visual Studio timestamps the object files within the PGD, it fails to build if they change - only the executable should be deleted
rm -f x264$(EXE)
else
rm -f $(OBJPROF)
endif
$(MAKE) CFLAGS="$(CFLAGS) $(PROF_USE_CC)" LDFLAGS="$(LDFLAGS) $(PROF_USE_LD)"
$(MAKE) CFLAGSPROF="$(PROF_USE_CC)" LDFLAGSPROF="$(PROF_USE_LD)"
rm -f $(OBJPROF:%.o=%.gcda) $(OBJPROF:%.o=%.gcno) *.dyn pgopti.dpi pgopti.dpi.lock *.pgd *.pgc
endif

Expand Down Expand Up @@ -402,6 +411,12 @@ else ifneq ($(SONAME),)
$(INSTALL) -m 755 $(SONAME) $(DESTDIR)$(libdir)
endif

install-bashcompletion:
ifneq ($(BASHCOMPLETIONSDIR),)
$(INSTALL) -d $(DESTDIR)$(BASHCOMPLETIONSDIR)
$(INSTALL) -m 644 $(SRCPATH)/tools/bash-autocomplete.sh $(DESTDIR)$(BASHCOMPLETIONSDIR)/x264
endif

uninstall:
rm -f $(DESTDIR)$(includedir)/x264.h $(DESTDIR)$(includedir)/x264_config.h $(DESTDIR)$(libdir)/libx264.a
rm -f $(DESTDIR)$(bindir)/x264$(EXE) $(DESTDIR)$(libdir)/pkgconfig/x264.pc
Expand All @@ -410,6 +425,9 @@ ifneq ($(IMPLIBNAME),)
else ifneq ($(SONAME),)
rm -f $(DESTDIR)$(libdir)/$(SONAME) $(DESTDIR)$(libdir)/libx264.$(SOSUFFIX)
endif
ifneq ($(BASHCOMPLETIONSDIR),)
rm -f $(DESTDIR)$(BASHCOMPLETIONSDIR)/x264
endif

etags TAGS:
etags $(SRCS) $(SRCS_X) $(SRCS_8)
Loading

0 comments on commit a5428f1

Please sign in to comment.