diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..1236875eeda9010b726f3e6f84733395de41adbb --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +# Local configuration +local.properties +env.sh + +#Android Studio +.idea +*.iml + +#gradle +gradlew.bat +gradlew +gradle*/ +.gradle/ diff --git a/buildsystem/compile-libvlc.sh b/buildsystem/compile-libvlc.sh index 47c3d29d13e73180dc585a75a8c885a1fb9ba4d8..a0893cbfbec273101a5b8a8f97549fccf07f0739 100755 --- a/buildsystem/compile-libvlc.sh +++ b/buildsystem/compile-libvlc.sh @@ -112,17 +112,32 @@ fi ############ # VLC PATH # ############ -SRC_DIR=$PWD -if [ -f $SRC_DIR/src/libvlc.h ];then - VLC_SRC_DIR="$SRC_DIR" -elif [ -d $SRC_DIR/vlc ];then - VLC_SRC_DIR=$SRC_DIR/vlc +LIBVLCJNI_SRC_DIR="$(cd "$(dirname "$0")"; pwd -P)/.." +# Fix path if the script is sourced from vlc-android +if [ -d $LIBVLCJNI_SRC_DIR/libvlcjni ];then + LIBVLCJNI_SRC_DIR=$LIBVLCJNI_SRC_DIR/libvlcjni +fi + +if [ -f $LIBVLCJNI_SRC_DIR/src/libvlc.h ];then + VLC_SRC_DIR="$LIBVLCJNI_SRC_DIR" +elif [ -f $PWD/src/libvlc.h ];then + VLC_SRC_DIR="$PWD" +elif [ -d $LIBVLCJNI_SRC_DIR/vlc ];then + VLC_SRC_DIR=$LIBVLCJNI_SRC_DIR/vlc else echo "Could not find vlc sources" exit 1 fi VLC_BUILD_DIR="$(cd $VLC_SRC_DIR/; pwd)/build-android-${TARGET_TUPLE}" + +if [ -z $VLC_TARBALLS ]; then + VLC_TARBALLS="$(cd $VLC_SRC_DIR/;pwd)/contrib/tarballs" +fi +if [ ! -d $VLC_TARBALLS ]; then + mkdir -p $VLC_TARBALLS +fi + VLC_OUT_PATH="$VLC_BUILD_DIR/ndk" mkdir -p $VLC_OUT_PATH @@ -219,12 +234,13 @@ avlc_get_symbol() avlc_gen_pc_file() { -echo "Generating $1 pkg-config file" -echo "Name: $1 -Description: $1 -Version: $2 -Libs: -l$1 -Cflags:" > contrib/${TARGET_TUPLE}/lib/pkgconfig/$(echo $1|tr 'A-Z' 'a-z').pc +echo -n "Generating $2 pkg-config file" +echo $1/$(echo $2|tr 'A-Z' 'a-z').pc +echo "Name: $2 +Description: $2 +Version: $3 +Libs: -l$2 +Cflags:" > $1/$(echo $2|tr 'A-Z' 'a-z').pc } avlc_pkgconfig() @@ -418,26 +434,23 @@ VLC_MODULE_BLACKLIST=" export PATH="$VLC_SRC_DIR/extras/tools/build/bin:$PATH" echo "Building tools" -cd $VLC_SRC_DIR/extras/tools -./bootstrap +(cd $VLC_SRC_DIR/extras/tools && ./bootstrap) avlc_checkfail "buildsystem tools: bootstrap failed" -make $MAKEFLAGS +make -C $VLC_SRC_DIR/extras/tools $MAKEFLAGS avlc_checkfail "buildsystem tools: make failed" -make $MAKEFLAGS .gas || make $MAKEFLAGS .buildgas +make -C $VLC_SRC_DIR/extras/tools $MAKEFLAGS .gas || make -C $VLC_SRC_DIR/extras/tools $MAKEFLAGS .buildgas avlc_checkfail "buildsystem tools: make failed" -cd ../../.. VLC_CONTRIB="$VLC_SRC_DIR/contrib/$TARGET_TUPLE" -cd $VLC_SRC_DIR ############# # BOOTSTRAP # ############# -if [ ! -f configure ]; then +if [ ! -f $VLC_SRC_DIR/configure ]; then echo "Bootstraping" - ./bootstrap + (cd $VLC_SRC_DIR && ./bootstrap) avlc_checkfail "vlc: bootstrap failed" fi @@ -446,70 +459,70 @@ fi ############ echo "Building the contribs" -mkdir -p contrib/contrib-android-${TARGET_TUPLE} -mkdir -p contrib/${TARGET_TUPLE}/lib/pkgconfig -avlc_gen_pc_file EGL 1.1 -avlc_gen_pc_file GLESv2 2 +VLC_CONTRIB_DIR=$VLC_SRC_DIR/contrib/contrib-android-${TARGET_TUPLE} +VLC_CONTRIB_OUT_DIR=$VLC_SRC_DIR/contrib/${TARGET_TUPLE} + +mkdir -p $VLC_CONTRIB_OUT_DIR/lib/pkgconfig +avlc_gen_pc_file $VLC_CONTRIB_OUT_DIR/lib/pkgconfig EGL 1.1 +avlc_gen_pc_file $VLC_CONTRIB_OUT_DIR/lib/pkgconfig GLESv2 2 -cd contrib/contrib-android-${TARGET_TUPLE} +mkdir -p $VLC_CONTRIB_DIR/lib/pkgconfig # TODO: VLC 4.0 won't rm config.mak after each call to bootstrap. Move it just # before ">> config.make" when switching to VLC 4.0 -rm -f config.mak +rm -f $VLC_CONTRIB_DIR/config.mak export USE_FFMPEG=1 -ANDROID_ABI=${ANDROID_ABI} ANDROID_API=${ANDROID_API} \ - ../bootstrap --host=${TARGET_TUPLE} ${VLC_BOOTSTRAP_ARGS} +(cd $VLC_CONTRIB_DIR && ANDROID_ABI=${ANDROID_ABI} ANDROID_API=${ANDROID_API} \ + ../bootstrap --host=${TARGET_TUPLE} ${VLC_BOOTSTRAP_ARGS}) avlc_checkfail "contribs: bootstrap failed" if [ "$AVLC_USE_PREBUILT_CONTRIBS" -gt "0" ]; then # Fetch prebuilt contribs if [ -z "$VLC_PREBUILT_CONTRIBS_URL" ]; then - make prebuilt + make -C $VLC_CONTRIB_DIR prebuilt avlc_checkfail "Fetching prebuilt contribs failed" else - make prebuilt PREBUILT_URL="$VLC_PREBUILT_CONTRIBS_URL" + make -C $VLC_CONTRIB_DIR prebuilt PREBUILT_URL="$VLC_PREBUILT_CONTRIBS_URL" avlc_checkfail "Fetching prebuilt contribs from ${VLC_PREBUILT_CONTRIBS_URL} failed" fi - make .luac + make -C $VLC_CONTRIB_DIR TARBALLS="$VLC_TARBALLS" .luac else # Some libraries have arm assembly which won't build in thumb mode # We append -marm to the CFLAGS of these libs to disable thumb mode - [ ${ANDROID_ABI} = "armeabi-v7a" ] && echo "NOTHUMB := -marm" >> config.mak + [ ${ANDROID_ABI} = "armeabi-v7a" ] && echo "NOTHUMB := -marm" >> $VLC_CONTRIB_DIR/config.mak - echo "EXTRA_CFLAGS=${VLC_CFLAGS}" >> config.mak - echo "EXTRA_CXXFLAGS=${VLC_CXXFLAGS}" >> config.mak - echo "CC=${CROSS_CLANG}" >> config.mak - echo "CXX=${CROSS_CLANG}++" >> config.mak - echo "AR=${CROSS_TOOLS}ar" >> config.mak - echo "AS=${CROSS_TOOLS}as" >> config.mak - echo "RANLIB=${CROSS_TOOLS}ranlib" >> config.mak - echo "LD=${CROSS_TOOLS}ld" >> config.mak + echo "EXTRA_CFLAGS=${VLC_CFLAGS}" >> $VLC_CONTRIB_DIR/config.mak + echo "EXTRA_CXXFLAGS=${VLC_CXXFLAGS}" >> $VLC_CONTRIB_DIR/config.mak + echo "CC=${CROSS_CLANG}" >> $VLC_CONTRIB_DIR/config.mak + echo "CXX=${CROSS_CLANG}++" >> $VLC_CONTRIB_DIR/config.mak + echo "AR=${CROSS_TOOLS}ar" >> $VLC_CONTRIB_DIR/config.mak + echo "AS=${CROSS_TOOLS}as" >> $VLC_CONTRIB_DIR/config.mak + echo "RANLIB=${CROSS_TOOLS}ranlib" >> $VLC_CONTRIB_DIR/config.mak + echo "LD=${CROSS_TOOLS}ld" >> $VLC_CONTRIB_DIR/config.mak # fix modplug endianess check (narrowing error) export ac_cv_c_bigendian=no - make $MAKEFLAGS fetch + make -C $VLC_CONTRIB_DIR TARBALLS="$VLC_TARBALLS" $MAKEFLAGS fetch avlc_checkfail "contribs: make fetch failed" # gettext - which autopoint >/dev/null || make $MAKEFLAGS .gettext + which autopoint >/dev/null || make -C $VLC_CONTRIB_DIR TARBALLS="$VLC_TARBALLS" $MAKEFLAGS .gettext #export the PATH # Make - make $MAKEFLAGS + make -C $VLC_CONTRIB_DIR TARBALLS="$VLC_TARBALLS" $MAKEFLAGS avlc_checkfail "contribs: make failed" # Make prebuilt contribs package if [ "$AVLC_MAKE_PREBUILT_CONTRIBS" -gt "0" ]; then - make package + make -C $VLC_CONTRIB_DIR package avlc_checkfail "Creating prebuilt contribs package failed" fi fi -cd ../../ - -mkdir -p $VLC_BUILD_DIR && cd $VLC_BUILD_DIR +mkdir -p $VLC_BUILD_DIR ############# # CONFIGURE # @@ -533,12 +546,13 @@ export ac_cv_header_search_h=no export ac_cv_func_tdestroy=no export ac_cv_func_tfind=no -if [ ! -e ./config.h -o "$AVLC_RELEASE" = 1 ]; then +if [ ! -e $VLC_BUILD_DIR/config.h -o "$AVLC_RELEASE" = 1 ]; then VLC_CONFIGURE_DEBUG="" if [ ! "$AVLC_RELEASE" = 1 ]; then VLC_CONFIGURE_DEBUG="--enable-debug --disable-branch-protection" fi + (cd $VLC_BUILD_DIR && \ CFLAGS="${VLC_CFLAGS}" \ CXXFLAGS="${VLC_CFLAGS} ${VLC_CXXFLAGS}" \ CC="${CROSS_CLANG}" \ @@ -554,7 +568,8 @@ if [ ! -e ./config.h -o "$AVLC_RELEASE" = 1 ]; then sh ../configure --host=$TARGET_TUPLE --build=x86_64-unknown-linux \ --with-contrib=${VLC_SRC_DIR}/contrib/${TARGET_TUPLE} \ --prefix=${VLC_BUILD_DIR}/install/ \ - ${EXTRA_PARAMS} ${VLC_CONFIGURE_ARGS} ${VLC_CONFIGURE_DEBUG} + ${EXTRA_PARAMS} ${VLC_CONFIGURE_ARGS} ${VLC_CONFIGURE_DEBUG} \ + ) avlc_checkfail "vlc: configure failed" fi @@ -563,13 +578,11 @@ fi ############ echo "Building" -make $MAKEFLAGS +make -C $VLC_BUILD_DIR $MAKEFLAGS avlc_checkfail "vlc: make failed" -make install +make -C $VLC_BUILD_DIR install avlc_checkfail "vlc: make install failed" -cd $SRC_DIR - ################## # libVLC modules # ################## @@ -658,7 +671,7 @@ echo -e "ndk-build vlc" touch $VLC_OUT_PATH/dummy.cpp -$NDK_BUILD -C libvlcjni/libvlc \ +$NDK_BUILD -C $LIBVLCJNI_SRC_DIR/libvlc \ APP_STL="c++_shared" \ APP_CPPFLAGS="-frtti -fexceptions" \ VLC_SRC_DIR="$VLC_SRC_DIR" \ diff --git a/buildsystem/get-vlc.sh b/buildsystem/get-vlc.sh index 38edd8da0a91f27dcfca69810279dc3472ab7365..e95dd26467e504d82daaee38032b7e3d14e42e8b 100755 --- a/buildsystem/get-vlc.sh +++ b/buildsystem/get-vlc.sh @@ -1,6 +1,8 @@ #! /bin/sh set -e +LIBVLCJNI_SRC_DIR="$(cd "$(dirname "$0")"; pwd -P)/.." +PATCHES_DIR=$LIBVLCJNI_SRC_DIR/libvlc/patches ############# # FUNCTIONS # ############# @@ -78,7 +80,7 @@ if [ ! -d "vlc" ]; then git reset --hard ${VLC_TESTED_HASH} || fail "VLC sources: VLC_TESTED_HASH ${VLC_TESTED_HASH} not found" diagnostic "VLC sources: applying custom patches" # Keep Message-Id inside commits description to track them afterwards - git am --message-id ../libvlcjni/libvlc/patches/vlc3/*.patch || fail "VLC sources: cannot apply custom patches" + git am --message-id $PATCHES_DIR/*.patch || fail "VLC sources: cannot apply custom patches" cd .. else diagnostic "VLC source: found sources, leaving untouched" @@ -88,7 +90,7 @@ if [ "$BYPASS_VLC_SRC_CHECKS" = 1 ]; then elif [ $RESET -eq 1 ]; then cd vlc git reset --hard ${VLC_TESTED_HASH} || fail "VLC sources: VLC_TESTED_HASH ${VLC_TESTED_HASH} not found" - for patch_file in ../libvlcjni/libvlc/patches/vlc3/*.patch; do + for patch_file in $PATCHES_DIR/*.patch; do git am --message-id $patch_file check_patch_is_applied "$patch_file" done @@ -99,7 +101,7 @@ else cd vlc git cat-file -e ${VLC_TESTED_HASH} 2> /dev/null || \ fail "Error: Your vlc checkout does not contain the latest tested commit: ${VLC_TESTED_HASH}" - for patch_file in ../libvlcjni/libvlc/patches/vlc3/*.patch; do + for patch_file in $PATCHES_DIR/*.patch; do check_patch_is_applied "$patch_file" done cd .. diff --git a/buildsystem/gitlab/.gitlab-ci.yml b/buildsystem/gitlab/.gitlab-ci.yml index 3a0d53ce44a36b035171a96c9038ffc35dcc2d6c..2a0115dada6c02f7b0432d260994dc4e9eeae8d1 100644 --- a/buildsystem/gitlab/.gitlab-ci.yml +++ b/buildsystem/gitlab/.gitlab-ci.yml @@ -14,21 +14,14 @@ default: stages: - build - - package - -.build-all-base: - stage: build - script: | - cd .. - [ ! -d "vlc-android" ] && git clone https://code.videolan.org/videolan/vlc-android - cd vlc-android - ./buildsystem/compile.sh ${EXTRA_BUILD_PARAM} -a ${ARCH} - variables: - MAKEFLAGS: -j8 # Rebuilds libvlc JNI .build-libvlc-base: - extends: .build-all-base + stage: build + script: | + rm -rf vlc + ./buildsystem/get-vlc.sh + ./buildsystem/compile-libvlc.sh -a ${ARCH} rules: # Explicitely refuse to build anything that would also trigger # a medialib build @@ -41,7 +34,7 @@ stages: - libvlc/**/* - if: '$CI_PIPELINE_SOURCE == "push"' variables: - EXTRA_BUILD_PARAM: -l + MAKEFLAGS: -j8 ################################# # Template config instantiation # @@ -74,69 +67,3 @@ build-libvlc-x86_64: variables: M2_REPO: "$CI_PROJECT_DIR/aars/repository" -.build-libs-base: - extends: .build-release-libs-base - stage: build - script: - - mkdir -p $M2_REPO - - ./buildsystem/compile.sh -l -a ${ARCH} -m2 $M2_REPO release - artifacts: - expire_in: 1h - when: on_success - paths: - - $CI_PROJECT_DIR/libvlc/jni/libs/* - - $CI_PROJECT_DIR/.dbg/* - -build-libs-arm64: - extends: .build-libs-base - variables: - ARCH: arm64 - -build-libs-armv7: - extends: .build-libs-base - variables: - ARCH: arm - -build-libs-x86: - extends: .build-libs-base - variables: - ARCH: x86 - -build-libs-x86_64: - extends: .build-libs-base - variables: - ARCH: x86_64 - -publish_libs: - extends: .build-release-libs-base - stage: package - needs: - - job: "build-libs-arm64" - - job: "build-libs-armv7" - - job: "build-libs-x86" - - job: "build-libs-x86_64" - script: - - mkdir -p $M2_REPO - - ./buildsystem/compile.sh --init -b - - GRADLE_ABI=ALL RELEASE_SIGNING_ENABLED=false ./gradlew -Dmaven.repo.local=$M2_REPO -p libvlc publishToMavenLocal - artifacts: - name: "${CI_COMMIT_TAG}.dbg" - paths: - - .dbg/ - - $M2_REPO - expire_in: 2 weeks - -release: - stage: build - rules: - - if: '$CI_COMMIT_TAG =~ /^(\d+\.)?(\d+\.)?(\*|\d+)/' - script: - - ./buildsystem/compile.sh --init - - ./gradlew assembleRelease - artifacts: - name: "${CI_COMMIT_TAG}" - paths: - - application/app/build/outputs/apk/release/VLC-Android-*.apk -# - application/app/build/outputs/mapping/release/mapping.txt - expire_in: 2 weeks - diff --git a/libvlc/patches/vlc3/0001-compat-Workaround-sendmsg-bug-on-android.patch b/libvlc/patches/0001-compat-Workaround-sendmsg-bug-on-android.patch similarity index 100% rename from libvlc/patches/vlc3/0001-compat-Workaround-sendmsg-bug-on-android.patch rename to libvlc/patches/0001-compat-Workaround-sendmsg-bug-on-android.patch diff --git a/libvlc/patches/vlc3/0002-libvlc-events-Add-callbacks-for-record.patch b/libvlc/patches/0002-libvlc-events-Add-callbacks-for-record.patch similarity index 100% rename from libvlc/patches/vlc3/0002-libvlc-events-Add-callbacks-for-record.patch rename to libvlc/patches/0002-libvlc-events-Add-callbacks-for-record.patch diff --git a/libvlc/patches/vlc3/0003-network-tls-Handle-errors-from-older-kernels.patch b/libvlc/patches/0003-network-tls-Handle-errors-from-older-kernels.patch similarity index 100% rename from libvlc/patches/vlc3/0003-network-tls-Handle-errors-from-older-kernels.patch rename to libvlc/patches/0003-network-tls-Handle-errors-from-older-kernels.patch diff --git a/libvlc/patches/vlc3/0004-access_output-file-Add-error-dialog-for-write-open.patch b/libvlc/patches/0004-access_output-file-Add-error-dialog-for-write-open.patch similarity index 100% rename from libvlc/patches/vlc3/0004-access_output-file-Add-error-dialog-for-write-open.patch rename to libvlc/patches/0004-access_output-file-Add-error-dialog-for-write-open.patch diff --git a/libvlc/patches/vlc3/0005-libvlc-media_player-Add-record-method.patch b/libvlc/patches/0005-libvlc-media_player-Add-record-method.patch similarity index 100% rename from libvlc/patches/vlc3/0005-libvlc-media_player-Add-record-method.patch rename to libvlc/patches/0005-libvlc-media_player-Add-record-method.patch diff --git a/libvlc/patches/vlc3/0006-input-es_out-set-video-exclusive.patch b/libvlc/patches/0006-input-es_out-set-video-exclusive.patch similarity index 100% rename from libvlc/patches/vlc3/0006-input-es_out-set-video-exclusive.patch rename to libvlc/patches/0006-input-es_out-set-video-exclusive.patch diff --git a/libvlc/patches/vlc3/0007-stream_ReadLine-increase-line-length-limit.patch b/libvlc/patches/0007-stream_ReadLine-increase-line-length-limit.patch similarity index 100% rename from libvlc/patches/vlc3/0007-stream_ReadLine-increase-line-length-limit.patch rename to libvlc/patches/0007-stream_ReadLine-increase-line-length-limit.patch diff --git a/libvlc/patches/vlc3/0008-input-Extract-attachment-also-when-preparsing.patch b/libvlc/patches/0008-input-Extract-attachment-also-when-preparsing.patch similarity index 100% rename from libvlc/patches/vlc3/0008-input-Extract-attachment-also-when-preparsing.patch rename to libvlc/patches/0008-input-Extract-attachment-also-when-preparsing.patch diff --git a/libvlc/patches/vlc3/0009-input-display-discoverer-preparsers-logs.patch b/libvlc/patches/0009-input-display-discoverer-preparsers-logs.patch similarity index 100% rename from libvlc/patches/vlc3/0009-input-display-discoverer-preparsers-logs.patch rename to libvlc/patches/0009-input-display-discoverer-preparsers-logs.patch diff --git a/libvlc/patches/vlc3/0010-taglib-Backport-4.0-patches-to-allow-preparsing-of-n.patch b/libvlc/patches/0010-taglib-Backport-4.0-patches-to-allow-preparsing-of-n.patch similarity index 100% rename from libvlc/patches/vlc3/0010-taglib-Backport-4.0-patches-to-allow-preparsing-of-n.patch rename to libvlc/patches/0010-taglib-Backport-4.0-patches-to-allow-preparsing-of-n.patch diff --git a/libvlc/patches/vlc3/0011-media_player-backport-fast-seek-argument.patch b/libvlc/patches/0011-media_player-backport-fast-seek-argument.patch similarity index 100% rename from libvlc/patches/vlc3/0011-media_player-backport-fast-seek-argument.patch rename to libvlc/patches/0011-media_player-backport-fast-seek-argument.patch diff --git a/libvlc/patches/vlc3/0012-audiotrack-rework-DynamicsProcessing-stop.patch b/libvlc/patches/0012-audiotrack-rework-DynamicsProcessing-stop.patch similarity index 100% rename from libvlc/patches/vlc3/0012-audiotrack-rework-DynamicsProcessing-stop.patch rename to libvlc/patches/0012-audiotrack-rework-DynamicsProcessing-stop.patch diff --git a/libvlc/patches/vlc3/0013-freetype-android-process-formatted-text-nodes.patch b/libvlc/patches/0013-freetype-android-process-formatted-text-nodes.patch similarity index 100% rename from libvlc/patches/vlc3/0013-freetype-android-process-formatted-text-nodes.patch rename to libvlc/patches/0013-freetype-android-process-formatted-text-nodes.patch diff --git a/libvlc/patches/vlc3/0014-taglib-Fix-extraction-of-AAC-metadata.patch b/libvlc/patches/0014-taglib-Fix-extraction-of-AAC-metadata.patch similarity index 100% rename from libvlc/patches/vlc3/0014-taglib-Fix-extraction-of-AAC-metadata.patch rename to libvlc/patches/0014-taglib-Fix-extraction-of-AAC-metadata.patch diff --git a/libvlc/patches/vlc3/0015-keystore-use-the-system-keystore-from-the-first-try.patch b/libvlc/patches/0015-keystore-use-the-system-keystore-from-the-first-try.patch similarity index 100% rename from libvlc/patches/vlc3/0015-keystore-use-the-system-keystore-from-the-first-try.patch rename to libvlc/patches/0015-keystore-use-the-system-keystore-from-the-first-try.patch diff --git a/libvlc/patches/vlc3/0016-keystore-return-false-when-interrupted.patch b/libvlc/patches/0016-keystore-return-false-when-interrupted.patch similarity index 100% rename from libvlc/patches/vlc3/0016-keystore-return-false-when-interrupted.patch rename to libvlc/patches/0016-keystore-return-false-when-interrupted.patch diff --git a/libvlc/patches/vlc3/0017-modules-access-handle-vlc_credential_get-interruptio.patch b/libvlc/patches/0017-modules-access-handle-vlc_credential_get-interruptio.patch similarity index 100% rename from libvlc/patches/vlc3/0017-modules-access-handle-vlc_credential_get-interruptio.patch rename to libvlc/patches/0017-modules-access-handle-vlc_credential_get-interruptio.patch diff --git a/libvlc/patches/vlc3/0018-access-add-a-cache-helper.patch b/libvlc/patches/0018-access-add-a-cache-helper.patch similarity index 100% rename from libvlc/patches/vlc3/0018-access-add-a-cache-helper.patch rename to libvlc/patches/0018-access-add-a-cache-helper.patch diff --git a/libvlc/patches/vlc3/0019-dsm-use-the-cache-helper.patch b/libvlc/patches/0019-dsm-use-the-cache-helper.patch similarity index 100% rename from libvlc/patches/vlc3/0019-dsm-use-the-cache-helper.patch rename to libvlc/patches/0019-dsm-use-the-cache-helper.patch diff --git a/libvlc/patches/vlc3/0020-smb2-use-the-cache-helper.patch b/libvlc/patches/0020-smb2-use-the-cache-helper.patch similarity index 100% rename from libvlc/patches/vlc3/0020-smb2-use-the-cache-helper.patch rename to libvlc/patches/0020-smb2-use-the-cache-helper.patch diff --git a/libvlc/patches/vlc3/0021-upnp-android-implement-net-intf-priority.patch b/libvlc/patches/0021-upnp-android-implement-net-intf-priority.patch similarity index 100% rename from libvlc/patches/vlc3/0021-upnp-android-implement-net-intf-priority.patch rename to libvlc/patches/0021-upnp-android-implement-net-intf-priority.patch diff --git a/libvlc/patches/vlc4/0001-compat-Workaround-sendmsg-bug-on-android.patch b/libvlc/patches/vlc4/0001-compat-Workaround-sendmsg-bug-on-android.patch deleted file mode 100644 index ca86c5fcb6b131a090ba0a65638111d6e33506d8..0000000000000000000000000000000000000000 --- a/libvlc/patches/vlc4/0001-compat-Workaround-sendmsg-bug-on-android.patch +++ /dev/null @@ -1,82 +0,0 @@ -From dfab4e10f396671cfa1c48a9ab0b9f4443946321 Mon Sep 17 00:00:00 2001 -Message-Id: <dfab4e10f396671cfa1c48a9ab0b9f4443946321.1571236616.git.rom@rom1v.com> -From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr> -Date: Thu, 28 Mar 2019 15:23:48 +0100 -Subject: [PATCH 1/3] compat: Workaround sendmsg bug on android - -This only happens on 64bits builds, see compat/sendmsg.c comments ---- - compat/sendmsg.c | 24 ++++++++++++++++++++++++ - configure.ac | 3 +++ - include/vlc_network.h | 6 ++++++ - 3 files changed, 33 insertions(+) - -diff --git a/compat/sendmsg.c b/compat/sendmsg.c -index 0b08ce0942..2ef542eb7b 100644 ---- a/compat/sendmsg.c -+++ b/compat/sendmsg.c -@@ -133,6 +133,30 @@ ssize_t sendmsg(int fd, const struct msghdr *msg, int flags) - free(data); - return res; - } -+#elif defined(__ANDROID__) && defined(__aarch64__) -+ -+#undef sendmsg -+ -+#include <sys/types.h> -+#include <sys/socket.h> -+ -+/** -+ * Since we bumped the NDK version from 14 to 18, some devices (at least up to -+ * Android 6) are returning errors on 4 bytes, even though ssize_t is actually -+ * 8 bytes. This causes `value < 0` checks to yield false, and consider the value -+ * as a non error. -+ * As the patch lies in either the NDK or the Android kernel, or the device libc -+ * we can only work around it. If errno is not 0 & we receive -1, on 32bits or -+ * 64bits, we assume an error was returned. -+ */ -+ssize_t vlc_sendmsg(int fd, const struct msghdr *msg, int flags) -+{ -+ errno = 0; -+ ssize_t ret = sendmsg(fd, msg, flags); -+ if ((ret < 0 || ret == 0xFFFFFFFF) && errno != 0) -+ return -1; -+ return ret; -+} - - #else - #error sendmsg not implemented on your platform! -diff --git a/configure.ac b/configure.ac -index 210b4ca537..3d72781883 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -415,6 +415,9 @@ AS_IF([test "$SYS" = linux],[ - ],[ - HAVE_ANDROID="1" - AC_MSG_RESULT([yes]) -+ AS_IF([test "${host_cpu}" = "aarch64"], [ -+ AC_LIBOBJ([sendmsg]) -+ ]) - ],[ - AC_MSG_RESULT([no]) - ]) -diff --git a/include/vlc_network.h b/include/vlc_network.h -index 88dcfefbca..17cdca6198 100644 ---- a/include/vlc_network.h -+++ b/include/vlc_network.h -@@ -296,6 +296,12 @@ static inline int net_GetPeerAddress( int fd, char *address, int *port ) - - VLC_API char *vlc_getProxyUrl(const char *); - -+#if defined(__ANDROID__) && defined(__aarch64__) -+struct msghdr; -+ssize_t vlc_sendmsg(int fd, const struct msghdr *msg, int flags); -+#define sendmsg(a, b, c) vlc_sendmsg(a,b,c) -+#endif -+ - # ifdef __cplusplus - } - # endif --- -2.23.0 - diff --git a/libvlc/patches/vlc4/0001-freetype-android-process-formatted-text-nodes.patch b/libvlc/patches/vlc4/0001-freetype-android-process-formatted-text-nodes.patch deleted file mode 100644 index 9aa821a5c0e9b4e0565bbfae79e4771eb78b7349..0000000000000000000000000000000000000000 --- a/libvlc/patches/vlc4/0001-freetype-android-process-formatted-text-nodes.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 4218d5fca526010c8cfd412c55f53cc367e76bd5 Mon Sep 17 00:00:00 2001 -Message-Id: <4218d5fca526010c8cfd412c55f53cc367e76bd5.1638525655.git.hugo@beauzee.fr> -From: Francois Cartegnie <fcvlcdev@free.fr> -Date: Thu, 2 Dec 2021 10:06:28 +0100 -Subject: [PATCH] freetype: android: process formatted text nodes - -Trims filenames as they are not stored as attributes. - -Also removes incorrect asprintf 0 return value handling ---- - .../text_renderer/freetype/fonts/android.c | 26 +++++++++++++++++-- - 1 file changed, 24 insertions(+), 2 deletions(-) - -diff --git a/modules/text_renderer/freetype/fonts/android.c b/modules/text_renderer/freetype/fonts/android.c -index 6712640d48..c395bb2626 100644 ---- a/modules/text_renderer/freetype/fonts/android.c -+++ b/modules/text_renderer/freetype/fonts/android.c -@@ -84,9 +84,31 @@ static int Android_ParseFont( vlc_font_select_t *fs, xml_reader_t *p_xml, - * We don't need all font weights. Only 400 (regular) and 700 (bold) - */ - if( i_weight == 400 || i_weight == 700 ) -- if( asprintf( &psz_fontfile, "%s/%s", SYSTEM_FONT_PATH, psz_val ) < 0 -- || !NewFont( psz_fontfile, 0, i_flags, p_family ) ) -+ { -+ /* left trim */ -+ psz_val += strspn( psz_val, " \t\r\n" ); -+ /* right trim */ -+ size_t len = strlen( psz_val ); -+ const char *psz_end = psz_val + len; -+ while( psz_end > psz_val && -+ ( psz_end[-1] == ' ' || -+ psz_end[-1] == '\t' || -+ psz_end[-1] == '\r' || -+ psz_end[-1] == '\n' ) ) -+ psz_end--; -+ len = psz_end - psz_val; -+ -+ psz_fontfile = malloc( sizeof(SYSTEM_FONT_PATH) + 1 + len ); -+ if( !psz_fontfile ) -+ return VLC_ENOMEM; -+ memcpy( psz_fontfile, SYSTEM_FONT_PATH, sizeof(SYSTEM_FONT_PATH) - 1 ); -+ psz_fontfile[sizeof(SYSTEM_FONT_PATH) - 1] = '/'; -+ memcpy( &psz_fontfile[sizeof(SYSTEM_FONT_PATH)], psz_val, len ); -+ psz_fontfile[sizeof(SYSTEM_FONT_PATH) + len] = '\0'; -+ -+ if( !NewFont( psz_fontfile, 0, i_flags, p_family ) ) - return VLC_ENOMEM; -+ } - - return VLC_SUCCESS; - } --- -2.33.0 - diff --git a/libvlc/patches/vlc4/0002-network-tls-Handle-errors-from-older-kernels.patch b/libvlc/patches/vlc4/0002-network-tls-Handle-errors-from-older-kernels.patch deleted file mode 100644 index 112cc7ef0034a343bc2f057754ad8f6910fb36e4..0000000000000000000000000000000000000000 --- a/libvlc/patches/vlc4/0002-network-tls-Handle-errors-from-older-kernels.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 1ac1a72efed635e5d6c59db61e056cef08756ed1 Mon Sep 17 00:00:00 2001 -Message-Id: <1ac1a72efed635e5d6c59db61e056cef08756ed1.1571236616.git.rom@rom1v.com> -In-Reply-To: <dfab4e10f396671cfa1c48a9ab0b9f4443946321.1571236616.git.rom@rom1v.com> -References: <dfab4e10f396671cfa1c48a9ab0b9f4443946321.1571236616.git.rom@rom1v.com> -From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr> -Date: Fri, 29 Mar 2019 10:56:26 +0100 -Subject: [PATCH 2/3] network: tls: Handle errors from older kernels - -If MSG_FASTOPEN is defined, but turns out to be unimplemented by the -underlying kernel (as is the case on android where the NDK claims to -support fast open but some older kernels don't) EPIPE is returned -instead of EOPNOTSUPP. -See net/ipv4/tcp.c:936 & net/core/stream.c:55 -sk_stream_wait_connect will return EPIPE if no SYN was sent/received, -and sendmsg will propagate that error. -Treating EPIPE as a synonym for EOPNOTSUPP here allows for the -connection to proceed, and the first call to sendmsg to complete as -expected. ---- - src/network/stream.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/network/stream.c b/src/network/stream.c -index 5a24bd7134..0b9b1573d7 100644 ---- a/src/network/stream.c -+++ b/src/network/stream.c -@@ -383,8 +383,11 @@ static ssize_t vlc_tls_ConnectWrite(vlc_tls_t *tls, - return -1; - } - else -- if (errno != EOPNOTSUPP) -+ if (errno != EOPNOTSUPP && errno != EPIPE) -+ { /* If MSG_FASTOPEN was defined but the kernel doesn't support fast open at -+ all, EPIPE will be returned instead of EOPNOTSUPP */ - return -1; -+ } - /* Fast open not supported or disabled... fallback to normal mode */ - #endif - --- -2.23.0 - diff --git a/libvlc/patches/vlc4/0003-access_output-file-Add-error-dialog-for-write-open.patch b/libvlc/patches/vlc4/0003-access_output-file-Add-error-dialog-for-write-open.patch deleted file mode 100644 index f1f2c3e03fc2fe3977e6ba2f25dfcdf3ce58fcc3..0000000000000000000000000000000000000000 --- a/libvlc/patches/vlc4/0003-access_output-file-Add-error-dialog-for-write-open.patch +++ /dev/null @@ -1,43 +0,0 @@ -From cba62e75c2be117abfdeea091f030ff7e252bfec Mon Sep 17 00:00:00 2001 -Message-Id: <cba62e75c2be117abfdeea091f030ff7e252bfec.1571236616.git.rom@rom1v.com> -In-Reply-To: <dfab4e10f396671cfa1c48a9ab0b9f4443946321.1571236616.git.rom@rom1v.com> -References: <dfab4e10f396671cfa1c48a9ab0b9f4443946321.1571236616.git.rom@rom1v.com> -From: Soomin Lee <bubu@mikan.io> -Date: Mon, 1 Oct 2018 15:37:57 +0200 -Subject: [PATCH 3/3] access_output: file: Add error dialog for write/open - ---- - modules/access_output/file.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/modules/access_output/file.c b/modules/access_output/file.c -index c983e3a8f0..8a690fc41f 100644 ---- a/modules/access_output/file.c -+++ b/modules/access_output/file.c -@@ -87,6 +87,9 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer ) - { - if (errno == EINTR) - continue; -+ if (errno == ENOSPC) -+ vlc_dialog_display_error(p_access, "record", -+ "An error occurred during recording. Error: %s", vlc_strerror_c(errno)); - block_ChainRelease (p_buffer); - msg_Err( p_access, "cannot write: %s", vlc_strerror_c(errno) ); - return -1; -@@ -304,8 +307,13 @@ static int Open( vlc_object_t *p_this ) - if (fd != -1) - break; - if (fd == -1) -+ { - msg_Err (p_access, "cannot create %s: %s", path, - vlc_strerror_c(errno)); -+ -+ vlc_dialog_display_error(p_access, "record", -+ "An error occurred during recording. Error: %s", vlc_strerror_c(errno)); -+ } - if (overwrite || errno != EEXIST) - break; - flags &= ~O_EXCL; --- -2.23.0 -