├── .gitignore ├── COPYING.LGPLv2.1 ├── LICENSE ├── README ├── _do_pull.sh ├── _do_reset_vlc.sh ├── _install_libs_on_centos.sh ├── _pull-app.sh ├── _pull-lite-armv5.sh ├── _pull-lite-armv6-vfp.sh ├── _pull-lite-armv6.sh ├── _pull-lite-armv7a.sh ├── _pull-lite-x86.sh ├── android ├── LibMediaPlayer │ ├── .project │ ├── AndroidManifest.xml │ ├── build.xml │ ├── proguard-project.txt │ ├── project.properties │ └── src │ │ ├── org │ │ └── videolan │ │ │ └── vlc │ │ │ ├── Aout.java │ │ │ ├── EventManager.java │ │ │ ├── LibVLC.java │ │ │ ├── LibVlcException.java │ │ │ ├── LibVlcLibraryLoader.java │ │ │ ├── LibVlcMessages.java │ │ │ ├── events │ │ │ ├── MediaPlayerBuffering.java │ │ │ ├── MediaPlayerBufferingTotal.java │ │ │ ├── MediaPlayerModuleChanged.java │ │ │ ├── MediaPlayerPausableChanged.java │ │ │ └── MediaPlayerSeekableChanged.java │ │ │ └── segments │ │ │ ├── LibVlcVslIndex.java │ │ │ └── LibVlcVslSegment.java │ │ └── tv │ │ └── danmaku │ │ └── media │ │ ├── AbsMediaPlayer.java │ │ ├── DefMediaPlayer.java │ │ ├── LibVlcMediaPlayer.java │ │ ├── MediaInfo.java │ │ ├── MediaResource.java │ │ ├── MediaResourceGroup.java │ │ ├── MediaResourceItem.java │ │ ├── ModuleInfo.java │ │ ├── list │ │ ├── AbsMediaListLoader.java │ │ ├── DefMediaListPlayer.java │ │ ├── DefMediaSegmentPlayer.java │ │ └── MediaSegment.java │ │ ├── resource │ │ ├── FromUnknownException.java │ │ ├── Mrl.java │ │ ├── PlayIndex.java │ │ ├── ResolveException.java │ │ ├── Segment.java │ │ └── VodIndex.java │ │ └── vsl │ │ └── LibVlcVideoSegmentListLoader.java └── LibUtility │ ├── .project │ ├── AndroidManifest.xml │ ├── build.xml │ ├── proguard-project.txt │ ├── project.properties │ └── src │ └── tv │ └── danmaku │ ├── android │ ├── AudioManagerHelper.java │ ├── BuildHelper.java │ ├── ConnectivityManagerHelper.java │ ├── EnvironmentHelper.java │ ├── InputMethodManagerHelper.java │ ├── MenuHelper.java │ ├── NotificationManagerHelper.java │ ├── PackageManagerHelper.java │ ├── PowerManagerHelper.java │ ├── PropertiesHelper.java │ ├── ResourcesHelper.java │ ├── SearchManagerHelper.java │ ├── ToastHelper.java │ ├── TypeFaceHelper.java │ ├── ViewHelper.java │ ├── WindowManagerHelper.java │ ├── loader │ │ ├── LoaderBundle.java │ │ ├── LoaderLauncher.java │ │ └── LoaderRequest.java │ ├── support │ │ ├── ActionBarHelper.java │ │ ├── StrictModeHelper.java │ │ ├── SystemUIHelper.java │ │ ├── SystemUINavHider.java │ │ └── SystemUINavHider_HoneyComb.java │ └── util │ │ ├── Assure.java │ │ ├── BrightnessHelper.java │ │ ├── CollectionHelper.java │ │ ├── CpuInfo.java │ │ ├── DebugLog.java │ │ ├── IdentityComparator.java │ │ ├── ImageLruCache.java │ │ ├── IntRange.java │ │ ├── PatternHelper.java │ │ ├── RandomHelper.java │ │ ├── StreamHelper.java │ │ ├── StringHelper.java │ │ ├── TabManager.java │ │ ├── UriHelper.java │ │ ├── VerboseConfig.java │ │ ├── WeakActivity.java │ │ ├── WeakHandler.java │ │ └── WeakListeners.java │ └── pragma │ └── Pragma.java ├── ignore ├── _pull-lite-armv7a-neon.sh ├── _pull-lite-cortex-a9-vfpv3-d16.sh ├── _pull-medium-armv7a-neon.sh └── _pull-medium-cortex-a9-vfpv3-d16.sh ├── parse-stack.sh ├── patches ├── experimental │ └── nativewindow │ │ └── 0001-androidnativewindow-vout-using-nativewindow.patch ├── ports-android-app │ ├── 0001-.gitignore.patch │ ├── 0002-compile.sh-set-CHOST-for-cross-compile.patch │ ├── 0003-compile.sh-restore-saved-contrib-package.patch │ ├── 0004-compile.sh-support-fastcompile.sh.patch │ ├── 0005-compile.sh-disable-extras-tools.patch │ ├── 0006-compile.sh-config-target-abi-env.patch │ ├── 0007-Makefile-do-not-build-apk.patch │ ├── 0008-AndroidManifest.xml-minsdk-9.patch │ ├── 0009-Android.mk-include-contrib.patch │ ├── 0010-Android.mk-link-libandroid.patch │ └── 0011-_reset_vlc.sh-vlc-repo-reset-script.patch ├── ports-android │ ├── 0001-.gitignore.patch │ ├── 0002-compile.sh-set-CHOST-for-cross-compile.patch │ ├── 0003-compile.sh-restore-saved-contrib-package.patch │ ├── 0004-compile.sh-support-fastcompile.sh.patch │ ├── 0005-compile.sh-disable-extras-tools.patch │ ├── 0006-compile.sh-config-target-abi-env.patch │ ├── 0007-Makefile-do-not-build-apk.patch │ ├── 0008-AndroidManifest.xml-minsdk-9.patch │ ├── 0009-Android.mk-include-contrib.patch │ ├── 0010-Android.mk-link-libandroid.patch │ ├── 0011-_reset_vlc.sh-vlc-repo-reset-script.patch │ ├── 0012-_install_vlc.sh-vlc-lib-install-script.patch │ ├── 0013-libvlcjni-another-libvlc-wrapper.patch │ ├── 0014-jni-aout-simplify-jni-thread-attach.patch │ ├── 0015-compile.sh-fix-build-jni-for-target-x86.patch │ ├── 0016-compile.sh-make-Fedora-happy.patch │ ├── 0017-correct-a-name.patch │ ├── 0018-jni-compat.patch │ ├── cherry-picks.list │ ├── ignore │ │ ├── 0009-compile.sh-use-gcc-4.4.3.patch │ │ └── 0010-Application.mk-use-gcc-4.4.3.patch │ ├── module-full │ │ └── nothing │ ├── module-lite │ │ ├── 0001-Android.mk-link-less-libs.patch │ │ ├── 0002-configure-compile-disable-most-of-the-things.patch │ │ ├── 0003-find_modules-disable-more-modules.patch │ │ ├── 0004-compile.sh-use-ffmpeg-from-ijkplayer.patch │ │ └── ignore │ │ │ ├── 0001-lite-mode-Android.mk-disable-modules.patch │ │ │ ├── 0002-lite-mode-compile.sh-disable-contrib.patch │ │ │ ├── 0003-lite-mode-configure.sh-disable-modules.patch │ │ │ ├── 0004-lite-mode-find_modules.sh-blacklist-modules.patch │ │ │ ├── 0005-lite-mode-switch-to-ijkplayer-ffmpeg.patch │ │ │ ├── 0006-CXX-switch-to-stlport.patch │ │ │ └── 1001-lite-mode-Android.mk-enable-faad.patch.ignore │ ├── module-medium │ │ ├── 0001-medium-mode-Android.mk-disable-modules.patch │ │ ├── 0002-medium-mode-compile.sh-disable-contrib.patch │ │ ├── 0003-medium-mode-configure.sh-disable-modules.patch │ │ └── 0004-medium-mode-find_modules.sh-blacklist-modules.patch │ ├── target-armv5 │ │ └── 0001-target-abi-armv5.patch │ ├── target-armv6-vfp │ │ └── 0001-target-abi-armv6-vfp.patch │ ├── target-armv6 │ │ └── 0001-target-abi-armv6.patch │ ├── target-armv7a │ │ └── 0001-target-abi-armeabi-v7a.patch │ └── target-x86 │ │ └── 0001-target-abi-x86.patch ├── vlc-app │ ├── 0001-zlib-fix-zlib-build-on-android.patch │ └── 0002-fix-toolchain-config.patch ├── vlc-on-macosx │ └── ignore │ │ └── 0002-fix-toolchain-config.patch └── vlc │ ├── 0001-.gitignore.patch │ ├── 0002-modules-remove-unused-modules.patch │ ├── 0003-configure.ac-fix-build-of-faad.patch │ ├── 0004-main.mak-add-CHOST-for-cross-compile.patch │ ├── 0005-core-tcp-recalculate-timeout-for-EINTR.patch │ ├── 0006-core-support-total-buffering-progress.patch │ ├── 0007-core-support-echo-module-name.patch │ ├── 0008-core-vlc_stream-define-new-control-code.patch │ ├── 0009-core-vlc_array-support-vlc_array_set.patch │ ├── 0010-core-src-add-es_out_managed.patch │ ├── 0011-core-es_out-implement-es_out_managed.patch │ ├── 0012-core-add-segment-resolve-api.patch │ ├── 0013-plugin-stream_filter-add-ringbuf-membuf.patch │ ├── 0014-plugin-access-add-vsl.patch │ ├── 0015-http-add-http-option-to-disable-range-header.patch │ ├── 0016-httplive-peek-more-bytes-to-detect-m3u8.patch │ ├── 0017-httplive-download-segment-without-content-length.patch │ ├── 0018-hls-fix-position-and-length-for-streaming-mpegts-seg.patch │ ├── 0019-hls-fix-play-time-after-clock-gap-for-mpegts.patch │ ├── 0020-httplive-retry-segment-if-failed.patch │ ├── 0021-avcodec-fix-broken-picture.patch │ ├── 0022-omxil-check-h264-profile-and-level.patch │ ├── 0023-omxil-echo-OMX-name.patch │ ├── 0024-omxil-sort-hw-codec.patch │ ├── 0025-omxil-disable-audio-codec.patch │ ├── 0026-omxil-disable-debug-info.patch │ ├── 0027-omxil-always-use-pts-if-set.patch │ ├── 0028-mediacodec-disable-OMX.MTK.VIDEO.DECODER.AVC.patch │ ├── 0029-membuf-support-asynchronize-prebuffering.patch │ ├── 0030-vsl-video-segment-list.patch │ ├── 0031-ringbuf-support-asynchronized-ring-buffer.patch │ ├── 0032-avcodec-do-not-align-dimensions-on-android.patch │ ├── 0033-MediaCodec-limit-single-instance.patch │ ├── 0034-omxil-limit-single-instance.patch │ ├── 0035-MediaCodec-simplify-jni-thread-attach-detach.patch │ ├── 0036-MediaCodec-echo-name.patch │ ├── 0037-MediaCodec-only-enable-direct-render-in-white-list.patch │ ├── 0038-MediaCodec-check-exception-before-release-buffer.patch │ ├── 0040-contrib-src-main.mak-make-Fedora-happy.patch │ ├── 0041-MediaCodec-check-type-before-profile-level-to-avoid-.patch │ ├── 0042-configure-vorbis-is-not-mandatory.patch │ ├── 0043-es_out-change-input-underrun-behaviour.patch │ ├── 0045-mediacodec-check-exception-after-queueInputBuffer.patch │ ├── 0046-MediaCodec-add-k3v2-to-white-list.patch │ ├── 0047-MediaCodec-add-Intel-to-white-list.patch │ ├── ignore │ ├── 0001-android_mediacodec-do-not-repeat-attach-detach-hvm-t.patch │ ├── 0001-androidsurface-use-buffer.patch │ ├── 0001-zlib-fix-zlib-build-on-android.patch │ ├── 0011-plugin-access-add-sina.patch │ ├── 0013-configure.ac-add-android_nativewindow.patch │ ├── 0014-plugin-video_output-android_nativewindow.patch │ ├── 0019-input-fix-video-delay-after-clock-gap-for-youku-m3u8.patch │ ├── 0023-httplive-skip-failed-segment.patch │ ├── 0024-avcodec-fix-broken-picture.patch │ ├── 0033-androidsurface-do-not-post-late-picture.patch │ ├── 0033-plugin-access-add-yahls.patch │ ├── 0034-androidsurface-setup-format-depending-on-surface-for.patch │ ├── 0034-sinahttp-sina-segment-reader.patch │ ├── 0034-yahls-yet-another-http-live-stream.patch │ ├── 0035-androidnativewindow-support-video-output-based-on-Na.patch │ ├── 0035-sinaxml-sina-xml-parser.patch │ ├── 0045-mediacodec-disable-DR-for-QCOM-when-FPS-is-too-high.patch │ └── 1001-android-try-skipping-frames-automatically.patch │ ├── module-full │ └── nothing │ ├── module-lite │ └── ignore │ │ ├── 1001-lite-mode-ffmpeg-disable-modules.patch │ │ ├── 1002-ffmpeg-bump-tested-hash.patch │ │ ├── 1002-lite-mode-Modules.am-disable-modules.patch │ │ └── 1003-contrib-enable-minium-remuxing-through-ffmpeg.patch │ └── module-medium │ ├── 1001-medium-mode-ffmpeg-disable-modules.patch │ └── 1002-medium-mode-Modules.am-disable-modules.patch └── sync-vlc.sh /.gitignore: -------------------------------------------------------------------------------- 1 | /tarballs 2 | /extra-package 3 | /vlc-lite-armv5 4 | /vlc-lite-armv6 5 | /vlc-lite-armv6-vfp 6 | /vlc-lite-armv7a 7 | /vlc-lite-armv7a-neon 8 | /vlc-lite-cortex-a9-vfpv3-d16 9 | /vlc-lite-x86 10 | /vlc-medium-armv7a-neon 11 | /vlc-medium-cortex-a9-vfpv3-d16 12 | /vlc-app 13 | /vlc-fork 14 | /_ndk_stack.sh 15 | /_addr2line.sh 16 | /tmp 17 | 18 | /MobileVLC 19 | /ios-tool-tarballs 20 | 21 | # svn 22 | .svn/ 23 | 24 | # vlc build env 25 | vlc-android-macbuild/ 26 | 27 | # built application files 28 | *.apk 29 | *.ap_ 30 | 31 | # files for the dex VM 32 | *.dex 33 | 34 | # Java class files 35 | *.class 36 | *.jar 37 | 38 | # native module 39 | *.so 40 | 41 | # generated files 42 | bin/ 43 | gen/ 44 | 45 | # Local configuration file (sdk path, etc) 46 | .metadata 47 | local.properties 48 | .classpath 49 | lint.xml 50 | bili.keystore.properties 51 | 52 | # temp files 53 | Thumbs.db 54 | Desktop.ini 55 | .DS_Store 56 | *.tmp 57 | *.bak 58 | *.swp 59 | 60 | # temp ignore 61 | 62 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | vlc-android-macbuild 2 | ------- 3 | 4 | Most files in vlc-android-macbuild are under the GNU lesser General Public License version 2.1 or later (LGPL v2.1+). Read the file COPYING.LGPLv2.1 for details. 5 | 6 | /patches/vlc/100*.patch 7 | ------- 8 | These patches are supposed to be contributed by tewilove under the LGPL (may be v2.1+). 9 | 10 | VLC 11 | ------- 12 | Most files of VLC are licensed under the GPL v2+ and LGPL v2.1+. Read files below for licensing details. 13 | 14 | vlc-ports-android/COPYING 15 | vlc-ports-android/vlc/COPYING 16 | vlc-ports-android/vlc/COPYING.LIB 17 | 18 | There are many libraries used in VLC. Read their source code or visit http://videolan.org for licensing details. 19 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | # Deprecated 2 | * Welcome to my new project https://github.com/bbcallen/ijkplayer 3 | * Or fork official repo http://git.videolan.org/?p=vlc-ports/android.git;a=summary 4 | 5 | # HOWTO 6 | 0. Requirements (AFAIK) 7 | * MacOS or Linux (tested on CentOS) 8 | * ADK 9 | * NDK-r7c ~ r8b 10 | 11 | * MacPorts (for MacOS to upgrade tools) 12 | * sudo port -vd install wget 13 | * sudo port -vd install xz 14 | * sudo port -vd install git-core 15 | * sudo port -vd install cmake 16 | * sudo port -vd install grep 17 | * sudo port -vd install autoconf 18 | * sudo port -vd install libtool 19 | * sudo port -vd install pkgconfig 20 | * sudo port -vd install yasm 21 | 22 | * Install automake 1.11.x (for MacOS) 23 | # contrib can not be built with automake 1.10 or 1.12 24 | * cd /tmp 25 | * # @89623 for automake 1.11.3 26 | * # @91506 for automake 1.11.4 27 | * # @91935 for automake 1.11.5 28 | * svn co -r 89623 http://svn.macports.org/repository/macports/trunk/dports/devel/automake 29 | * cd automake 30 | * sudo port -vd install 31 | 32 | * Upgrade config.sub (for Linux) 33 | * upgrade config.sub of automake (to recognize `arm-linux-androideabi`) 34 | 35 | 1. If you meet any trouble, this article may help you. 36 | Read this article http://www.doitscared.com/?p=649 37 | 38 | 2. Fetch build scripts for mac 39 | git clone git@github.com:bbcallen/vlc-android-macbuild.git vlc-android-macbuild 40 | 41 | 3. Build VLC app 42 | cd vlc-android-macbuild 43 | sh _pull-app.sh 44 | cd vlc-app/vlc-app-armv7a 45 | sh _reset_vlc.sh 46 | sh compile.sh 47 | 48 | 4. Build customized VlcDemo (FOR MY OWN TEST ONLY) 49 | cd vlc-android-macbuild 50 | sh _pull-lite-armv7a.sh 51 | cd vlc-lite-armv7a 52 | sh _reset_vlc.sh 53 | sh compile.sh 54 | 55 | # NOTICE 56 | 0. This build is only for cross-compiling on MacOS, as I don't have setup any other *nix OS for now. You should follow the offical build if you need build on other *nix OS. 57 | 58 | 1. Patches under /patches/vlc is OK for other build OS. They are licensed under LGPLv2.1, hmmm, supposed. 59 | 60 | 2. This build is used in my own app. Some jni interfaces have been modified. You should modify or ignore patches under /patches/ports-android and /patches/vlc. Mail me if you have any problem about these patches. 61 | 62 | # TROUBLESHOOT 63 | * Invalid configuration `arm-linux-androideabi' 64 | upgrade config.sub of automake, see _install_libs_on_centos.sh for more information 65 | 66 | # Extra, not necessary 67 | * for git send-email 68 | * sudo port -vd install msmtp 69 | * pear-Net_SMTP 70 | * sudo port -vd install p5-net-ssh-perl 71 | * sudo wget -O /certificates/EquifaxSecureCertificateAuthority.crt http://msmtp.sourceforge.net/ 72 | 73 | -------------------------------------------------------------------------------- /_do_pull.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | if [ -z "$BILI_VLC_ROOT" ]; then 4 | echo "_do_pull.sh is not supposed been executed directly" 5 | echo "execute _pull_xxx.sh instead" 6 | exit 1 7 | fi 8 | 9 | BILI_VLC_ANDROID_HASH=de1641d 10 | echo "pull "${BILI_VLC_ROOT}":"${BILI_VLC_ANDROID_HASH} 11 | 12 | if [ ! -d ${BILI_VLC_ROOT} ]; then 13 | echo "vlc-ports/android source not found, cloning" 14 | git clone git://git.videolan.org/vlc-ports/android ${BILI_VLC_ROOT} 15 | cd ${BILI_VLC_ROOT} 16 | git checkout -B bili ${BILI_VLC_ANDROID_HASH} 17 | cd - 18 | else 19 | echo "vlc-ports/android source found, pulling from remote master" 20 | cd ${BILI_VLC_ROOT} 21 | git fetch origin 22 | git checkout -B bili ${BILI_VLC_ANDROID_HASH} 23 | cd - 24 | fi 25 | 26 | echo "patch "${BILI_VLC_MODULE_MODE} ${BILI_VLC_TARGET_MODE} 27 | cd ${BILI_VLC_ROOT} 28 | 29 | if [ -f ../patches/ports-android/cherry-picks.list ]; then 30 | commits=$(cat ../patches/ports-android/cherry-picks.list) 31 | for c in $commits; do 32 | git cherry-pick $c || exit 1 33 | done 34 | fi 35 | 36 | git am --abort 37 | git am ../patches/ports-android/*.patch 38 | git am ../patches/ports-android/${BILI_VLC_MODULE_MODE}/*.patch 39 | git am ../patches/ports-android/${BILI_VLC_TARGET_MODE}/*.patch 40 | 41 | mkdir -p patches 42 | rm patches/100*.patch 43 | cp ../patches/vlc/${BILI_VLC_MODULE_MODE}/100*.patch patches/ 44 | 45 | cd - 46 | -------------------------------------------------------------------------------- /_do_reset_vlc.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | do_apply_patches() { 4 | n=0 5 | for p in $1/*.patch; do 6 | r=$((n-n/10*10)) 7 | n=$((n+1)) 8 | if [ $r -eq 0 ]; then sleep 3; fi 9 | echo "VLC <= ${p}" 10 | git am $p || break 11 | done 12 | } 13 | 14 | BUILD_PLATFORM='unknown' 15 | if [ "$(uname)" = 'Linux' ]; then 16 | BUILD_PLATFORM='linux' 17 | elif [ "$(uname)" = 'Darwin' ]; then 18 | BUILD_PLATFORM='darwin' 19 | fi 20 | 21 | if [ ! -d "vlc-android" ]; then 22 | echp "_do_reset_vlc.sh is not supposed been executed directly" 23 | echo "MUST under vlc-ports/android" 24 | exit 1 25 | fi 26 | 27 | # 1/ libvlc, libvlccore and its plugins 28 | TESTED_HASH=602d02a 29 | if [ ! -d "vlc" ]; then 30 | echo "VLC source not found, cloning" 31 | git clone git://git.videolan.org/vlc.git vlc 32 | cd vlc 33 | else 34 | echo "VLC source found" 35 | cd vlc 36 | git reset --hard origin 37 | git fetch origin 38 | fi 39 | 40 | echo "=======================================" 41 | echo "Reset to brance android ${TESTED_HASH}" 42 | git checkout -B android ${TESTED_HASH} 43 | git am --abort 44 | 45 | echo "=======================================" 46 | echo "Applying the patches" 47 | do_apply_patches ../patches 48 | 49 | if [ ${BUILD_PLATFORM} = 'darwin' ]; then 50 | echo "=======================================" 51 | echo "Applying the patches for build on darwin" 52 | # git am ../../patches/vlc-on-macosx/*.patch 53 | fi 54 | 55 | echo "=======================================" 56 | echo "Applying the patches for libvlc_danmaku" 57 | do_apply_patches ../../patches/vlc 58 | echo "=======================================" 59 | 60 | cd - 61 | -------------------------------------------------------------------------------- /_install_libs_on_centos.sh: -------------------------------------------------------------------------------- 1 | # if your git does not support -B 2 | # yum -install zlib-devel openssl-devel cpio expat-devel gettext-devel 3 | mkdir -p tmp 4 | cd tmp 5 | wget http://git-core.googlecode.com/files/git-1.7.10.2.tar.gz 6 | tar -xzvf ./git-1.7.10.2.tar.gz 7 | cd ./git-1.7.10.2 8 | ./configure 9 | make 10 | make install 11 | cd - 12 | 13 | 14 | 15 | # update config.sub and config.guess on centos 16 | # mkdir -p tmp 17 | # cd tmp 18 | # git clone http://git.savannah.gnu.org/cgit/config.git gnu-config 19 | # 20 | # - if you want to compile directly from our GIT repo you might run into 21 | # this issue with older automake stuff: 22 | # checking host system type... 23 | # Invalid configuration `arm-linux-androideabi': 24 | # system `androideabi' not recognized 25 | # configure: error: /bin/sh ./config.sub arm-linux-androideabi failed 26 | # this issue can be fixed with using more recent versions of config.sub 27 | # and config.guess which can be obtained here: 28 | # http://git.savannah.gnu.org/gitweb/?p=config.git;a=tree 29 | # you need to replace your system-own versions which usually can be 30 | # found in your automake folder: 31 | # find /usr -name config.sub 32 | -------------------------------------------------------------------------------- /_pull-app.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | export BILI_VLC_ROOT="vlc-app-armv7a" 4 | export BILI_VLC_MODULE_MODE="module-full" 5 | export BILI_VLC_TARGET_MODE="target-armv7a" 6 | 7 | mkdir -p vlc-app 8 | cd vlc-app 9 | 10 | rm tarballs 11 | ln -s ../tarballs 12 | 13 | rm _do_reset_vlc.sh 14 | ln -s ../_do_reset_vlc.sh _do_reset_vlc.sh 15 | 16 | mkdir -p patches/ports-android/${BILI_VLC_TARGET_MODE} 17 | rm patches/ports-android/*.patch 18 | cp ../patches/ports-android-app/*.patch patches/ports-android/ 19 | cp ../patches/ports-android/${BILI_VLC_TARGET_MODE}/*.patch patches/ports-android/${BILI_VLC_TARGET_MODE} 20 | 21 | mkdir -p patches/vlc 22 | rm patches/vlc/*.patch 23 | cp ../patches/vlc-app/*.patch patches/vlc/ 24 | 25 | sh ../_do_pull.sh 26 | 27 | cd - 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /_pull-lite-armv5.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | export BILI_VLC_ROOT="vlc-lite-armv5" 4 | export BILI_VLC_MODULE_MODE="module-lite" 5 | export BILI_VLC_TARGET_MODE="target-armv5" 6 | 7 | sh _do_pull.sh 8 | -------------------------------------------------------------------------------- /_pull-lite-armv6-vfp.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | export BILI_VLC_ROOT="vlc-lite-armv6-vfp" 4 | export BILI_VLC_MODULE_MODE="module-lite" 5 | export BILI_VLC_TARGET_MODE="target-armv6-vfp" 6 | 7 | sh _do_pull.sh 8 | -------------------------------------------------------------------------------- /_pull-lite-armv6.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | export BILI_VLC_ROOT="vlc-lite-armv6" 4 | export BILI_VLC_MODULE_MODE="module-lite" 5 | export BILI_VLC_TARGET_MODE="target-armv6" 6 | 7 | sh _do_pull.sh 8 | -------------------------------------------------------------------------------- /_pull-lite-armv7a.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | export BILI_VLC_ROOT="vlc-lite-armv7a" 4 | export BILI_VLC_MODULE_MODE="module-lite" 5 | export BILI_VLC_TARGET_MODE="target-armv7a" 6 | 7 | sh _do_pull.sh 8 | -------------------------------------------------------------------------------- /_pull-lite-x86.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | export BILI_VLC_ROOT="vlc-lite-x86" 4 | export BILI_VLC_MODULE_MODE="module-lite" 5 | export BILI_VLC_TARGET_MODE="target-x86" 6 | 7 | sh _do_pull.sh 8 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | LibPlayer 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-16 15 | android.library=true 16 | android.library.reference.1=../Utility 17 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/org/videolan/vlc/Aout.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Aout.java 3 | ***************************************************************************** 4 | * Copyright © 2011-2012 VLC authors and VideoLAN 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 19 | *****************************************************************************/ 20 | 21 | package org.videolan.vlc; 22 | 23 | import android.media.AudioFormat; 24 | import android.media.AudioManager; 25 | import android.media.AudioTrack; 26 | import android.util.Log; 27 | 28 | public class Aout { 29 | /** 30 | * Java side of the audio output module for Android. 31 | * Uses an AudioTrack to play decoded audio buffers. 32 | * 33 | * TODO Use MODE_STATIC instead of MODE_STREAM with a MemoryFile (ashmem) 34 | */ 35 | 36 | public Aout() { 37 | } 38 | 39 | private AudioTrack mAudioTrack; 40 | private static final String TAG = "LibVLC/aout"; 41 | 42 | public void init(int sampleRateInHz, int channels, int samples) { 43 | Log.d(TAG, sampleRateInHz + ", " + channels + ", " + samples + "=>" + channels * samples); 44 | int minBufferSize = AudioTrack.getMinBufferSize(sampleRateInHz, 45 | AudioFormat.CHANNEL_OUT_STEREO, 46 | AudioFormat.ENCODING_PCM_16BIT); 47 | mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, 48 | sampleRateInHz, 49 | AudioFormat.CHANNEL_OUT_STEREO, 50 | AudioFormat.ENCODING_PCM_16BIT, 51 | Math.max(minBufferSize, channels * samples * 2), 52 | AudioTrack.MODE_STREAM); 53 | } 54 | 55 | public void release() { 56 | if (mAudioTrack != null) { 57 | mAudioTrack.release(); 58 | } 59 | mAudioTrack = null; 60 | } 61 | 62 | public void playBuffer(byte[] audioData, int bufferSize) { 63 | if (mAudioTrack.getState() == AudioTrack.STATE_UNINITIALIZED) 64 | return; 65 | if (mAudioTrack.write(audioData, 0, bufferSize) != bufferSize) { 66 | Log.w(TAG, "Could not write all the samples to the audio device"); 67 | } 68 | mAudioTrack.play(); 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/org/videolan/vlc/LibVlcException.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * LibVlcException.java 3 | ***************************************************************************** 4 | * Copyright © 2011-2012 VLC authors and VideoLAN 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 19 | *****************************************************************************/ 20 | 21 | /** 22 | * LibVlcException: exceptions thrown by the native LibVLC interface 23 | */ 24 | package org.videolan.vlc; 25 | 26 | /** 27 | * @author jpeg 28 | * 29 | */ 30 | public class LibVlcException extends Exception { 31 | private static final long serialVersionUID = -1909522348226924189L; 32 | 33 | /** 34 | * Create an empty error 35 | */ 36 | public LibVlcException() { 37 | super(); 38 | } 39 | 40 | /** 41 | * @param detailMessage 42 | */ 43 | public LibVlcException(String detailMessage) { 44 | super(detailMessage); 45 | } 46 | 47 | /** 48 | * @param throwable 49 | */ 50 | public LibVlcException(Throwable throwable) { 51 | super(throwable); 52 | } 53 | 54 | /** 55 | * @param detailMessage 56 | * @param throwable 57 | */ 58 | public LibVlcException(String detailMessage, Throwable throwable) { 59 | super(detailMessage, throwable); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/org/videolan/vlc/LibVlcLibraryLoader.java: -------------------------------------------------------------------------------- 1 | package org.videolan.vlc; 2 | 3 | import android.content.Context; 4 | 5 | public interface LibVlcLibraryLoader { 6 | public abstract void loadVlcLibIomx(Context context) 7 | throws UnsatisfiedLinkError, SecurityException; 8 | 9 | public abstract void loadLibVlc(Context context) 10 | throws UnsatisfiedLinkError, SecurityException; 11 | } 12 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/org/videolan/vlc/LibVlcMessages.java: -------------------------------------------------------------------------------- 1 | package org.videolan.vlc; 2 | 3 | public class LibVlcMessages { 4 | public static final int VLC_EVENT = 1; 5 | public static final int VLC_VIDEO_SIZE_CHANGED = 2; 6 | public static final int VLC_FAKE_PREPARED = 3; 7 | } 8 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/org/videolan/vlc/events/MediaPlayerBuffering.java: -------------------------------------------------------------------------------- 1 | package org.videolan.vlc.events; 2 | 3 | import android.os.Bundle; 4 | 5 | public class MediaPlayerBuffering { 6 | private static final String BUNDLE_NEW_CACHE = "new_cache"; 7 | 8 | public float mNewCache; 9 | 10 | public MediaPlayerBuffering(Bundle args) { 11 | mNewCache = getNewCache(args); 12 | } 13 | 14 | public static float getNewCache(Bundle args) { 15 | return args.getFloat(BUNDLE_NEW_CACHE, 0.0f); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/org/videolan/vlc/events/MediaPlayerBufferingTotal.java: -------------------------------------------------------------------------------- 1 | package org.videolan.vlc.events; 2 | 3 | import android.os.Bundle; 4 | 5 | public class MediaPlayerBufferingTotal { 6 | private static final String BUNDLE_NEW_CACHE_TOTAL = "new_cache_total"; 7 | 8 | public float mNewCacheTotal; 9 | 10 | public MediaPlayerBufferingTotal(Bundle args) { 11 | mNewCacheTotal = getNewCacheTotal(args); 12 | } 13 | 14 | public static float getNewCacheTotal(Bundle args) { 15 | return args.getFloat(BUNDLE_NEW_CACHE_TOTAL, 0.0f); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/org/videolan/vlc/events/MediaPlayerModuleChanged.java: -------------------------------------------------------------------------------- 1 | package org.videolan.vlc.events; 2 | 3 | import android.os.Bundle; 4 | 5 | public class MediaPlayerModuleChanged { 6 | private static final String BUNDLE_VIDEO_DECODER = "video_decoder"; 7 | private static final String BUNDLE_AUDIO_DECODER = "audio_decoder"; 8 | private static final String BUNDLE_VIDEO_DECODER_IMPL = "video_decoder_impl"; 9 | private static final String BUNDLE_AUDIO_DECODER_IMPL = "audio_decoder_impl"; 10 | 11 | public String mVideoDecoder; 12 | public String mAudioDecoder; 13 | public String mVideoDecoderImpl; 14 | public String mAudioDecoderImpl; 15 | 16 | public MediaPlayerModuleChanged(Bundle args) { 17 | mVideoDecoder = getVideoDecoder(args); 18 | mAudioDecoder = getAudioDecoder(args); 19 | mVideoDecoderImpl = getVideoDecoderImpl(args); 20 | mAudioDecoderImpl = getAudioDecoderImpl(args); 21 | } 22 | 23 | public static String getVideoDecoder(Bundle args) { 24 | return args.getString(BUNDLE_VIDEO_DECODER); 25 | } 26 | 27 | public static String getAudioDecoder(Bundle args) { 28 | return args.getString(BUNDLE_AUDIO_DECODER); 29 | } 30 | 31 | public static String getVideoDecoderImpl(Bundle args) { 32 | return args.getString(BUNDLE_VIDEO_DECODER_IMPL); 33 | } 34 | 35 | public static String getAudioDecoderImpl(Bundle args) { 36 | return args.getString(BUNDLE_AUDIO_DECODER_IMPL); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/org/videolan/vlc/events/MediaPlayerPausableChanged.java: -------------------------------------------------------------------------------- 1 | package org.videolan.vlc.events; 2 | 3 | import android.os.Bundle; 4 | 5 | public class MediaPlayerPausableChanged { 6 | private static final String BUNDLE_NEW_PAUSABLE = "new_pausable"; 7 | 8 | public boolean mNewPausable; 9 | 10 | public MediaPlayerPausableChanged(Bundle args) { 11 | mNewPausable = getNewPausable(args); 12 | } 13 | 14 | public static boolean getNewPausable(Bundle args) { 15 | return args.getInt(BUNDLE_NEW_PAUSABLE, 1) != 0; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/org/videolan/vlc/events/MediaPlayerSeekableChanged.java: -------------------------------------------------------------------------------- 1 | package org.videolan.vlc.events; 2 | 3 | import android.os.Bundle; 4 | 5 | public class MediaPlayerSeekableChanged { 6 | private static final String BUNDLE_NEW_SEEKABLE = "new_seekable"; 7 | 8 | public boolean mNewSeekable; 9 | 10 | public MediaPlayerSeekableChanged(Bundle args) { 11 | mNewSeekable = getNewSeekable(args); 12 | } 13 | 14 | public static boolean getNewSeekable(Bundle args) { 15 | return args.getInt(BUNDLE_NEW_SEEKABLE, 1) != 0; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/org/videolan/vlc/segments/LibVlcVslIndex.java: -------------------------------------------------------------------------------- 1 | package org.videolan.vlc.segments; 2 | 3 | import java.util.ArrayList; 4 | 5 | import android.os.Bundle; 6 | 7 | public class LibVlcVslIndex { 8 | private static final String BUNDLE_COUNT = "count"; 9 | 10 | public ArrayList mList; 11 | 12 | public Bundle getBundle() { 13 | Bundle args = new Bundle(); 14 | putInto(args); 15 | return args; 16 | } 17 | 18 | public void putInto(Bundle args) { 19 | if (mList != null && !mList.isEmpty()) { 20 | putCount(args, mList.size()); 21 | for (LibVlcVslSegment segment : mList) { 22 | segment.putInto(args); 23 | } 24 | } 25 | } 26 | 27 | public static void putCount(Bundle args, int count) { 28 | args.putInt(BUNDLE_COUNT, count); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/org/videolan/vlc/segments/LibVlcVslSegment.java: -------------------------------------------------------------------------------- 1 | package org.videolan.vlc.segments; 2 | 3 | import android.os.Bundle; 4 | 5 | public class LibVlcVslSegment { 6 | private static final String BUNDLE_FMT1_SEGMENT_MRL = "%d_segment_mrl"; 7 | private static final String BUNDLE_FMT1_SEGMENT_URL = "%d_segment_url"; 8 | private static final String BUNDLE_FMT1_DURATION = "%d_duration"; 9 | private static final String BUNDLE_FMT1_BYTES = "%d_bytes"; 10 | 11 | public int mOrder; // 0-based 12 | public String mSegmentMrl; 13 | public String mSegmentUrl; 14 | public int mDuration; // in milliseconds 15 | public long mBytes; // 0 for unknown 16 | 17 | public Bundle getBundle() { 18 | Bundle args = new Bundle(); 19 | putInto(args); 20 | return args; 21 | } 22 | 23 | public void putInto(Bundle args) { 24 | putSegmentMrl(args, mOrder, mSegmentMrl); 25 | putSegmentUrl(args, mOrder, mSegmentUrl); 26 | putDuration(args, mOrder, mDuration); 27 | putBytes(args, mOrder, mBytes); 28 | } 29 | 30 | public static void putSegmentMrl(Bundle args, int order, String segmentMrl) { 31 | args.putString(String.format(BUNDLE_FMT1_SEGMENT_MRL, order), 32 | segmentMrl); 33 | } 34 | 35 | public static void putSegmentUrl(Bundle args, int order, String segmentUrl) { 36 | args.putString(String.format(BUNDLE_FMT1_SEGMENT_URL, order), 37 | segmentUrl); 38 | } 39 | 40 | public static void putDuration(Bundle args, int order, int duration) { 41 | args.putInt(String.format(BUNDLE_FMT1_DURATION, order), duration); 42 | } 43 | 44 | public static void putBytes(Bundle args, int order, long bytes) { 45 | args.putLong(String.format(BUNDLE_FMT1_BYTES, order), bytes); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/tv/danmaku/media/MediaInfo.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.media; 2 | 3 | public class MediaInfo { 4 | public int mVideoWidth; 5 | public int mVideoHeight; 6 | 7 | public ModuleInfo mModuleInfo; 8 | 9 | public final String getResolution() { 10 | if (mVideoWidth <= 0 || mVideoHeight <= 0) 11 | return "N/A"; 12 | 13 | return String.format("%dx%d", mVideoWidth, mVideoHeight); 14 | } 15 | 16 | public final String getVideoDecoderInline() { 17 | if (mModuleInfo == null) 18 | return "N/A"; 19 | 20 | return mModuleInfo.getVideoDecoderInline(); 21 | } 22 | 23 | public final String getAudioDecoderInline() { 24 | if (mModuleInfo == null) 25 | return "N/A"; 26 | 27 | return mModuleInfo.getAudioDecoderInline(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/tv/danmaku/media/MediaResource.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.media; 2 | 3 | import android.os.Bundle; 4 | import android.os.Parcel; 5 | import android.os.Parcelable; 6 | import tv.danmaku.media.resource.VodIndex; 7 | 8 | public class MediaResource implements Parcelable { 9 | private static final String BUNDLE_HIGH_QUAL_GROUP = "high_qual_group"; 10 | private static final String BUNDLE_LOW_QUAL_GROUP = "low_qual_group"; 11 | 12 | private static final String BUNDLE_VOD_INDEX = "vod_index"; 13 | 14 | // 优先级 1st > mrl > 2nd 15 | // new params 16 | public MediaResourceGroup mHighQualGroup; 17 | public MediaResourceGroup mLowQualGroup; 18 | 19 | // 点播列表, 新浪和优酷源, 第三方播放器, MediaListPlayer用 20 | // TODO deprecate this field 21 | public VodIndex mVodIndex; // vod解析后的vod列表 22 | 23 | public MediaResource() { 24 | mHighQualGroup = new MediaResourceGroup(); 25 | mLowQualGroup = new MediaResourceGroup(); 26 | } 27 | 28 | // for Parcelable 29 | @Override 30 | public int describeContents() { 31 | return 0; 32 | } 33 | 34 | @Override 35 | public void writeToParcel(Parcel dest, int flags) { 36 | Bundle bundle = new Bundle(); 37 | 38 | bundle.putParcelable(BUNDLE_HIGH_QUAL_GROUP, mHighQualGroup); 39 | bundle.putParcelable(BUNDLE_LOW_QUAL_GROUP, mLowQualGroup); 40 | 41 | bundle.putParcelable(BUNDLE_VOD_INDEX, mVodIndex); 42 | 43 | dest.writeBundle(bundle); 44 | } 45 | 46 | private MediaResource(Parcel in) { 47 | Bundle bundle = in.readBundle(MediaResource.class.getClassLoader()); 48 | 49 | mHighQualGroup = bundle.getParcelable(BUNDLE_HIGH_QUAL_GROUP); 50 | mLowQualGroup = bundle.getParcelable(BUNDLE_LOW_QUAL_GROUP); 51 | 52 | mVodIndex = bundle.getParcelable(BUNDLE_VOD_INDEX); 53 | } 54 | 55 | public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { 56 | public MediaResource createFromParcel(Parcel in) { 57 | return new MediaResource(in); 58 | } 59 | 60 | public MediaResource[] newArray(int size) { 61 | return new MediaResource[size]; 62 | } 63 | }; 64 | } 65 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/tv/danmaku/media/MediaResourceItem.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.media; 2 | 3 | import tv.danmaku.android.util.Assure; 4 | import android.os.Bundle; 5 | import android.os.Parcel; 6 | import android.os.Parcelable; 7 | import android.text.TextUtils; 8 | 9 | public class MediaResourceItem implements Parcelable { 10 | private static final String BUNDLE_FROM_TAG = "from_tag"; 11 | private static final String BUNDLE_TYPE_TAG = "type_tag"; 12 | private static final String BUNDLE_MRL = "mrl"; 13 | private static final String BUNDLE_IS_INDEX_MRL = "is_index_mrl"; 14 | private static final String BUNDLE_NEED_MEMBUF = "need_membuf"; 15 | 16 | public static final String TYPE_TAG__ANY = "any"; // try HW 17 | public static final String TYPE_TAG__HLS = "hls"; // SW only 18 | public static final String TYPE_TAG__MP4 = "mp4"; // try HW 19 | public static final String TYPE_TAG__FLV = "flv"; // try HW 20 | 21 | public String mFromTag; 22 | public String mTypeTag; 23 | public String mMrl; 24 | public boolean mIsIndexMrl; 25 | public boolean mNeedMembuf; 26 | 27 | public MediaResourceItem() { 28 | } 29 | 30 | final public boolean isNormalMediaUrl() { 31 | if (isIndexMrl()) 32 | return false; 33 | 34 | return true; 35 | } 36 | 37 | final public boolean isIndexMrl() { 38 | return mIsIndexMrl; 39 | } 40 | 41 | final public boolean isType(String typeTag) { 42 | Assure.checkNotEmptyString(typeTag); 43 | if (TextUtils.isEmpty(mTypeTag)) 44 | return false; 45 | 46 | return mTypeTag.equalsIgnoreCase(typeTag); 47 | } 48 | 49 | final public boolean isType_hls() { 50 | return isType(TYPE_TAG__HLS); 51 | } 52 | 53 | final public boolean isType_mp4() { 54 | return isType(TYPE_TAG__MP4); 55 | } 56 | 57 | final public boolean isSWOnly() { 58 | return isType(TYPE_TAG__HLS); 59 | } 60 | 61 | final public boolean needMembuf() { 62 | return mNeedMembuf; 63 | } 64 | 65 | // for Parcelable 66 | @Override 67 | public int describeContents() { 68 | return 0; 69 | } 70 | 71 | @Override 72 | public void writeToParcel(Parcel dest, int flags) { 73 | Bundle bundle = new Bundle(); 74 | 75 | bundle.putString(BUNDLE_FROM_TAG, mFromTag); 76 | bundle.putString(BUNDLE_TYPE_TAG, mTypeTag); 77 | bundle.putString(BUNDLE_MRL, mMrl); 78 | bundle.putBoolean(BUNDLE_IS_INDEX_MRL, mIsIndexMrl); 79 | bundle.putBoolean(BUNDLE_NEED_MEMBUF, mNeedMembuf); 80 | 81 | dest.writeBundle(bundle); 82 | } 83 | 84 | private MediaResourceItem(Parcel in) { 85 | Bundle bundle = in.readBundle(MediaResourceItem.class.getClassLoader()); 86 | 87 | mFromTag = bundle.getString(BUNDLE_FROM_TAG); 88 | mTypeTag = bundle.getString(BUNDLE_TYPE_TAG); 89 | mMrl = bundle.getString(BUNDLE_MRL); 90 | mIsIndexMrl = bundle.getBoolean(BUNDLE_IS_INDEX_MRL); 91 | mNeedMembuf = bundle.getBoolean(BUNDLE_NEED_MEMBUF); 92 | } 93 | 94 | public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { 95 | public MediaResourceItem createFromParcel(Parcel in) { 96 | return new MediaResourceItem(in); 97 | } 98 | 99 | public MediaResourceItem[] newArray(int size) { 100 | return new MediaResourceItem[size]; 101 | } 102 | }; 103 | } 104 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/tv/danmaku/media/ModuleInfo.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.media; 2 | 3 | import org.videolan.vlc.events.MediaPlayerModuleChanged; 4 | 5 | import android.os.Bundle; 6 | import android.text.TextUtils; 7 | 8 | public class ModuleInfo { 9 | public String mVideoDecoder; 10 | public String mVideoDecoderImpl; 11 | 12 | public String mAudioDecoder; 13 | public String mAudioDecoderImpl; 14 | 15 | public static ModuleInfo sAndroidModuleInfo; 16 | public static ModuleInfo sAndroidListModuleInfo; 17 | 18 | public static ModuleInfo parseModuleInfo(Bundle args) { 19 | ModuleInfo moduleInfo = new ModuleInfo(); 20 | 21 | moduleInfo.mVideoDecoder = MediaPlayerModuleChanged 22 | .getVideoDecoder(args); 23 | moduleInfo.mVideoDecoderImpl = MediaPlayerModuleChanged 24 | .getVideoDecoderImpl(args); 25 | 26 | moduleInfo.mAudioDecoder = MediaPlayerModuleChanged 27 | .getAudioDecoder(args); 28 | moduleInfo.mAudioDecoderImpl = MediaPlayerModuleChanged 29 | .getAudioDecoderImpl(args); 30 | 31 | return moduleInfo; 32 | } 33 | 34 | public static ModuleInfo getAndroidModuleInfo() { 35 | if (sAndroidModuleInfo == null) { 36 | ModuleInfo module = new ModuleInfo(); 37 | 38 | module.mVideoDecoder = "android"; 39 | module.mVideoDecoderImpl = "HW"; 40 | 41 | module.mAudioDecoder = "android"; 42 | module.mAudioDecoderImpl = "HW"; 43 | 44 | sAndroidModuleInfo = module; 45 | } 46 | 47 | return sAndroidModuleInfo; 48 | } 49 | 50 | public static ModuleInfo getAndroidListModuleInfo() { 51 | if (sAndroidModuleInfo == null) { 52 | ModuleInfo module = new ModuleInfo(); 53 | 54 | module.mVideoDecoder = "android"; 55 | module.mVideoDecoderImpl = "SYS-HW"; 56 | 57 | module.mAudioDecoder = "android"; 58 | module.mAudioDecoderImpl = "SYS-HW"; 59 | 60 | sAndroidModuleInfo = module; 61 | } 62 | 63 | return sAndroidModuleInfo; 64 | } 65 | 66 | public static ModuleInfo getNullModuleInfo() { 67 | ModuleInfo module = new ModuleInfo(); 68 | return module; 69 | } 70 | 71 | public final String getVideoDecoderInline() { 72 | if (TextUtils.isEmpty(mVideoDecoder)) 73 | return "N/A"; 74 | 75 | StringBuilder sb = new StringBuilder(mVideoDecoder); 76 | sb.append(": "); 77 | if (TextUtils.isEmpty(mVideoDecoderImpl)) { 78 | sb.append("SW"); 79 | } else { 80 | sb.append(mVideoDecoderImpl); 81 | } 82 | 83 | return sb.toString(); 84 | } 85 | 86 | public final String getAudioDecoderInline() { 87 | if (TextUtils.isEmpty(mAudioDecoder)) 88 | return "N/A"; 89 | 90 | StringBuilder sb = new StringBuilder(mAudioDecoder); 91 | sb.append(": "); 92 | if (TextUtils.isEmpty(mAudioDecoderImpl)) { 93 | sb.append("SW"); 94 | } else { 95 | sb.append(mAudioDecoderImpl); 96 | } 97 | 98 | return sb.toString(); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/tv/danmaku/media/list/AbsMediaListLoader.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.media.list; 2 | 3 | import android.content.Context; 4 | 5 | public abstract class AbsMediaListLoader { 6 | abstract public void setMediaListUrl(String url); 7 | 8 | abstract public boolean loadList(Context context); 9 | 10 | abstract public boolean isLoaded(); 11 | 12 | abstract public int getTotalDuration(); 13 | 14 | abstract public int getMediaCount(); 15 | 16 | abstract public MediaSegment getMediaItem(int index); 17 | 18 | abstract public int getItemIndexByTime(int msec); 19 | } 20 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/tv/danmaku/media/list/DefMediaSegmentPlayer.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.media.list; 2 | 3 | import java.io.IOException; 4 | 5 | import tv.danmaku.android.util.DebugLog; 6 | import tv.danmaku.media.resource.Segment; 7 | 8 | import android.media.MediaPlayer; 9 | 10 | public class DefMediaSegmentPlayer extends MediaPlayer { 11 | public static String TAG = DefMediaSegmentPlayer.class.getName(); 12 | private int mOrder = -1; 13 | private Segment mSegment; 14 | private int mStartTime; 15 | 16 | final public int getOrder() { 17 | return mOrder; 18 | } 19 | 20 | final public int getStartTime() { 21 | return mStartTime; 22 | } 23 | 24 | final public Segment getSegment() { 25 | return mSegment; 26 | } 27 | 28 | final public void setSegment(int order, int startTime, Segment segment) 29 | throws IllegalArgumentException, IllegalStateException, IOException { 30 | mOrder = order; 31 | mStartTime = startTime; 32 | mSegment = segment; 33 | 34 | DebugLog.dfmt(TAG, "set item [%d] %d(%d) %s", order, startTime, 35 | segment.mDuration, segment.mUrl); 36 | super.setDataSource(segment.mUrl); 37 | } 38 | 39 | final public boolean hasSegment() { 40 | return mSegment != null; 41 | } 42 | 43 | @Override 44 | public int getCurrentPosition() { 45 | if (mSegment == null) 46 | return -1; 47 | 48 | int currentPosition = mStartTime + super.getCurrentPosition(); 49 | return currentPosition; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/tv/danmaku/media/list/MediaSegment.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.media.list; 2 | 3 | import tv.danmaku.media.resource.Segment; 4 | 5 | public class MediaSegment extends Segment { 6 | public int order; 7 | public long mStartTiem; 8 | } 9 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/tv/danmaku/media/resource/FromUnknownException.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.media.resource; 2 | 3 | public class FromUnknownException extends ResolveException { 4 | private static final long serialVersionUID = 375449622693342155L; 5 | } 6 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/tv/danmaku/media/resource/Mrl.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.media.resource; 2 | 3 | import tv.danmaku.android.util.DebugLog; 4 | import android.text.TextUtils; 5 | 6 | public class Mrl { 7 | private static final String TAG = Mrl.class.getSimpleName(); 8 | 9 | private String mRawMrl; // "http/youku/mp4://location" 10 | private String mScheme; // "http", required 11 | private String mPseudoAccess; // "youku", required for index url 12 | private String mPseudoDemux; // "mp4", optional 13 | 14 | private String mUrl; 15 | 16 | private String mSchemeSpecificPart; // "//location" 17 | 18 | public static Mrl parse(String rawMrl) { 19 | Mrl mrl = new Mrl(); 20 | 21 | mrl.mRawMrl = rawMrl; 22 | mrl.mScheme = null; 23 | mrl.mPseudoAccess = null; 24 | mrl.mPseudoDemux = null; 25 | mrl.mSchemeSpecificPart = null; 26 | 27 | String[] mrlComponents = mrl.mRawMrl.split(":", 2); 28 | if (mrlComponents == null || mrlComponents.length < 2) 29 | return mrl; 30 | mrl.mSchemeSpecificPart = mrlComponents[1]; 31 | 32 | String[] moduleComponents = mrlComponents[0].split("/"); 33 | if (mrlComponents == null || mrlComponents.length < 1) 34 | return mrl; 35 | 36 | mrl.mScheme = moduleComponents[0]; 37 | if (TextUtils.isEmpty(mrl.mScheme) 38 | || TextUtils.isEmpty(mrl.mSchemeSpecificPart)) 39 | return mrl; 40 | mrl.mUrl = String.format("%s:%s", mrl.mScheme, mrl.mSchemeSpecificPart); 41 | 42 | if (moduleComponents.length >= 2) 43 | mrl.mPseudoAccess = moduleComponents[1]; 44 | if (moduleComponents.length >= 3) 45 | mrl.mPseudoDemux = moduleComponents[2]; 46 | 47 | return mrl; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return mRawMrl; 53 | } 54 | 55 | final public String getRawMrl() { 56 | return mRawMrl; 57 | } 58 | 59 | final public String getScheme() { 60 | return mScheme; 61 | } 62 | 63 | final public String getPseudoAccess() { 64 | return mPseudoAccess; 65 | } 66 | 67 | final public String getPseduoDemux() { 68 | return mPseudoDemux; 69 | } 70 | 71 | final public String getUrl() { 72 | return mUrl; 73 | } 74 | 75 | final public String getSchemeSpecificPart() { 76 | return mSchemeSpecificPart; 77 | } 78 | 79 | final public void dump() { 80 | DebugLog.ifmt(TAG, "mIndexMrl: %s", mRawMrl); 81 | DebugLog.ifmt(TAG, "mScheme: %s", mScheme); 82 | DebugLog.ifmt(TAG, "mPseudoAccess: %s", mPseudoAccess); 83 | DebugLog.ifmt(TAG, "mPseudoDemux: %s", mPseudoDemux); 84 | DebugLog.ifmt(TAG, "mSchemeSpecificPart: %s", mSchemeSpecificPart); 85 | DebugLog.ifmt(TAG, "mRealIndexUrl: %s", mUrl); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/tv/danmaku/media/resource/ResolveException.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.media.resource; 2 | 3 | public class ResolveException extends Exception { 4 | private static final long serialVersionUID = -4032549134925259473L; 5 | } 6 | -------------------------------------------------------------------------------- /android/LibMediaPlayer/src/tv/danmaku/media/resource/Segment.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.media.resource; 2 | 3 | import org.videolan.vlc.segments.LibVlcVslSegment; 4 | 5 | import android.os.Bundle; 6 | import android.os.Parcel; 7 | import android.os.Parcelable; 8 | 9 | public class Segment implements Parcelable { 10 | private static final String BUNDLE_DURATION = "duration"; 11 | private static final String BUNDLE_URL = "url"; 12 | 13 | public String mUrl; 14 | public int mDuration; 15 | public int mBytes; 16 | 17 | public Segment() { 18 | } 19 | 20 | public Segment(String url) { 21 | this(url, 0); 22 | } 23 | 24 | public Segment(String url, int duration) { 25 | this(url, duration, 0); 26 | } 27 | 28 | public Segment(String url, int duration, int bytes) { 29 | mUrl = url; 30 | mDuration = duration; 31 | mBytes = bytes; 32 | } 33 | 34 | public void putIntoVslBundle(Bundle args, int order) { 35 | LibVlcVslSegment.putSegmentUrl(args, order, mUrl); 36 | LibVlcVslSegment.putDuration(args, order, mDuration); 37 | LibVlcVslSegment.putBytes(args, order, mBytes); 38 | } 39 | 40 | // for Parcelable 41 | @Override 42 | public int describeContents() { 43 | return 0; 44 | } 45 | 46 | @Override 47 | public void writeToParcel(Parcel dest, int flags) { 48 | Bundle bundle = new Bundle(); 49 | 50 | bundle.putInt(BUNDLE_DURATION, mDuration); 51 | bundle.putString(BUNDLE_URL, mUrl); 52 | 53 | dest.writeBundle(bundle); 54 | } 55 | 56 | private Segment(Parcel in) { 57 | Bundle bundle = in.readBundle(Segment.class.getClassLoader()); 58 | 59 | mDuration = bundle.getInt(BUNDLE_DURATION); 60 | mUrl = bundle.getString(BUNDLE_URL); 61 | } 62 | 63 | public static final Segment.Creator CREATOR = new Parcelable.Creator() { 64 | public Segment createFromParcel(Parcel in) { 65 | return new Segment(in); 66 | } 67 | 68 | public Segment[] newArray(int size) { 69 | return new Segment[size]; 70 | } 71 | }; 72 | } 73 | -------------------------------------------------------------------------------- /android/LibUtility/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | LibUtility 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /android/LibUtility/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /android/LibUtility/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /android/LibUtility/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-16 15 | android.library=true 16 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/AudioManagerHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android; 2 | 3 | import android.content.Context; 4 | import android.media.AudioManager; 5 | 6 | public class AudioManagerHelper { 7 | public static AudioManager getAudioManager(Context context) { 8 | return (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); 9 | } 10 | 11 | /*-------------------------------------- 12 | * Music stream 13 | */ 14 | public static int getStreamMaxVolume(Context context, int streamType) { 15 | AudioManager audioManager = getAudioManager(context); 16 | if (audioManager == null) 17 | return 0; 18 | 19 | return audioManager.getStreamMaxVolume(streamType); 20 | } 21 | 22 | public static int getStreamVolume(Context context, int streamType) { 23 | AudioManager audioManager = getAudioManager(context); 24 | if (audioManager == null) 25 | return 0; 26 | 27 | return audioManager.getStreamVolume(streamType); 28 | } 29 | 30 | public static void setStreamVolume(Context context, int streamType, 31 | int volume, int flag) { 32 | AudioManager audioManager = getAudioManager(context); 33 | if (audioManager == null) 34 | return; 35 | 36 | audioManager.setStreamVolume(streamType, volume, flag); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/ConnectivityManagerHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android; 2 | 3 | import android.content.Context; 4 | import android.net.ConnectivityManager; 5 | import android.net.NetworkInfo; 6 | import android.support.v4.net.ConnectivityManagerCompat; 7 | import android.text.TextUtils; 8 | 9 | public class ConnectivityManagerHelper { 10 | public static ConnectivityManager getConnectivityManager(Context context) { 11 | return (ConnectivityManager) context 12 | .getSystemService(Context.CONNECTIVITY_SERVICE); 13 | } 14 | 15 | public static NetworkInfo getActivieNetworkInfo(Context context) { 16 | ConnectivityManager manager = getConnectivityManager(context); 17 | if (manager == null) 18 | return null; 19 | 20 | return manager.getActiveNetworkInfo(); 21 | } 22 | 23 | /*- 24 | * FIXME: for USB connect, this method can not be reliable. 25 | * Only use this method to retrieve error reason 26 | */ 27 | public static boolean isConnectedOrConnecting(Context context) { 28 | NetworkInfo networkInfo = getActivieNetworkInfo(context); 29 | if (networkInfo == null) 30 | return false; 31 | 32 | return networkInfo.isConnectedOrConnecting(); 33 | } 34 | 35 | public static boolean isActiveNetworkMetered(Context context) { 36 | ConnectivityManager manager = getConnectivityManager(context); 37 | if (manager == null) 38 | return false; 39 | 40 | ConnectivityManagerCompat compat = new ConnectivityManagerCompat(); 41 | return compat.isActiveNetworkMetered(manager); 42 | } 43 | 44 | public static String getActiveNetworkName(Context context) { 45 | try { 46 | NetworkInfo info = getActivieNetworkInfo(context); 47 | String typeName = info.getTypeName().toLowerCase(); 48 | if (typeName.equals("wifi")) { 49 | return typeName; 50 | } else { 51 | String extraInfoName = info.getExtraInfo().toLowerCase(); 52 | if (!TextUtils.isEmpty(extraInfoName)) 53 | return extraInfoName; 54 | } 55 | return typeName; 56 | } catch (Exception e) { 57 | return null; 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/EnvironmentHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android; 2 | 3 | import java.io.File; 4 | import android.content.Context; 5 | import android.os.Environment; 6 | 7 | public class EnvironmentHelper { 8 | // for Android 2.1 9 | public static File getExternalCacheDir(Context context) { 10 | StringBuilder relPath = new StringBuilder("Android/data"); 11 | relPath.append("/"); 12 | relPath.append(context.getPackageName()); 13 | relPath.append("/cache"); 14 | 15 | File extStorage = Environment.getExternalStorageDirectory(); 16 | return new File(extStorage, relPath.toString()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/InputMethodManagerHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | import android.view.inputmethod.InputMethodManager; 6 | 7 | public class InputMethodManagerHelper { 8 | 9 | public static void showSoftInput(Context context, View view, int flags) { 10 | InputMethodManager manager = (InputMethodManager) context 11 | .getSystemService(Context.INPUT_METHOD_SERVICE); 12 | if (manager == null) 13 | return; 14 | 15 | manager.showSoftInput(view, flags); 16 | } 17 | 18 | public static void hideSoftInput(Context context, View view, int flags) { 19 | InputMethodManager manager = (InputMethodManager) context 20 | .getSystemService(Context.INPUT_METHOD_SERVICE); 21 | if (manager == null) 22 | return; 23 | 24 | manager.hideSoftInputFromWindow(view.getWindowToken(), flags); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/MenuHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android; 2 | 3 | import android.view.Menu; 4 | import android.view.MenuItem; 5 | 6 | public class MenuHelper { 7 | public static void setItemVisible(Menu menu, int itemId, boolean visible) { 8 | MenuItem item = menu.findItem(itemId); 9 | if (item != null) 10 | item.setVisible(visible); 11 | } 12 | 13 | public static boolean expandActionView(MenuItem item) { 14 | if (BuildHelper.isApi14_IceCreamSandwichOrLater()) { 15 | item.expandActionView(); 16 | return true; 17 | } 18 | 19 | return false; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/NotificationManagerHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android; 2 | 3 | import android.app.Notification; 4 | import android.app.NotificationManager; 5 | import android.content.Context; 6 | 7 | public class NotificationManagerHelper { 8 | public static NotificationManager getNotificationManager(Context context) { 9 | Object service = context.getSystemService(Context.NOTIFICATION_SERVICE); 10 | if (service == null) 11 | return null; 12 | 13 | return (NotificationManager) service; 14 | } 15 | 16 | public static void notify(Context context, int id, Notification notification) { 17 | NotificationManager nm = getNotificationManager(context); 18 | if (nm == null) 19 | return; 20 | 21 | nm.notify(id, notification); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/PowerManagerHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android; 2 | 3 | import android.content.Context; 4 | import android.os.PowerManager; 5 | 6 | public class PowerManagerHelper { 7 | 8 | public static PowerManager.WakeLock newWakeLock(Context context, int flags, 9 | String tag) { 10 | Object service = context.getSystemService(Context.POWER_SERVICE); 11 | if (service == null) 12 | return null; 13 | 14 | PowerManager pw = (PowerManager) service; 15 | return pw.newWakeLock(flags, tag); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/PropertiesHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | import java.util.Properties; 6 | 7 | import tv.danmaku.android.util.StreamHelper; 8 | import android.content.Context; 9 | import android.content.res.AssetManager; 10 | 11 | public class PropertiesHelper { 12 | public static Properties createFromAsset(Context context, String path) { 13 | AssetManager am = context.getAssets(); 14 | if (am == null) 15 | return null; 16 | 17 | InputStream inputStream = null; 18 | Properties properties = null; 19 | try { 20 | inputStream = am.open(path); 21 | 22 | properties = new Properties(); 23 | properties.load(inputStream); 24 | } catch (IOException e) { 25 | e.printStackTrace(); 26 | } 27 | 28 | StreamHelper.closeStream(inputStream); 29 | return properties; 30 | } 31 | 32 | public static String getString(Properties prop, String name) { 33 | return prop.getProperty(name); 34 | } 35 | 36 | public static int getInt(Properties prop, String name, int defaultValue) { 37 | String value = prop.getProperty(name); 38 | if (value == null) 39 | return defaultValue; 40 | 41 | try { 42 | return Integer.valueOf(value); 43 | } catch (NumberFormatException e) { 44 | } 45 | 46 | return defaultValue; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/ResourcesHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android; 2 | 3 | import java.io.InputStream; 4 | 5 | import tv.danmaku.android.util.StreamHelper; 6 | import android.content.Context; 7 | import android.content.res.ColorStateList; 8 | import android.content.res.Resources; 9 | import android.graphics.drawable.Drawable; 10 | 11 | public class ResourcesHelper { 12 | 13 | public static Drawable getDrawable(Context context, int id) { 14 | Resources resources = context.getResources(); 15 | if (resources == null) 16 | return null; 17 | 18 | return resources.getDrawable(id); 19 | } 20 | 21 | public static int getColor(Context context, int id) { 22 | Resources resources = context.getResources(); 23 | if (resources == null) 24 | return 0; 25 | 26 | return resources.getColor(id); 27 | } 28 | 29 | public static ColorStateList getColorStateList(Context context, int id) { 30 | Resources resources = context.getResources(); 31 | if (resources == null) 32 | return null; 33 | 34 | return resources.getColorStateList(id); 35 | } 36 | 37 | public static String getTextFile(Context context, int id) { 38 | InputStream inputStream = context.getResources().openRawResource(id); 39 | 40 | String text = StreamHelper.readStreamLineByLine(inputStream); 41 | StreamHelper.closeStream(inputStream); 42 | 43 | return text; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/SearchManagerHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android; 2 | 3 | public class SearchManagerHelper { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/ToastHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android; 2 | 3 | import android.content.Context; 4 | import android.widget.Toast; 5 | 6 | public class ToastHelper { 7 | public static void showToast(Context context, int textResId, int duration) { 8 | showToast(context, context.getString(textResId), duration); 9 | } 10 | 11 | public static void showToast(Context context, String text, int duration) { 12 | Toast.makeText(context, text, duration).show(); 13 | } 14 | 15 | public static void showToastLong(Context context, int textResId) { 16 | showToast(context, textResId, Toast.LENGTH_LONG); 17 | } 18 | 19 | public static void showToastLong(Context context, String text) { 20 | showToast(context, text, Toast.LENGTH_LONG); 21 | } 22 | 23 | public static void showToastShort(Context context, int textResId) { 24 | showToast(context, textResId, Toast.LENGTH_SHORT); 25 | } 26 | 27 | public static void showToastShort(Context context, String text) { 28 | showToast(context, text, Toast.LENGTH_SHORT); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/TypeFaceHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android; 2 | 3 | import java.util.TreeMap; 4 | 5 | import android.content.Context; 6 | import android.content.res.AssetManager; 7 | import android.graphics.Typeface; 8 | 9 | public class TypeFaceHelper { 10 | 11 | private static TreeMap mTypefaceCache = new TreeMap(); 12 | 13 | public static Typeface createFromAsset(Context context, String path) { 14 | Typeface tf = mTypefaceCache.get(path); 15 | if (tf != null) 16 | return tf; 17 | 18 | AssetManager am = context.getAssets(); 19 | if (am == null) 20 | return null; 21 | 22 | try { 23 | tf = Typeface.createFromAsset(am, path); 24 | mTypefaceCache.put(path, tf); 25 | } catch (RuntimeException e) { 26 | mTypefaceCache.put(path, null); 27 | } 28 | 29 | return tf; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/WindowManagerHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android; 2 | 3 | import android.content.Context; 4 | import android.view.Display; 5 | import android.view.WindowManager; 6 | 7 | public class WindowManagerHelper { 8 | public static final String TAG = WindowManagerHelper.class.getName(); 9 | 10 | public static WindowManager getWindowManager(Context context) { 11 | Object service = context.getSystemService(Context.WINDOW_SERVICE); 12 | if (service == null) 13 | return null; 14 | 15 | return (WindowManager) service; 16 | } 17 | 18 | public static Display getDefaultDisplay(Context context) { 19 | WindowManager wm = getWindowManager(context); 20 | if (wm == null) 21 | return null; 22 | 23 | return wm.getDefaultDisplay(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/loader/LoaderBundle.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.loader; 2 | 3 | public class LoaderBundle { 4 | public static final String _BUNDLE_NAME = "_name"; 5 | public static final String _BUNDLE_ID = "_id"; 6 | } 7 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/loader/LoaderRequest.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.loader; 2 | 3 | import android.os.Bundle; 4 | import android.support.v4.app.LoaderManager; 5 | import android.support.v4.app.LoaderManager.LoaderCallbacks; 6 | 7 | public class LoaderRequest { 8 | public int mId; 9 | public Bundle mArgs; 10 | public LoaderManager.LoaderCallbacks mCallback; 11 | 12 | public boolean mRestart; 13 | 14 | public LoaderRequest(int id, Bundle args, LoaderCallbacks callback) { 15 | mId = id; 16 | mArgs = args; 17 | mCallback = callback; 18 | } 19 | 20 | public LoaderRequest(int id, Bundle args, LoaderCallbacks callback, 21 | boolean restart) { 22 | mId = id; 23 | mArgs = args; 24 | mCallback = callback; 25 | 26 | mRestart = restart; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/support/ActionBarHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.support; 2 | 3 | import tv.danmaku.android.BuildHelper; 4 | import android.annotation.TargetApi; 5 | import android.app.ActionBar; 6 | import android.app.Activity; 7 | 8 | @TargetApi(11) 9 | public class ActionBarHelper { 10 | public static void setDisplayHomeAsUpEnabled(Activity activity, 11 | boolean showHomeAsUp) { 12 | if (BuildHelper.isApi11_HoneyCombOrLater()) { 13 | ActionBar actionBar = activity.getActionBar(); 14 | if (actionBar != null) { 15 | actionBar.setDisplayHomeAsUpEnabled(true); 16 | } 17 | } 18 | } 19 | 20 | public static void setDisplayShowTitleEnabled(Activity activity, 21 | boolean showTitle) { 22 | if (BuildHelper.isApi11_HoneyCombOrLater()) { 23 | ActionBar actionBar = activity.getActionBar(); 24 | if (actionBar != null) { 25 | actionBar.setDisplayShowTitleEnabled(showTitle); 26 | } 27 | } 28 | } 29 | 30 | public static void setDisplayUseLogoEnabled(Activity activity, 31 | boolean useLogo) { 32 | if (BuildHelper.isApi11_HoneyCombOrLater()) { 33 | ActionBar actionBar = activity.getActionBar(); 34 | if (actionBar != null) { 35 | actionBar.setDisplayUseLogoEnabled(useLogo); 36 | } 37 | } 38 | } 39 | 40 | public static void setDisplayOptions(Activity activity, int options, 41 | int mask) { 42 | if (BuildHelper.isApi11_HoneyCombOrLater()) { 43 | ActionBar actionBar = activity.getActionBar(); 44 | if (actionBar != null) { 45 | actionBar.setDisplayOptions(options, mask); 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/support/SystemUIHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.support; 2 | 3 | import tv.danmaku.android.BuildHelper; 4 | import android.annotation.TargetApi; 5 | import android.app.Activity; 6 | import android.view.View; 7 | import android.view.View.OnSystemUiVisibilityChangeListener; 8 | 9 | public class SystemUIHelper { 10 | 11 | @TargetApi(11) 12 | public static void setSystemUiVisibility(Activity activity, int visibility) { 13 | if (activity == null) 14 | return; 15 | 16 | if (BuildHelper.isApi11_HoneyCombOrLater()) { 17 | activity.getWindow().getDecorView() 18 | .setSystemUiVisibility(visibility); 19 | } 20 | } 21 | 22 | public static void hideNavigation(Activity activity) { 23 | if (activity == null) 24 | return; 25 | 26 | if (!BuildHelper.isApi11_HoneyCombOrLater()) 27 | return; 28 | 29 | int visibility = View.SYSTEM_UI_FLAG_FULLSCREEN 30 | | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; 31 | 32 | // visibility |= View.SYSTEM_UI_FLAG_LOW_PROFILE; 33 | 34 | visibility |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; 35 | visibility |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION; 36 | visibility |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE; 37 | 38 | setSystemUiVisibility(activity, visibility); 39 | } 40 | 41 | public static void showNavigation(Activity activity) { 42 | if (activity == null) 43 | return; 44 | if (!BuildHelper.isApi11_HoneyCombOrLater()) 45 | return; 46 | 47 | int visibility = View.SYSTEM_UI_FLAG_FULLSCREEN 48 | | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; 49 | 50 | setSystemUiVisibility(activity, visibility); 51 | } 52 | 53 | @TargetApi(11) 54 | public static void setOnSystemUiVisibilityChangeListener(Activity activity, 55 | OnSystemUiVisibilityChangeListener listener) { 56 | if (activity == null) 57 | return; 58 | 59 | if (BuildHelper.isApi11_HoneyCombOrLater()) { 60 | activity.getWindow().getDecorView() 61 | .findViewById(android.R.id.content) 62 | .setOnSystemUiVisibilityChangeListener(listener); 63 | } 64 | } 65 | 66 | @TargetApi(16) 67 | public static void requestFitSysWindow(View view) { 68 | if (view == null) 69 | return; 70 | 71 | if (BuildHelper.isApi16_JellyBeanOrLater()) { 72 | view.requestFitSystemWindows(); 73 | } 74 | } 75 | 76 | public static String getVisibilityVerbose(int visibility) { 77 | StringBuilder sb = new StringBuilder(); 78 | sb.append(String.valueOf(visibility)); 79 | sb.append(':'); 80 | 81 | if (0 != (visibility & View.SYSTEM_UI_FLAG_LOW_PROFILE)) 82 | sb.append("low|"); 83 | if (0 != (visibility & View.SYSTEM_UI_FLAG_FULLSCREEN)) 84 | sb.append("full|"); 85 | if (0 != (visibility & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION)) 86 | sb.append("hide|"); 87 | if (0 != (visibility & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN)) 88 | sb.append("layout_full|"); 89 | if (0 != (visibility & View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION)) 90 | sb.append("layout_hide|"); 91 | if (0 != (visibility & View.SYSTEM_UI_FLAG_LAYOUT_STABLE)) 92 | sb.append("layout_stable|"); 93 | 94 | return sb.toString(); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/support/SystemUINavHider.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.support; 2 | 3 | import tv.danmaku.android.BuildHelper; 4 | import android.app.Activity; 5 | 6 | public class SystemUINavHider { 7 | 8 | public static SystemUINavHider create(Activity activity) { 9 | if (BuildHelper.isApi11_HoneyCombOrLater()) { 10 | return new SystemUINavHider_HoneyComb(activity); 11 | } else { 12 | return new SystemUINavHider(activity); 13 | } 14 | } 15 | 16 | public static interface OnSystemUiVisibilityChangeListener { 17 | public abstract void onSystemUiVisibilityChange(int visibility); 18 | }; 19 | 20 | public SystemUINavHider(Activity activity) { 21 | // do nothing 22 | } 23 | 24 | public void setEnableHide(boolean enableHide) { 25 | // do nothing 26 | } 27 | 28 | public boolean shouldHide() { 29 | return false; 30 | } 31 | 32 | public void show() { 33 | // do nothing 34 | } 35 | 36 | public void hide() { 37 | // do nothing 38 | } 39 | 40 | public void forceHideImmediately() { 41 | // do nothing 42 | } 43 | 44 | public void setOnSystemUiVisibilityChangeListener( 45 | OnSystemUiVisibilityChangeListener listener) { 46 | // do nothing 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/util/Assure.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.util; 2 | 3 | import java.util.Collection; 4 | 5 | import android.text.TextUtils; 6 | 7 | public class Assure { 8 | public static void checkTrue(boolean value) { 9 | if (!value) 10 | throw new IllegalArgumentException("AssureTrue"); 11 | } 12 | 13 | public static void checkNotNull(Object obj) { 14 | if (obj == null) 15 | throw new IllegalArgumentException("AssureNotNull"); 16 | } 17 | 18 | public static void CheckNotEqual(int expectNot, int real) { 19 | if (expectNot == real) 20 | throw new IllegalArgumentException("AssureNotEqual"); 21 | } 22 | 23 | public static void CheckEqual(int expect, int real) { 24 | if (expect != real) 25 | throw new IllegalArgumentException("AssureEqual"); 26 | } 27 | 28 | public static void CheckEqualNoCase(String expect, String real) { 29 | if (expect == null && real == null) 30 | return; 31 | 32 | if (expect == null || real == null) 33 | throw new IllegalArgumentException("AssureEqual"); 34 | 35 | if (!expect.equalsIgnoreCase(real)) 36 | throw new IllegalArgumentException("AssureEqual"); 37 | } 38 | 39 | public static void checkNotEmptyString(String webUrl) { 40 | if (TextUtils.isEmpty(webUrl)) 41 | throw new IllegalArgumentException("AssureNotEmptyString"); 42 | } 43 | 44 | public static void checkNotEmptyCollection(Collection collection) { 45 | if (collection == null || collection.isEmpty()) 46 | throw new IllegalArgumentException("AssureNotEmptyCollection"); 47 | } 48 | 49 | public static void checkNotEmptyArray(E[] collection) { 50 | if (collection == null || collection.length <= 0) 51 | throw new IllegalArgumentException("checkNotEmptyArray"); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/util/BrightnessHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.util; 2 | 3 | import android.app.Activity; 4 | import android.content.ContentResolver; 5 | import android.net.Uri; 6 | import android.provider.Settings; 7 | import android.provider.Settings.SettingNotFoundException; 8 | import android.view.WindowManager; 9 | 10 | public class BrightnessHelper { 11 | public static boolean isAutoBrightness(ContentResolver aContentResolver) { 12 | boolean automicBrightness = false; 13 | try { 14 | automicBrightness = Settings.System.getInt(aContentResolver, 15 | Settings.System.SCREEN_BRIGHTNESS_MODE) == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC; 16 | } catch (SettingNotFoundException e) { 17 | e.printStackTrace(); 18 | } 19 | return automicBrightness; 20 | } 21 | 22 | public static float getScreenBrightness(Activity activity) { 23 | float nowBrightnessValue = -1; 24 | ContentResolver resolver = activity.getContentResolver(); 25 | try { 26 | nowBrightnessValue = android.provider.Settings.System.getInt( 27 | resolver, Settings.System.SCREEN_BRIGHTNESS, -1); 28 | 29 | nowBrightnessValue /= 255; 30 | } catch (Exception e) { 31 | e.printStackTrace(); 32 | } 33 | 34 | return nowBrightnessValue; 35 | } 36 | 37 | public static void setBrightness(Activity activity, float brightness) { 38 | // Settings.System.putInt(activity.getContentResolver(), 39 | // Settings.System.SCREEN_BRIGHTNESS_MODE, 40 | // Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL); 41 | WindowManager.LayoutParams lp = activity.getWindow().getAttributes(); 42 | // some ROM may ANF if set brightness to 0 43 | lp.screenBrightness = Math.max(brightness, 0.01f); 44 | activity.getWindow().setAttributes(lp); 45 | 46 | } 47 | 48 | public static void stopAutoBrightness(Activity activity) { 49 | Settings.System.putInt(activity.getContentResolver(), 50 | Settings.System.SCREEN_BRIGHTNESS_MODE, 51 | Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL); 52 | } 53 | 54 | public static void startAutoBrightness(Activity activity) { 55 | Settings.System.putInt(activity.getContentResolver(), 56 | Settings.System.SCREEN_BRIGHTNESS_MODE, 57 | Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC); 58 | } 59 | 60 | public static void saveBrightness(ContentResolver resolver, int brightness) { 61 | Uri uri = Settings.System.getUriFor("screen_brightness"); 62 | Settings.System.putInt(resolver, "screen_brightness", brightness); 63 | // resolver.registerContentObserver(uri, true, myContentObserver); 64 | resolver.notifyChange(uri, null); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/util/CollectionHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.util; 2 | 3 | import java.util.Collection; 4 | 5 | import android.text.TextUtils; 6 | 7 | public class CollectionHelper { 8 | public final static void Append(Collection collection, T[] array) { 9 | if (collection != null && array != null && array.length > 0) { 10 | for (T element : array) { 11 | collection.add(element); 12 | } 13 | } 14 | } 15 | 16 | public final static void Append(Collection collection, 17 | T[][] array_array) { 18 | if (collection != null && array_array != null && array_array.length > 0) { 19 | for (T[] array : array_array) { 20 | Append(collection, array); 21 | } 22 | } 23 | } 24 | 25 | public final static String[] toArray(Collection collection) { 26 | return collection.toArray(new String[collection.size()]); 27 | } 28 | 29 | public final static boolean isAnyStringEmpty(String[] array) { 30 | if (array == null || array.length <= 0) 31 | return false; 32 | 33 | for (String elem : array) { 34 | if (TextUtils.isEmpty(elem)) 35 | return true; 36 | } 37 | 38 | return false; 39 | } 40 | 41 | public final static boolean isAnyStringEmpty(Collection collection) { 42 | if (collection == null || collection.isEmpty()) 43 | return false; 44 | 45 | for (String elem : collection) { 46 | if (TextUtils.isEmpty(elem)) 47 | return true; 48 | } 49 | 50 | return false; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/util/DebugLog.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.util; 2 | 3 | import tv.danmaku.pragma.Pragma; 4 | import android.util.Log; 5 | 6 | public class DebugLog { 7 | 8 | // 调试配置,发布时,将 DEBUG_ON 置为 false 9 | public static final boolean DEBUG_ON = Pragma.DEBUG; 10 | public static final boolean DEBUG_OFF = false; 11 | 12 | public static boolean ENABLE_ERROR = DEBUG_ON; 13 | public static boolean ENABLE_INFO = DEBUG_ON; 14 | public static boolean ENABLE_WARN = DEBUG_ON; 15 | public static boolean ENABLE_DEBUG = DEBUG_ON; 16 | public static boolean ENABLE_VERBOSE = DEBUG_ON; 17 | 18 | public static int e(String tag, String msg) { 19 | if (ENABLE_ERROR) { 20 | return Log.e(tag, msg); 21 | } 22 | 23 | return 0; 24 | } 25 | 26 | public static int e(String tag, String msg, Throwable tr) { 27 | if (ENABLE_ERROR) { 28 | return Log.e(tag, msg, tr); 29 | } 30 | 31 | return 0; 32 | } 33 | 34 | public static int efmt(String tag, String fmt, Object... args) { 35 | if (ENABLE_ERROR) { 36 | String msg = String.format(fmt, args); 37 | return Log.e(tag, msg); 38 | } 39 | 40 | return 0; 41 | } 42 | 43 | public static int i(String tag, String msg) { 44 | if (ENABLE_INFO) { 45 | return Log.i(tag, msg); 46 | } 47 | 48 | return 0; 49 | } 50 | 51 | public static int i(String tag, String msg, Throwable tr) { 52 | if (ENABLE_INFO) { 53 | return Log.i(tag, msg, tr); 54 | } 55 | 56 | return 0; 57 | } 58 | 59 | public static int ifmt(String tag, String fmt, Object... args) { 60 | if (ENABLE_INFO) { 61 | String msg = String.format(fmt, args); 62 | return Log.i(tag, msg); 63 | } 64 | 65 | return 0; 66 | } 67 | 68 | public static int w(String tag, String msg) { 69 | if (ENABLE_WARN) { 70 | return Log.w(tag, msg); 71 | } 72 | 73 | return 0; 74 | } 75 | 76 | public static int w(String tag, String msg, Throwable tr) { 77 | if (ENABLE_WARN) { 78 | return Log.w(tag, msg, tr); 79 | } 80 | 81 | return 0; 82 | } 83 | 84 | public static int wfmt(String tag, String fmt, Object... args) { 85 | if (ENABLE_WARN) { 86 | String msg = String.format(fmt, args); 87 | return Log.w(tag, msg); 88 | } 89 | 90 | return 0; 91 | } 92 | 93 | public static int d(String tag, String msg) { 94 | if (ENABLE_DEBUG) { 95 | return Log.d(tag, msg); 96 | } 97 | 98 | return 0; 99 | } 100 | 101 | public static int d(String tag, String msg, Throwable tr) { 102 | if (ENABLE_DEBUG) { 103 | return Log.d(tag, msg, tr); 104 | } 105 | 106 | return 0; 107 | } 108 | 109 | public static int dfmt(String tag, String fmt, Object... args) { 110 | if (ENABLE_DEBUG) { 111 | String msg = String.format(fmt, args); 112 | return Log.d(tag, msg); 113 | } 114 | 115 | return 0; 116 | } 117 | 118 | public static int v(String tag, String msg) { 119 | if (ENABLE_VERBOSE) { 120 | return Log.v(tag, msg); 121 | } 122 | 123 | return 0; 124 | } 125 | 126 | public static int v(String tag, String msg, Throwable tr) { 127 | if (ENABLE_VERBOSE) { 128 | return Log.v(tag, msg, tr); 129 | } 130 | 131 | return 0; 132 | } 133 | 134 | public static int vfmt(String tag, String fmt, Object... args) { 135 | if (ENABLE_VERBOSE) { 136 | String msg = String.format(fmt, args); 137 | return Log.v(tag, msg); 138 | } 139 | 140 | return 0; 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/util/IdentityComparator.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.util; 2 | 3 | import java.util.Comparator; 4 | 5 | public class IdentityComparator implements Comparator { 6 | 7 | public int compare(Object lhs, Object rhs) { 8 | return 0; 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/util/ImageLruCache.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.util; 2 | 3 | import android.graphics.drawable.Drawable; 4 | import android.support.v4.util.LruCache; 5 | 6 | public class ImageLruCache { 7 | private static final boolean ENABLE_VERBOSE = false; 8 | 9 | private final static int GLOBAL_IMAGE_MEM_CACHE_MAX_SIZE = 40; 10 | private final static int PRIVATE_IMAGE_MEM_CACHE_MAX_SIZE = 10; 11 | 12 | private static LruCache sGlobalMemCache = new LruCache( 13 | GLOBAL_IMAGE_MEM_CACHE_MAX_SIZE); 14 | private LruCache mImageMemCache; 15 | 16 | public ImageLruCache() { 17 | this(PRIVATE_IMAGE_MEM_CACHE_MAX_SIZE); 18 | } 19 | 20 | public ImageLruCache(int capacity) { 21 | mImageMemCache = new LruCache(capacity); 22 | } 23 | 24 | public Drawable get(int key) { 25 | Drawable thumb = mImageMemCache.get(key); 26 | if (thumb != null) { 27 | if (ENABLE_VERBOSE) 28 | DebugLog.vfmt("ImageLruCache", "get %d", key); 29 | return thumb; 30 | } 31 | 32 | thumb = sGlobalMemCache.get(key); 33 | if (thumb != null) { 34 | if (ENABLE_VERBOSE) 35 | DebugLog.vfmt("ImageLruCache", "get %d global", key); 36 | Drawable mutateThumb = thumb.mutate(); 37 | mImageMemCache.put(key, mutateThumb); 38 | return mutateThumb; 39 | } 40 | 41 | if (ENABLE_VERBOSE) 42 | DebugLog.vfmt("ImageLruCache", "get %d missing", key); 43 | 44 | return null; 45 | } 46 | 47 | public void put(int key, Drawable thumb) { 48 | if (thumb == null) 49 | return; 50 | 51 | if (ENABLE_VERBOSE) { 52 | DebugLog.vfmt("ImageLruCache", "put %d", key); 53 | } 54 | 55 | mImageMemCache.put(key, thumb); 56 | sGlobalMemCache.put(key, thumb.mutate()); 57 | } 58 | } -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/util/IntRange.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.util; 2 | 3 | /* 4 | * 表示一条评论沿纵轴占据的空间 5 | */ 6 | public class IntRange { 7 | public int start; 8 | public int end; 9 | 10 | public IntRange(int start, int end) { 11 | this.start = start; 12 | this.end = end; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/util/PatternHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.util; 2 | 3 | import java.util.regex.MatchResult; 4 | import java.util.regex.Matcher; 5 | import java.util.regex.Pattern; 6 | 7 | public class PatternHelper { 8 | 9 | public Pattern mPattern; 10 | 11 | public PatternHelper(String pattern) { 12 | mPattern = Pattern.compile(pattern); 13 | } 14 | 15 | public final String getFirstMatchString(String text) { 16 | Matcher matcher = mPattern.matcher(text); 17 | if (matcher == null) 18 | return null; 19 | 20 | if (!matcher.find()) 21 | return null; 22 | 23 | MatchResult matchResult = matcher.toMatchResult(); 24 | return matchResult.group(1); 25 | } 26 | 27 | public final int getFirstMatchInt(String text, int defaultValue) { 28 | String firstMatch = getFirstMatchString(text); 29 | if (firstMatch == null) 30 | return defaultValue; 31 | 32 | try { 33 | return Integer.valueOf(firstMatch); 34 | } catch (NumberFormatException e) { 35 | return defaultValue; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/util/RandomHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.util; 2 | 3 | import java.util.Random; 4 | 5 | public class RandomHelper { 6 | public static int getRandomInt() { 7 | return new Random(System.currentTimeMillis()).nextInt(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/util/StreamHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.util; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.IOException; 5 | import java.io.InputStream; 6 | import java.io.InputStreamReader; 7 | 8 | public class StreamHelper { 9 | public static String readStreamLineByLine(InputStream inputStream) { 10 | InputStreamReader reader = new InputStreamReader(inputStream); 11 | BufferedReader buffReader = new BufferedReader(reader); 12 | 13 | StringBuilder text = new StringBuilder(); 14 | String resultText = null; 15 | 16 | try { 17 | String line; 18 | while ((line = buffReader.readLine()) != null) { 19 | text.append(line); 20 | text.append('\n'); 21 | } 22 | resultText = text.toString(); 23 | } catch (IOException e) { 24 | e.printStackTrace(); 25 | } finally { 26 | try { 27 | buffReader.close(); 28 | reader.close(); 29 | } catch (Exception e) { 30 | 31 | } 32 | } 33 | 34 | return resultText; 35 | } 36 | 37 | public static void closeStream(InputStream inputStream) { 38 | if (inputStream == null) 39 | return; 40 | 41 | try { 42 | inputStream.close(); 43 | } catch (IOException e) { 44 | e.printStackTrace(); 45 | } 46 | } 47 | 48 | public static void closeReader(BufferedReader reader) { 49 | if (reader == null) 50 | return; 51 | 52 | try { 53 | reader.close(); 54 | } catch (IOException e) { 55 | e.printStackTrace(); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/util/StringHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.util; 2 | 3 | import tv.danmaku.android.BuildHelper; 4 | 5 | public class StringHelper { 6 | // prevent memory leak by reference huge string 7 | public static String dup(String original) { 8 | if (BuildHelper.isApi9_GingerBreadOrLater()) { 9 | return new String(original); 10 | } else { 11 | // there is a constructor memory-leak bug in android before api-10 12 | // http://code.google.com/p/android/issues/detail?id=26228 13 | return new String(original.getBytes()); 14 | } 15 | } 16 | 17 | public static String notNullString(String original) { 18 | if (original == null) 19 | return ""; 20 | 21 | return original; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/util/UriHelper.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.util; 2 | 3 | import android.net.Uri; 4 | import android.text.TextUtils; 5 | 6 | public class UriHelper { 7 | // 不包括点号 8 | public static String getUriFileExtension(String url) { 9 | if (TextUtils.isEmpty(url)) 10 | return url; 11 | 12 | Uri uri = Uri.parse(url); 13 | String path = uri.getLastPathSegment(); 14 | if (TextUtils.isEmpty(path)) 15 | return null; 16 | 17 | int extPos = path.lastIndexOf("."); 18 | if (extPos == -1 || extPos >= path.length()) 19 | return null; 20 | 21 | return path.substring(extPos + 1); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/util/VerboseConfig.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.util; 2 | 3 | public interface VerboseConfig { 4 | public abstract boolean getEnableVerbose(); 5 | } 6 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/util/WeakActivity.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.util; 2 | 3 | import java.lang.ref.WeakReference; 4 | 5 | import android.app.Activity; 6 | import android.content.Intent; 7 | 8 | public class WeakActivity { 9 | private WeakReference mWeakReference; 10 | 11 | public WeakActivity(T_Activity activity) { 12 | if (activity != null) { 13 | mWeakReference = new WeakReference(activity); 14 | } 15 | } 16 | 17 | final public void setActivity(T_Activity activity) { 18 | if (activity == null) { 19 | mWeakReference = null; 20 | } else { 21 | mWeakReference = new WeakReference(activity); 22 | } 23 | } 24 | 25 | final public T_Activity getActivity() { 26 | if (mWeakReference == null) 27 | return null; 28 | 29 | return mWeakReference.get(); 30 | } 31 | 32 | // methods for Activity 33 | final public void startActivity(Intent intent) { 34 | T_Activity activity = getActivity(); 35 | if (activity == null) 36 | return; 37 | 38 | activity.startActivity(intent); 39 | } 40 | 41 | final public void finish() { 42 | T_Activity activity = getActivity(); 43 | if (activity == null) 44 | return; 45 | 46 | activity.finish(); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/util/WeakHandler.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.util; 2 | 3 | import java.lang.ref.WeakReference; 4 | 5 | import android.os.Handler; 6 | import android.os.Message; 7 | 8 | public class WeakHandler extends Handler { 9 | private WeakReference mWeakCallback; 10 | 11 | public WeakHandler(Handler.Callback callback) { 12 | mWeakCallback = new WeakReference(callback); 13 | } 14 | 15 | @Override 16 | public void handleMessage(Message msg) { 17 | super.handleMessage(msg); 18 | 19 | Handler.Callback callback = mWeakCallback.get(); 20 | if (callback == null) 21 | return; 22 | 23 | callback.handleMessage(msg); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/android/util/WeakListeners.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.android.util; 2 | 3 | import java.lang.ref.WeakReference; 4 | 5 | import android.app.Activity; 6 | import android.view.View; 7 | 8 | public class WeakListeners { 9 | 10 | public static class CallFinishOnClicked implements View.OnClickListener { 11 | private WeakReference mWeakActivity; 12 | 13 | public CallFinishOnClicked(Activity activity) { 14 | mWeakActivity = new WeakReference(activity); 15 | } 16 | 17 | @Override 18 | public void onClick(View v) { 19 | if (mWeakActivity == null) { 20 | return; 21 | } 22 | 23 | Activity activity = mWeakActivity.get(); 24 | if (activity == null) { 25 | return; 26 | } 27 | 28 | activity.finish(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /android/LibUtility/src/tv/danmaku/pragma/Pragma.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.pragma; 2 | 3 | // gen/BuildConfig is not reliable 4 | public final class Pragma { 5 | public final static boolean DEBUG = true; 6 | public final static boolean STRICT_MODE = DEBUG; 7 | 8 | public static final String BILI_HTTP_UA_BILIDROID = "Mozilla/5.0 BiliDroid/1.4.2.112"; 9 | } -------------------------------------------------------------------------------- /ignore/_pull-lite-armv7a-neon.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | export BILI_VLC_ROOT="vlc-lite-armv7a-neon" 4 | export BILI_VLC_MODULE_MODE="module-lite" 5 | export BILI_VLC_TARGET_MODE="target-armv7a-neon" 6 | 7 | sh _do_pull.sh 8 | -------------------------------------------------------------------------------- /ignore/_pull-lite-cortex-a9-vfpv3-d16.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | export BILI_VLC_ROOT="vlc-lite-cortex-a9-vfpv3-d16" 4 | export BILI_VLC_MODULE_MODE="module-lite" 5 | export BILI_VLC_TARGET_MODE="target-cortex-a9-vfpv3-d16" 6 | 7 | sh _do_pull.sh 8 | -------------------------------------------------------------------------------- /ignore/_pull-medium-armv7a-neon.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | export BILI_VLC_ROOT="vlc-medium-armv7a-neon" 4 | export BILI_VLC_MODULE_MODE="module-medium" 5 | export BILI_VLC_TARGET_MODE="target-armv7a-neon" 6 | 7 | sh _do_pull.sh 8 | -------------------------------------------------------------------------------- /ignore/_pull-medium-cortex-a9-vfpv3-d16.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | export BILI_VLC_ROOT="vlc-medium-cortex-a9-vfpv3-d16" 4 | export BILI_VLC_MODULE_MODE="module-medium" 5 | export BILI_VLC_TARGET_MODE="target-cortex-a9-vfpv3-d16" 6 | 7 | sh _do_pull.sh 8 | -------------------------------------------------------------------------------- /parse-stack.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | addr2line -f -e vlc-lite-armv7a/vlc-android/obj/local/armeabi-v7a/libvlcjni.so 4 | -------------------------------------------------------------------------------- /patches/ports-android-app/0001-.gitignore.patch: -------------------------------------------------------------------------------- 1 | From f920c56b2908aea7f295f145e6a7804f0248a517 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Sat, 14 Jul 2012 15:15:42 +0800 4 | Subject: [PATCH 01/15] .gitignore 5 | 6 | --- 7 | .gitignore | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/.gitignore b/.gitignore 11 | index 32a12cc..6566438 100644 12 | --- a/.gitignore 13 | +++ b/.gitignore 14 | @@ -1,5 +1,7 @@ 15 | /vlc/ 16 | /android-libs/*.so 17 | +/patches/100*.patch 18 | +/pt 19 | local.properties 20 | .DS_Store 21 | *.keystore 22 | -- 23 | 1.8.3.4 24 | 25 | -------------------------------------------------------------------------------- /patches/ports-android-app/0002-compile.sh-set-CHOST-for-cross-compile.patch: -------------------------------------------------------------------------------- 1 | From 9874e15819a8e06a552847b42214a02f2e46a206 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Sat, 11 Aug 2012 14:27:45 +0800 4 | Subject: [PATCH 02/15] compile.sh: set CHOST for cross compile 5 | 6 | --- 7 | compile.sh | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/compile.sh b/compile.sh 11 | index 86cf38f..6247a75 100755 12 | --- a/compile.sh 13 | +++ b/compile.sh 14 | @@ -101,6 +101,7 @@ export PLATFORM_SHORT_ARCH 15 | # Add the NDK toolchain to the PATH, needed both for contribs and for building 16 | # stub libraries 17 | NDK_TOOLCHAIN_PATH=`echo ${ANDROID_NDK}/toolchains/${PATH_HOST}-${GCCVER}/prebuilt/\`uname|tr A-Z a-z\`-*/bin` 18 | +CHOST=${NDK_TOOLCHAIN_PATH}/${TARGET_TUPLE} 19 | export PATH=${NDK_TOOLCHAIN_PATH}:${PATH} 20 | 21 | ANDROID_PATH="`pwd`" 22 | @@ -251,6 +252,7 @@ else 23 | fi 24 | 25 | echo "EXTRA_CFLAGS= -g ${EXTRA_CFLAGS}" >> config.mak 26 | +echo "CHOST= ${CHOST}" >> config.mak 27 | export VLC_EXTRA_CFLAGS="${EXTRA_CFLAGS}" 28 | 29 | make fetch 30 | -- 31 | 1.8.3.4 32 | 33 | -------------------------------------------------------------------------------- /patches/ports-android-app/0003-compile.sh-restore-saved-contrib-package.patch: -------------------------------------------------------------------------------- 1 | From 78ab1a1ac295e7dd10c56204c9751ee120ea29eb Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 5 Mar 2012 17:18:45 +0800 4 | Subject: [PATCH 03/15] compile.sh: restore saved contrib package 5 | 6 | --- 7 | compile.sh | 6 ++++++ 8 | 1 file changed, 6 insertions(+) 9 | 10 | diff --git a/compile.sh b/compile.sh 11 | index 6247a75..1b63f09 100755 12 | --- a/compile.sh 13 | +++ b/compile.sh 14 | @@ -255,6 +255,12 @@ echo "EXTRA_CFLAGS= -g ${EXTRA_CFLAGS}" >> config.mak 15 | echo "CHOST= ${CHOST}" >> config.mak 16 | export VLC_EXTRA_CFLAGS="${EXTRA_CFLAGS}" 17 | 18 | +if test -d "../../../../tarballs" ; then 19 | + echo "fetch local tarballs" 20 | + mkdir -p ../tarballs 21 | + cp -n -v ../../../../tarballs/* ../tarballs/ || true 22 | +fi 23 | + 24 | make fetch 25 | # We already have zlib available 26 | [ -e .zlib ] || (mkdir -p zlib; touch .zlib) 27 | -- 28 | 1.8.3.4 29 | 30 | -------------------------------------------------------------------------------- /patches/ports-android-app/0004-compile.sh-support-fastcompile.sh.patch: -------------------------------------------------------------------------------- 1 | From abaf03ec424a2baca6c6b2c70eda840f39520095 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Sat, 28 Jul 2012 17:21:40 +0800 4 | Subject: [PATCH 04/15] compile.sh: support fastcompile.sh 5 | 6 | --- 7 | fastcompile.sh | 4 ++++ 8 | 1 file changed, 4 insertions(+) 9 | create mode 100644 fastcompile.sh 10 | 11 | diff --git a/fastcompile.sh b/fastcompile.sh 12 | new file mode 100644 13 | index 0000000..14c672b 14 | --- /dev/null 15 | +++ b/fastcompile.sh 16 | @@ -0,0 +1,4 @@ 17 | +#! /bin/sh 18 | + 19 | +export VLC_FAST_COMPILE=1 20 | +sh compile.sh jni 21 | -- 22 | 1.8.3.4 23 | 24 | -------------------------------------------------------------------------------- /patches/ports-android-app/0005-compile.sh-disable-extras-tools.patch: -------------------------------------------------------------------------------- 1 | From 061546459620a43cc3f6ed7ebb5d26203b2ae14f Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 20 May 2013 22:29:57 +0800 4 | Subject: [PATCH 05/15] compile.sh: disable extras/tools 5 | 6 | --- 7 | compile.sh | 12 ++++++------ 8 | 1 file changed, 6 insertions(+), 6 deletions(-) 9 | 10 | diff --git a/compile.sh b/compile.sh 11 | index 1b63f09..ae0808a 100755 12 | --- a/compile.sh 13 | +++ b/compile.sh 14 | @@ -187,12 +187,12 @@ then 15 | MAKEFLAGS=-j`sysctl -n machdep.cpu.thread_count` 16 | fi 17 | 18 | -export PATH=`pwd`/extras/tools/build/bin:$PATH 19 | -echo "Building tools" 20 | -cd extras/tools 21 | -./bootstrap 22 | -make $MAKEFLAGS 23 | -cd ../.. 24 | +# export PATH=`pwd`/extras/tools/build/bin:$PATH 25 | +# echo "Building tools" 26 | +# cd extras/tools 27 | +# ./bootstrap 28 | +# make $MAKEFLAGS 29 | +# cd ../.. 30 | 31 | echo "Building the contribs" 32 | mkdir -p contrib/android 33 | -- 34 | 1.8.3.4 35 | 36 | -------------------------------------------------------------------------------- /patches/ports-android-app/0006-compile.sh-config-target-abi-env.patch: -------------------------------------------------------------------------------- 1 | From 754b2fed973d739bddc0f49892f1f78acd2abab1 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 10 Feb 2014 14:55:42 +0800 4 | Subject: [PATCH 06/15] compile.sh: config target abi env 5 | 6 | --- 7 | compile.sh | 3 +++ 8 | 1 file changed, 3 insertions(+) 9 | 10 | diff --git a/compile.sh b/compile.sh 11 | index ae0808a..440758e 100755 12 | --- a/compile.sh 13 | +++ b/compile.sh 14 | @@ -1,5 +1,8 @@ 15 | #! /bin/sh 16 | 17 | +# target-abi env 18 | +source target-abi.sh 19 | + 20 | # Read the Android Wiki http://wiki.videolan.org/AndroidCompile 21 | # Setup all that stuff correctly. 22 | # Get the latest Android SDK Platform or modify numbers in configure.sh and vlc-android/default.properties. 23 | -- 24 | 1.8.3.4 25 | 26 | -------------------------------------------------------------------------------- /patches/ports-android-app/0007-Makefile-do-not-build-apk.patch: -------------------------------------------------------------------------------- 1 | From f1e79b541d36992c2fd31d179eca78393cfe3189 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Tue, 8 May 2012 11:30:23 +0800 4 | Subject: [PATCH 07/15] Makefile: do not build apk 5 | 6 | --- 7 | Makefile | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/Makefile b/Makefile 11 | index 73f4409..bb33ecd 100644 12 | --- a/Makefile 13 | +++ b/Makefile 14 | @@ -45,7 +45,7 @@ $(VLC_APK): $(LIBVLCJNI) $(JAVA_SOURCES) 15 | echo `id -u -n`@`hostname` > $(SRC)/assets/builder.txt 16 | git rev-parse --short HEAD > $(SRC)/assets/revision.txt 17 | ./gen-env.sh $(SRC) 18 | - $(VERBOSE)cd $(SRC) && ant $(ANT_OPTS) $(ANT_TARGET) 19 | + $(VERBOSE)cd $(SRC) 20 | 21 | VLC_MODULES=`./find_modules.sh $(VLC_BUILD_DIR)` 22 | 23 | -- 24 | 1.8.3.4 25 | 26 | -------------------------------------------------------------------------------- /patches/ports-android-app/0008-AndroidManifest.xml-minsdk-9.patch: -------------------------------------------------------------------------------- 1 | From 3db2b9f4865ca0020e86613ce19b306868f20dad Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Sat, 27 Jul 2013 21:15:12 +0800 4 | Subject: [PATCH 08/15] AndroidManifest.xml: minsdk=9 5 | 6 | --- 7 | vlc-android/AndroidManifest.xml | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/vlc-android/AndroidManifest.xml b/vlc-android/AndroidManifest.xml 11 | index c4e5301..91b183a 100644 12 | --- a/vlc-android/AndroidManifest.xml 13 | +++ b/vlc-android/AndroidManifest.xml 14 | @@ -6,7 +6,7 @@ 15 | android:versionName="0.2.0-git" > 16 | 17 | 21 | 22 | 23 | -- 24 | 1.8.3.4 25 | 26 | -------------------------------------------------------------------------------- /patches/ports-android-app/0009-Android.mk-include-contrib.patch: -------------------------------------------------------------------------------- 1 | From 9aac3495d9f9b4affee04676014d810438bf9af0 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Tue, 28 Jan 2014 13:52:42 +0800 4 | Subject: [PATCH 09/15] Android.mk: include contrib 5 | 6 | --- 7 | vlc-android/jni/Android.mk | 6 ++++++ 8 | 1 file changed, 6 insertions(+) 9 | 10 | diff --git a/vlc-android/jni/Android.mk b/vlc-android/jni/Android.mk 11 | index 87dea03..4bde57f 100644 12 | --- a/vlc-android/jni/Android.mk 13 | +++ b/vlc-android/jni/Android.mk 14 | @@ -40,6 +40,12 @@ LOCAL_SRC_FILES += wchar/wmemset.c 15 | 16 | LOCAL_C_INCLUDES := $(VLC_SRC_DIR)/include 17 | 18 | +ifeq ($(ANDROID_ABI), x86) 19 | + LOCAL_C_INCLUDES += $(VLC_SRC_DIR)/contrib/i686-linux-android/include 20 | +else 21 | + LOCAL_C_INCLUDES += $(VLC_SRC_DIR)/contrib/arm-linux-androideabi/include 22 | +endif 23 | + 24 | ARCH=$(ANDROID_ABI) 25 | 26 | CPP_STATIC=$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++$(CXXSTL)/libs/$(ARCH)/libgnustl_static.a 27 | -- 28 | 1.8.3.4 29 | 30 | -------------------------------------------------------------------------------- /patches/ports-android-app/0010-Android.mk-link-libandroid.patch: -------------------------------------------------------------------------------- 1 | From 8c80773557e05288b78dd510bc5f15a8eeeaf15a Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Sat, 27 Jul 2013 21:15:27 +0800 4 | Subject: [PATCH] Android.mk: link libandroid 5 | 6 | --- 7 | vlc-android/jni/Android.mk | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/vlc-android/jni/Android.mk b/vlc-android/jni/Android.mk 11 | index 39003ff..7e1225b 100644 12 | --- a/vlc-android/jni/Android.mk 13 | +++ b/vlc-android/jni/Android.mk 14 | @@ -66,6 +66,7 @@ LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \ 15 | $(VLC_BUILD_DIR)/src/.libs/libvlccore.a \ 16 | $(VLC_BUILD_DIR)/compat/.libs/libcompat.a \ 17 | -ldl -lz -lm -llog \ 18 | + -landroid \ 19 | -ldvbpsi -lebml -lmatroska -ltag \ 20 | -logg -lFLAC -ltheora -lvorbis \ 21 | -lmpeg2 -la52 \ 22 | -- 23 | 1.8.3.4 24 | 25 | -------------------------------------------------------------------------------- /patches/ports-android-app/0011-_reset_vlc.sh-vlc-repo-reset-script.patch: -------------------------------------------------------------------------------- 1 | From 067f87aa6d397e13ea100c5ea4479889c22c1911 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Tue, 8 May 2012 12:32:02 +0800 4 | Subject: [PATCH 11/15] _reset_vlc.sh: vlc repo reset script 5 | 6 | --- 7 | _reset_vlc.sh | 3 +++ 8 | 1 file changed, 3 insertions(+) 9 | create mode 100644 _reset_vlc.sh 10 | 11 | diff --git a/_reset_vlc.sh b/_reset_vlc.sh 12 | new file mode 100644 13 | index 0000000..f576ca8 14 | --- /dev/null 15 | +++ b/_reset_vlc.sh 16 | @@ -0,0 +1,3 @@ 17 | +#! /bin/sh 18 | + 19 | +sh ../_do_reset_vlc.sh 20 | -- 21 | 1.8.3.4 22 | 23 | -------------------------------------------------------------------------------- /patches/ports-android/0001-.gitignore.patch: -------------------------------------------------------------------------------- 1 | From a1c66fb7003f790893ce6f190d6c8b94d50584ea Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Sat, 14 Jul 2012 15:15:42 +0800 4 | Subject: [PATCH 01/16] .gitignore 5 | 6 | --- 7 | .gitignore | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/.gitignore b/.gitignore 11 | index 32a12cc..6566438 100644 12 | --- a/.gitignore 13 | +++ b/.gitignore 14 | @@ -1,5 +1,7 @@ 15 | /vlc/ 16 | /android-libs/*.so 17 | +/patches/100*.patch 18 | +/pt 19 | local.properties 20 | .DS_Store 21 | *.keystore 22 | -- 23 | 1.9.0 24 | 25 | -------------------------------------------------------------------------------- /patches/ports-android/0002-compile.sh-set-CHOST-for-cross-compile.patch: -------------------------------------------------------------------------------- 1 | From 8e98a10f9e98f42874453e6af9e1d26775a2849a Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Sat, 11 Aug 2012 14:27:45 +0800 4 | Subject: [PATCH 02/16] compile.sh: set CHOST for cross compile 5 | 6 | --- 7 | compile.sh | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/compile.sh b/compile.sh 11 | index 97a7c15..70ffdde 100755 12 | --- a/compile.sh 13 | +++ b/compile.sh 14 | @@ -101,6 +101,7 @@ export PLATFORM_SHORT_ARCH 15 | # Add the NDK toolchain to the PATH, needed both for contribs and for building 16 | # stub libraries 17 | NDK_TOOLCHAIN_PATH=`echo ${ANDROID_NDK}/toolchains/${PATH_HOST}-${GCCVER}/prebuilt/\`uname|tr A-Z a-z\`-*/bin` 18 | +CHOST=${NDK_TOOLCHAIN_PATH}/${TARGET_TUPLE} 19 | export PATH=${NDK_TOOLCHAIN_PATH}:${PATH} 20 | 21 | ANDROID_PATH="`pwd`" 22 | @@ -251,6 +252,7 @@ else 23 | fi 24 | 25 | echo "EXTRA_CFLAGS= -g ${EXTRA_CFLAGS}" >> config.mak 26 | +echo "CHOST= ${CHOST}" >> config.mak 27 | export VLC_EXTRA_CFLAGS="${EXTRA_CFLAGS}" 28 | 29 | make fetch 30 | -- 31 | 1.9.0 32 | 33 | -------------------------------------------------------------------------------- /patches/ports-android/0003-compile.sh-restore-saved-contrib-package.patch: -------------------------------------------------------------------------------- 1 | From 8dc63c944ffc3096c5f87bf7fd18585e66199364 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 5 Mar 2012 17:18:45 +0800 4 | Subject: [PATCH 03/16] compile.sh: restore saved contrib package 5 | 6 | --- 7 | compile.sh | 6 ++++++ 8 | 1 file changed, 6 insertions(+) 9 | 10 | diff --git a/compile.sh b/compile.sh 11 | index 70ffdde..0f17cba 100755 12 | --- a/compile.sh 13 | +++ b/compile.sh 14 | @@ -255,6 +255,12 @@ echo "EXTRA_CFLAGS= -g ${EXTRA_CFLAGS}" >> config.mak 15 | echo "CHOST= ${CHOST}" >> config.mak 16 | export VLC_EXTRA_CFLAGS="${EXTRA_CFLAGS}" 17 | 18 | +if test -d "../../../../tarballs" ; then 19 | + echo "fetch local tarballs" 20 | + mkdir -p ../tarballs 21 | + cp -n -v ../../../../tarballs/* ../tarballs/ || true 22 | +fi 23 | + 24 | make fetch 25 | # We already have zlib available 26 | [ -e .zlib ] || (mkdir -p zlib; touch .zlib) 27 | -- 28 | 1.9.0 29 | 30 | -------------------------------------------------------------------------------- /patches/ports-android/0004-compile.sh-support-fastcompile.sh.patch: -------------------------------------------------------------------------------- 1 | From e4e612a56bf96ef2105facbacf018feca250d963 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Sat, 28 Jul 2012 17:21:40 +0800 4 | Subject: [PATCH 04/16] compile.sh: support fastcompile.sh 5 | 6 | --- 7 | fastcompile.sh | 4 ++++ 8 | 1 file changed, 4 insertions(+) 9 | create mode 100644 fastcompile.sh 10 | 11 | diff --git a/fastcompile.sh b/fastcompile.sh 12 | new file mode 100644 13 | index 0000000..14c672b 14 | --- /dev/null 15 | +++ b/fastcompile.sh 16 | @@ -0,0 +1,4 @@ 17 | +#! /bin/sh 18 | + 19 | +export VLC_FAST_COMPILE=1 20 | +sh compile.sh jni 21 | -- 22 | 1.9.0 23 | 24 | -------------------------------------------------------------------------------- /patches/ports-android/0005-compile.sh-disable-extras-tools.patch: -------------------------------------------------------------------------------- 1 | From c133cb914a9eb0c16813ac31a65cf68c26366860 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 20 May 2013 22:29:57 +0800 4 | Subject: [PATCH 05/16] compile.sh: disable extras/tools 5 | 6 | --- 7 | compile.sh | 12 ++++++------ 8 | 1 file changed, 6 insertions(+), 6 deletions(-) 9 | 10 | diff --git a/compile.sh b/compile.sh 11 | index 0f17cba..4310c9d 100755 12 | --- a/compile.sh 13 | +++ b/compile.sh 14 | @@ -187,12 +187,12 @@ then 15 | MAKEFLAGS=-j`sysctl -n machdep.cpu.thread_count` 16 | fi 17 | 18 | -export PATH=`pwd`/extras/tools/build/bin:$PATH 19 | -echo "Building tools" 20 | -cd extras/tools 21 | -./bootstrap 22 | -make $MAKEFLAGS 23 | -cd ../.. 24 | +# export PATH=`pwd`/extras/tools/build/bin:$PATH 25 | +# echo "Building tools" 26 | +# cd extras/tools 27 | +# ./bootstrap 28 | +# make $MAKEFLAGS 29 | +# cd ../.. 30 | 31 | echo "Building the contribs" 32 | mkdir -p contrib/android 33 | -- 34 | 1.9.0 35 | 36 | -------------------------------------------------------------------------------- /patches/ports-android/0006-compile.sh-config-target-abi-env.patch: -------------------------------------------------------------------------------- 1 | From cb399bb846b6736789f2bcfa701d273a32f0413a Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 10 Feb 2014 14:55:42 +0800 4 | Subject: [PATCH 06/16] compile.sh: config target abi env 5 | 6 | --- 7 | compile.sh | 3 +++ 8 | 1 file changed, 3 insertions(+) 9 | 10 | diff --git a/compile.sh b/compile.sh 11 | index 4310c9d..6370de2 100755 12 | --- a/compile.sh 13 | +++ b/compile.sh 14 | @@ -1,5 +1,8 @@ 15 | #! /bin/sh 16 | 17 | +# target-abi env 18 | +source target-abi.sh 19 | + 20 | # Read the Android Wiki http://wiki.videolan.org/AndroidCompile 21 | # Setup all that stuff correctly. 22 | # Get the latest Android SDK Platform or modify numbers in configure.sh and vlc-android/default.properties. 23 | -- 24 | 1.9.0 25 | 26 | -------------------------------------------------------------------------------- /patches/ports-android/0007-Makefile-do-not-build-apk.patch: -------------------------------------------------------------------------------- 1 | From ccd0a93c0b57a2bb42a6ab8377ce9ff53b1ceed6 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Tue, 8 May 2012 11:30:23 +0800 4 | Subject: [PATCH 07/16] Makefile: do not build apk 5 | 6 | --- 7 | Makefile | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/Makefile b/Makefile 11 | index 8ab1ace..34d2af6 100644 12 | --- a/Makefile 13 | +++ b/Makefile 14 | @@ -45,7 +45,7 @@ $(VLC_APK): $(LIBVLCJNI) $(JAVA_SOURCES) 15 | echo `id -u -n`@`hostname` > $(SRC)/assets/builder.txt 16 | git rev-parse --short HEAD > $(SRC)/assets/revision.txt 17 | ./gen-env.sh $(SRC) 18 | - $(VERBOSE)cd $(SRC) && ant $(ANT_OPTS) $(ANT_TARGET) 19 | + $(VERBOSE)cd $(SRC) 20 | 21 | VLC_MODULES=`./find_modules.sh $(VLC_BUILD_DIR)` 22 | 23 | -- 24 | 1.9.0 25 | 26 | -------------------------------------------------------------------------------- /patches/ports-android/0008-AndroidManifest.xml-minsdk-9.patch: -------------------------------------------------------------------------------- 1 | From 0e1b3b669567b87f37ec055df8cdaff451124f94 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Sat, 27 Jul 2013 21:15:12 +0800 4 | Subject: [PATCH] AndroidManifest.xml: minsdk=9 5 | 6 | --- 7 | vlc-android/AndroidManifest.xml | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/vlc-android/AndroidManifest.xml b/vlc-android/AndroidManifest.xml 11 | index 6cd37b8..d59e9a5 100644 12 | --- a/vlc-android/AndroidManifest.xml 13 | +++ b/vlc-android/AndroidManifest.xml 14 | @@ -6,7 +6,7 @@ 15 | android:versionName="0.9.4-git" > 16 | 17 | 21 | 22 | 23 | -- 24 | 1.8.5.2 (Apple Git-48) 25 | 26 | -------------------------------------------------------------------------------- /patches/ports-android/0009-Android.mk-include-contrib.patch: -------------------------------------------------------------------------------- 1 | From 5d2f58bd1384f1ee13f042e1a7017554418299ab Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Tue, 28 Jan 2014 13:52:42 +0800 4 | Subject: [PATCH 09/16] Android.mk: include contrib 5 | 6 | --- 7 | vlc-android/jni/Android.mk | 6 ++++++ 8 | 1 file changed, 6 insertions(+) 9 | 10 | diff --git a/vlc-android/jni/Android.mk b/vlc-android/jni/Android.mk 11 | index 2fc58b6..39003ff 100644 12 | --- a/vlc-android/jni/Android.mk 13 | +++ b/vlc-android/jni/Android.mk 14 | @@ -40,6 +40,12 @@ LOCAL_SRC_FILES += wchar/wmemset.c 15 | 16 | LOCAL_C_INCLUDES := $(VLC_SRC_DIR)/include 17 | 18 | +ifeq ($(ANDROID_ABI), x86) 19 | + LOCAL_C_INCLUDES += $(VLC_SRC_DIR)/contrib/i686-linux-android/include 20 | +else 21 | + LOCAL_C_INCLUDES += $(VLC_SRC_DIR)/contrib/arm-linux-androideabi/include 22 | +endif 23 | + 24 | ARCH=$(ANDROID_ABI) 25 | 26 | CPP_STATIC=$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++$(CXXSTL)/libs/$(ARCH)/libgnustl_static.a 27 | -- 28 | 1.9.0 29 | 30 | -------------------------------------------------------------------------------- /patches/ports-android/0010-Android.mk-link-libandroid.patch: -------------------------------------------------------------------------------- 1 | From b70ec565effaa95144d84fa37341a712a8ad534a Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Sat, 27 Jul 2013 21:15:27 +0800 4 | Subject: [PATCH 10/16] Android.mk: link libandroid 5 | 6 | --- 7 | vlc-android/jni/Android.mk | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/vlc-android/jni/Android.mk b/vlc-android/jni/Android.mk 11 | index 39003ff..7e1225b 100644 12 | --- a/vlc-android/jni/Android.mk 13 | +++ b/vlc-android/jni/Android.mk 14 | @@ -66,6 +66,7 @@ LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \ 15 | $(VLC_BUILD_DIR)/src/.libs/libvlccore.a \ 16 | $(VLC_BUILD_DIR)/compat/.libs/libcompat.a \ 17 | -ldl -lz -lm -llog \ 18 | + -landroid \ 19 | -ldvbpsi -lebml -lmatroska -ltag \ 20 | -logg -lFLAC -ltheora -lvorbis \ 21 | -lmpeg2 -la52 \ 22 | -- 23 | 1.9.0 24 | 25 | -------------------------------------------------------------------------------- /patches/ports-android/0011-_reset_vlc.sh-vlc-repo-reset-script.patch: -------------------------------------------------------------------------------- 1 | From 09f5cf0ab22612ac0787c0c8b90141f33c390460 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Tue, 8 May 2012 12:32:02 +0800 4 | Subject: [PATCH 11/16] _reset_vlc.sh: vlc repo reset script 5 | 6 | --- 7 | _reset_vlc.sh | 3 +++ 8 | 1 file changed, 3 insertions(+) 9 | create mode 100644 _reset_vlc.sh 10 | 11 | diff --git a/_reset_vlc.sh b/_reset_vlc.sh 12 | new file mode 100644 13 | index 0000000..f576ca8 14 | --- /dev/null 15 | +++ b/_reset_vlc.sh 16 | @@ -0,0 +1,3 @@ 17 | +#! /bin/sh 18 | + 19 | +sh ../_do_reset_vlc.sh 20 | -- 21 | 1.9.0 22 | 23 | -------------------------------------------------------------------------------- /patches/ports-android/0012-_install_vlc.sh-vlc-lib-install-script.patch: -------------------------------------------------------------------------------- 1 | From 3783a49ae6819a6e9c190f38732aa2ffabb27ecc Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Tue, 8 May 2012 15:23:34 +0800 4 | Subject: [PATCH 12/16] _install_vlc.sh vlc lib install script 5 | 6 | --- 7 | _install_vlc.sh | 8 ++++++++ 8 | 1 file changed, 8 insertions(+) 9 | create mode 100644 _install_vlc.sh 10 | 11 | diff --git a/_install_vlc.sh b/_install_vlc.sh 12 | new file mode 100644 13 | index 0000000..13cb83f 14 | --- /dev/null 15 | +++ b/_install_vlc.sh 16 | @@ -0,0 +1,8 @@ 17 | +#! /bin/sh 18 | + 19 | +INSTALL_PROJECT=../../../iBiliPlayer 20 | +cp -vR vlc-android/libs/* ${INSTALL_PROJECT}/libs/ 21 | +rm ${INSTALL_PROJECT}/libs/armeabi/gdb.setup 22 | +rm ${INSTALL_PROJECT}/libs/armeabi/gdbserver 23 | +rm ${INSTALL_PROJECT}/libs/armeabi-v7a/gdb.setup 24 | +rm ${INSTALL_PROJECT}/libs/armeabi-v7a/gdbserver 25 | -- 26 | 1.9.0 27 | 28 | -------------------------------------------------------------------------------- /patches/ports-android/0015-compile.sh-fix-build-jni-for-target-x86.patch: -------------------------------------------------------------------------------- 1 | From e131a76ecbfbc6f27690279f4d0d46e37f639189 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Fri, 14 Feb 2014 17:18:01 +0800 4 | Subject: [PATCH] compile.sh: fix build jni for target x86 5 | 6 | --- 7 | compile.sh | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/compile.sh b/compile.sh 11 | index 73675a4..a07552e 100755 12 | --- a/compile.sh 13 | +++ b/compile.sh 14 | @@ -266,7 +266,7 @@ cd ../.. && mkdir -p android && cd android 15 | 16 | if [ $# -eq 1 ] && [ "$1" = "jni" ]; then 17 | CLEAN="jniclean" 18 | - TARGET="vlc-android/obj/local/armeabi-v7a/libvlcjni.so" 19 | + TARGET="vlc-android/obj/local/$ANDROID_ABI/libvlcjni.so" 20 | else 21 | CLEAN="distclean" 22 | if [ ! -f ../configure ]; then 23 | -- 24 | 1.8.5.2 (Apple Git-48) 25 | 26 | -------------------------------------------------------------------------------- /patches/ports-android/0016-compile.sh-make-Fedora-happy.patch: -------------------------------------------------------------------------------- 1 | From 3a89d7a8bef140f7afea0ba70b1e46c84f650288 Mon Sep 17 00:00:00 2001 2 | From: Ming Hu 3 | Date: Wed, 26 Feb 2014 14:51:33 +0800 4 | Subject: [PATCH 16/16] compile.sh: make Fedora happy. 5 | 6 | --- 7 | compile.sh | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/compile.sh b/compile.sh 11 | index edd234a..73c1f24 100755 12 | --- a/compile.sh 13 | +++ b/compile.sh 14 | @@ -1,7 +1,7 @@ 15 | #! /bin/sh 16 | 17 | # target-abi env 18 | -source target-abi.sh 19 | +source ./target-abi.sh 20 | 21 | # Read the Android Wiki http://wiki.videolan.org/AndroidCompile 22 | # Setup all that stuff correctly. 23 | -- 24 | 1.9.0 25 | 26 | -------------------------------------------------------------------------------- /patches/ports-android/0017-correct-a-name.patch: -------------------------------------------------------------------------------- 1 | From 1cafa414626346b14b6ea09177204cb29f5d6bcb Mon Sep 17 00:00:00 2001 2 | From: Ming Hu 3 | Date: Tue, 10 Jun 2014 10:08:18 +0800 4 | Subject: [PATCH] correct a name 5 | 6 | --- 7 | find_modules.sh | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/find_modules.sh b/find_modules.sh 11 | index 0be2ff5..67f6085 100755 12 | --- a/find_modules.sh 13 | +++ b/find_modules.sh 14 | @@ -45,7 +45,7 @@ smf 15 | podcast 16 | bluescreen 17 | erase 18 | -stream_filter_record 19 | +record 20 | speex_resampler 21 | remoteosd 22 | magnify 23 | -- 24 | 1.8.5.2 (Apple Git-48) 25 | 26 | -------------------------------------------------------------------------------- /patches/ports-android/0018-jni-compat.patch: -------------------------------------------------------------------------------- 1 | From c59afc6c99678f55de1c85cc8fddd96183c9581b Mon Sep 17 00:00:00 2001 2 | From: Ming Hu 3 | Date: Mon, 24 Nov 2014 16:16:30 +0800 4 | Subject: [PATCH] jni: compat 5 | 6 | --- 7 | vlc-android/jni/libvlcjni_danmaku_nativeInitEx.inc.c | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/vlc-android/jni/libvlcjni_danmaku_nativeInitEx.inc.c b/vlc-android/jni/libvlcjni_danmaku_nativeInitEx.inc.c 11 | index ab052f3..37c76f4 100644 12 | --- a/vlc-android/jni/libvlcjni_danmaku_nativeInitEx.inc.c 13 | +++ b/vlc-android/jni/libvlcjni_danmaku_nativeInitEx.inc.c 14 | @@ -23,7 +23,7 @@ 15 | #ifndef LIBVLCJNI_DANMAKU_NATIVEINITEX_INC_C 16 | #define LIBVLCJNI_DANMAKU_NATIVEINITEX_INC_C 17 | 18 | -void Java_org_videolan_libvlc_LibVLC_nativeInitEx(JNIEnv *env, jobject thiz, jboolean verbose, jarray arguments) 19 | +void Java_org_videolan_libvlc_LibVLC_nativeInitEx(JNIEnv *env, jobject thiz, jarray arguments) 20 | { 21 | libvlc_instance_t *instance = NULL; 22 | 23 | -- 24 | 2.1.3 25 | 26 | -------------------------------------------------------------------------------- /patches/ports-android/cherry-picks.list: -------------------------------------------------------------------------------- 1 | bdb584181d2ce1e8170d755ec7f37132880f44fb 2 | -------------------------------------------------------------------------------- /patches/ports-android/ignore/0009-compile.sh-use-gcc-4.4.3.patch: -------------------------------------------------------------------------------- 1 | From 7920ee997c6f64eed46b9d07f20b8206662318b1 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 15 Oct 2012 14:14:31 +0800 4 | Subject: [PATCH 09/10] compile.sh: use gcc 4.4.3 5 | 6 | --- 7 | compile.sh | 4 ++-- 8 | 1 个文件被修改,插入 2 行(+),删除 2 行(-) 9 | 10 | diff --git a/compile.sh b/compile.sh 11 | index b786153..50bd566 100755 12 | --- a/compile.sh 13 | +++ b/compile.sh 14 | @@ -18,8 +18,8 @@ case "$REL" in 15 | 8?) 16 | # NDK >= v8b, both 4.4.3 and 4.6 available, 17 | # we use 4.6 because 4.4.3 doesn't handle threads correctly. 18 | - GCCVER=4.6 19 | - CXXSTL="/4.6" 20 | + GCCVER=4.4.3 21 | + CXXSTL="/4.4.3" 22 | ;; 23 | 7|8|*) 24 | echo "You need the NDKv8b or later" 25 | -- 26 | 1.7.10.4 27 | 28 | -------------------------------------------------------------------------------- /patches/ports-android/ignore/0010-Application.mk-use-gcc-4.4.3.patch: -------------------------------------------------------------------------------- 1 | From b980e49d88e43be71297f346710935f6be5944c2 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 15 Oct 2012 14:14:55 +0800 4 | Subject: [PATCH 10/10] Application.mk: use gcc 4.4.3 5 | 6 | --- 7 | vlc-android/jni/Application.mk | 2 +- 8 | 1 个文件被修改,插入 1 行(+),删除 1 行(-) 9 | 10 | diff --git a/vlc-android/jni/Application.mk b/vlc-android/jni/Application.mk 11 | index 0bd8e8a..006c98a 100644 12 | --- a/vlc-android/jni/Application.mk 13 | +++ b/vlc-android/jni/Application.mk 14 | @@ -1,3 +1,3 @@ 15 | APP_PLATFORM := android-9 16 | APP_ABI := $(ANDROID_ABI) 17 | -NDK_TOOLCHAIN_VERSION=4.6 18 | +NDK_TOOLCHAIN_VERSION=4.4.3 19 | -- 20 | 1.7.10.4 21 | 22 | -------------------------------------------------------------------------------- /patches/ports-android/module-full/nothing: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilibili/vlc-android-macbuild/d3f6d9c16346b43336a8b68942ab27b2790032f1/patches/ports-android/module-full/nothing -------------------------------------------------------------------------------- /patches/ports-android/module-lite/0001-Android.mk-link-less-libs.patch: -------------------------------------------------------------------------------- 1 | From a880e79d4e9010c4a57f27291eee7eca9140c0de Mon Sep 17 00:00:00 2001 2 | From: Ming Hu 3 | Date: Fri, 31 Oct 2014 11:38:10 +0800 4 | Subject: [PATCH 1/4] Android.mk: link less libs 5 | 6 | --- 7 | vlc-android/jni/Android.mk | 14 +------------- 8 | 1 file changed, 1 insertion(+), 13 deletions(-) 9 | 10 | diff --git a/vlc-android/jni/Android.mk b/vlc-android/jni/Android.mk 11 | index 8373aa8..3a83ab7 100644 12 | --- a/vlc-android/jni/Android.mk 13 | +++ b/vlc-android/jni/Android.mk 14 | @@ -68,19 +68,7 @@ LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \ 15 | $(VLC_BUILD_DIR)/src/.libs/libvlccore.a \ 16 | $(VLC_BUILD_DIR)/compat/.libs/libcompat.a \ 17 | -ldl -lz -lm -llog \ 18 | - -landroid \ 19 | - -ldvbpsi -lebml -lmatroska -ltag \ 20 | - -logg -lFLAC -ltheora -lvorbis \ 21 | - -lmpeg2 -la52 \ 22 | - -lavformat -lavcodec -lswscale -lavutil -lpostproc -lgsm -lopenjpeg \ 23 | - -lliveMedia -lUsageEnvironment -lBasicUsageEnvironment -lgroupsock \ 24 | - -lspeex -lspeexdsp \ 25 | - -lxml2 -lpng -lgnutls -lgcrypt -lgpg-error \ 26 | - -lnettle -lhogweed -lgmp \ 27 | - -lfreetype -liconv -lass -lfribidi -lopus \ 28 | - -lEGL -lGLESv2 -ljpeg \ 29 | - -ldvdnav -ldvdread -ldvdcss \ 30 | - $(CPP_STATIC) 31 | + -lEGL -lGLESv2 32 | 33 | include $(BUILD_SHARED_LIBRARY) 34 | 35 | -- 36 | 2.1.3 37 | 38 | -------------------------------------------------------------------------------- /patches/ports-android/module-lite/0003-find_modules-disable-more-modules.patch: -------------------------------------------------------------------------------- 1 | From 5ea5332aff7e48765f4ead1f87e999462b84d9a2 Mon Sep 17 00:00:00 2001 2 | From: Ming Hu 3 | Date: Fri, 31 Oct 2014 11:47:54 +0800 4 | Subject: [PATCH 3/4] find_modules: disable more modules 5 | 6 | --- 7 | find_modules.sh | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 8 | 1 file changed, 100 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/find_modules.sh b/find_modules.sh 11 | index 3885799..22f7c37 100755 12 | --- a/find_modules.sh 13 | +++ b/find_modules.sh 14 | @@ -9,7 +9,7 @@ fi 15 | blacklist=" 16 | addons.* 17 | stats 18 | -access_(bd|shm|imem) 19 | +access_(bd|shm|imem|mms) 20 | oldrc 21 | real 22 | hotkeys 23 | @@ -58,6 +58,105 @@ fb 24 | aout_file 25 | yuv 26 | .dummy 27 | +a52 28 | +decom 29 | +ftp 30 | +adpcm 31 | +aes3 32 | +afile 33 | +aiff 34 | +araw 35 | +asf 36 | +attachment 37 | +au 38 | +avi 39 | +caf 40 | +cc 41 | +cdg 42 | +cvdsub 43 | +dash 44 | +decomp 45 | +demux_(cdg|stl) 46 | +demuxdump 47 | +diracsys 48 | +dts 49 | +dummy 50 | +dvbsub 51 | +es 52 | +flacsys 53 | +g711 54 | +gles2 55 | +grey_yuv 56 | +h264 57 | +hevc 58 | +hds 59 | +httplive 60 | +image 61 | +imem 62 | +lpcm 63 | +mjpeg 64 | +mp4 65 | +mpeg_audio 66 | +mpgv 67 | +nsc 68 | +nsv 69 | +nuv 70 | +playlist 71 | +ps 72 | +pva 73 | +rar 74 | +rawaud 75 | +rawdv 76 | +rawvid 77 | +rawvideo 78 | +rtp 79 | +rv32 80 | +scte27 81 | +sdp 82 | +shm 83 | +smooth 84 | +spatializer 85 | +spudec 86 | +stl 87 | +subsdec 88 | +substx3g 89 | +subsusf 90 | +subtitle 91 | +svcdsub 92 | +tcp 93 | +telx 94 | +timecode 95 | +tta 96 | +ty 97 | +udp 98 | +uleaddvaudio 99 | +vc1 100 | +vdr 101 | +vobsub 102 | +voc 103 | +wav 104 | +xa 105 | +zip 106 | +dolby_surround_decoder 107 | +stereo_diden 108 | +adjust 109 | +anaglyph 110 | +antiflicker 111 | +colorthres 112 | +extract 113 | +freeze 114 | +gaussianblur 115 | +gradfun 116 | +hqdn3d 117 | +invert 118 | +logo 119 | +marq 120 | +oldmovie 121 | +rotate 122 | +sepia 123 | +subsdelay 124 | +vhs 125 | +wave 126 | " 127 | 128 | regexp= 129 | -- 130 | 2.1.3 131 | 132 | -------------------------------------------------------------------------------- /patches/ports-android/module-lite/0004-compile.sh-use-ffmpeg-from-ijkplayer.patch: -------------------------------------------------------------------------------- 1 | From eac36e245e46e3759e4032fdbe7f3a9592dc8dfc Mon Sep 17 00:00:00 2001 2 | From: Ming Hu 3 | Date: Mon, 24 Nov 2014 15:32:37 +0800 4 | Subject: [PATCH 4/4] compile.sh: use ffmpeg from ijkplayer 5 | 6 | --- 7 | Makefile | 1 + 8 | compile.sh | 19 +++++++++++++++++++ 9 | vlc-android/jni/Android.mk | 7 +++++++ 10 | vlc-android/jni/libvlcjni_danmaku.c | 4 ++-- 11 | 4 files changed, 29 insertions(+), 2 deletions(-) 12 | 13 | diff --git a/Makefile b/Makefile 14 | index 34d2af6..e90581f 100644 15 | --- a/Makefile 16 | +++ b/Makefile 17 | @@ -90,6 +90,7 @@ $(LIBVLCJNI): $(JNI_SOURCES) $(LIBVLCJNI_H) $(PRIVATE_LIBS) 18 | VLC_CONTRIB="$$VLC_CONTRIB" \ 19 | VLC_BUILD_DIR="$$VLC_BUILD_DIR" \ 20 | VLC_MODULES="$$vlc_modules" \ 21 | + IJKPLAYER="$$IJKPLAYER" \ 22 | NDK_DEBUG=$(NDK_DEBUG) \ 23 | TARGET_CFLAGS="$$VLC_EXTRA_CFLAGS" 24 | 25 | diff --git a/compile.sh b/compile.sh 26 | index c264c10..b7de04c 100755 27 | --- a/compile.sh 28 | +++ b/compile.sh 29 | @@ -213,6 +213,25 @@ mkdir -p contrib/${TARGET_TUPLE}/lib/pkgconfig 30 | gen_pc_file EGL 1.1 31 | gen_pc_file GLESv2 2 32 | 33 | +IJKPLAYER=`pwd`/../../../ijkplayer 34 | +if [ -d $IJKPLAYER ]; then 35 | + IJKFFMPEG="" 36 | + if [ $ANDROID_ABI = "armeabi-v7a" ]; then 37 | + IJKFFMPEG=${IJKPLAYER}/android/build/ffmpeg-armv7a/output/shared 38 | + elif [ $ANDROID_ABI = "armeabi" ]; then 39 | + IJKFFMPEG=${IJKPLAYER}/android/build/ffmpeg-armv5/output/shared 40 | + elif [ $ANDROID_ABI = "x86" ]; then 41 | + IJKFFMPEG=${IJKPLAYER}/android/build/ffmpeg-x86/output/shared 42 | + else 43 | + echo "Unknown ABI ${ANDROID_ABI} to ijkplayer" 44 | + exit 1 45 | + fi 46 | + cp ${IJKFFMPEG}/lib/pkgconfig/*.pc contrib/${TARGET_TUPLE}/lib/pkgconfig 47 | + # find a way to make Android.mk use -L in pkgconfig 48 | + ln -sf ${IJKFFMPEG}/lib/libijkffmpeg.so contrib/${TARGET_TUPLE}/lib/libijkffmpeg.so 49 | +export IJKPLAYER 50 | +fi 51 | + 52 | cd contrib/android 53 | ../bootstrap --host=${TARGET_TUPLE} --disable-disc --disable-sout \ 54 | --disable-dvdread \ 55 | diff --git a/vlc-android/jni/Android.mk b/vlc-android/jni/Android.mk 56 | index 3a83ab7..f955895 100644 57 | --- a/vlc-android/jni/Android.mk 58 | +++ b/vlc-android/jni/Android.mk 59 | @@ -44,8 +44,14 @@ LOCAL_C_INCLUDES := $(VLC_SRC_DIR)/include 60 | 61 | ifeq ($(ANDROID_ABI), x86) 62 | LOCAL_C_INCLUDES += $(VLC_SRC_DIR)/contrib/i686-linux-android/include 63 | + LOCAL_C_INCLUDES += $(IJKPLAYER)/android/ffmpeg-x86 64 | else 65 | LOCAL_C_INCLUDES += $(VLC_SRC_DIR)/contrib/arm-linux-androideabi/include 66 | + ifeq ($(ANDROID_ABI), armeabi-v7a) 67 | + LOCAL_C_INCLUDES += $(IJKPLAYER)/android/ffmpeg-armv7a 68 | + else 69 | + LOCAL_C_INCLUDES += $(IJKPLAYER)/android/ffmpeg-armv5 70 | + endif 71 | endif 72 | 73 | ARCH=$(ANDROID_ABI) 74 | @@ -68,6 +74,7 @@ LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \ 75 | $(VLC_BUILD_DIR)/src/.libs/libvlccore.a \ 76 | $(VLC_BUILD_DIR)/compat/.libs/libcompat.a \ 77 | -ldl -lz -lm -llog \ 78 | + -lijkffmpeg \ 79 | -lEGL -lGLESv2 80 | 81 | include $(BUILD_SHARED_LIBRARY) 82 | diff --git a/vlc-android/jni/libvlcjni_danmaku.c b/vlc-android/jni/libvlcjni_danmaku.c 83 | index 59a5441..7e577b7 100644 84 | --- a/vlc-android/jni/libvlcjni_danmaku.c 85 | +++ b/vlc-android/jni/libvlcjni_danmaku.c 86 | @@ -34,8 +34,8 @@ 87 | 88 | #include 89 | 90 | -#include "../../vlc/contrib/android/ffmpeg/libavutil/avstring.h" 91 | -#include "../../vlc/contrib/android/ffmpeg/libavutil/log.h" 92 | +#include 93 | +#include 94 | 95 | #include "libvlcjni.h" 96 | #include "aout.h" 97 | -- 98 | 2.1.3 99 | 100 | -------------------------------------------------------------------------------- /patches/ports-android/module-lite/ignore/0001-lite-mode-Android.mk-disable-modules.patch: -------------------------------------------------------------------------------- 1 | From dfd10b6faf599b48ae31a294ad1286bac5fd97dc Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Fri, 23 Mar 2012 17:59:42 +0800 4 | Subject: [PATCH] lite-mode: Android.mk: disable modules 5 | 6 | --- 7 | vlc-android/jni/Android.mk | 15 +++++---------- 8 | 1 file changed, 5 insertions(+), 10 deletions(-) 9 | 10 | diff --git a/vlc-android/jni/Android.mk b/vlc-android/jni/Android.mk 11 | index 8373aa8..a9a12da 100644 12 | --- a/vlc-android/jni/Android.mk 13 | +++ b/vlc-android/jni/Android.mk 14 | @@ -69,17 +69,12 @@ LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \ 15 | $(VLC_BUILD_DIR)/compat/.libs/libcompat.a \ 16 | -ldl -lz -lm -llog \ 17 | -landroid \ 18 | - -ldvbpsi -lebml -lmatroska -ltag \ 19 | - -logg -lFLAC -ltheora -lvorbis \ 20 | - -lmpeg2 -la52 \ 21 | - -lavformat -lavcodec -lswscale -lavutil -lpostproc -lgsm -lopenjpeg \ 22 | - -lliveMedia -lUsageEnvironment -lBasicUsageEnvironment -lgroupsock \ 23 | - -lspeex -lspeexdsp \ 24 | - -lxml2 -lpng -lgnutls -lgcrypt -lgpg-error \ 25 | + -ldvbpsi \ 26 | + -lavformat -lavcodec -lswscale -lavutil \ 27 | + -lgnutls -lgcrypt -lgpg-error \ 28 | -lnettle -lhogweed -lgmp \ 29 | - -lfreetype -liconv -lass -lfribidi -lopus \ 30 | - -lEGL -lGLESv2 -ljpeg \ 31 | - -ldvdnav -ldvdread -ldvdcss \ 32 | + -lEGL -lGLESv2 \ 33 | + -lfaad \ 34 | $(CPP_STATIC) 35 | 36 | include $(BUILD_SHARED_LIBRARY) 37 | -- 38 | 1.8.5.2 (Apple Git-48) 39 | 40 | -------------------------------------------------------------------------------- /patches/ports-android/module-lite/ignore/0002-lite-mode-compile.sh-disable-contrib.patch: -------------------------------------------------------------------------------- 1 | From 073c01d9e125873f21deccbb2501b9cb6f60fb96 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 28 May 2012 11:45:12 +0800 4 | Subject: [PATCH 2/6] lite-mode: compile.sh: disable contrib 5 | 6 | --- 7 | compile.sh | 39 ++++++++++++++++++++++++++++++++++----- 8 | 1 file changed, 34 insertions(+), 5 deletions(-) 9 | 10 | diff --git a/compile.sh b/compile.sh 11 | index aa3dbdf..b911306 100755 12 | --- a/compile.sh 13 | +++ b/compile.sh 14 | @@ -215,8 +215,8 @@ gen_pc_file GLESv2 2 15 | 16 | cd contrib/android 17 | ../bootstrap --host=${TARGET_TUPLE} --disable-disc --disable-sout \ 18 | - --enable-dvdread \ 19 | - --enable-dvdnav \ 20 | + --disable-dvdread \ 21 | + --disable-dvdnav \ 22 | --disable-dca \ 23 | --disable-goom \ 24 | --disable-chromaprint \ 25 | @@ -233,12 +233,41 @@ cd contrib/android 26 | --disable-upnp \ 27 | --disable-gme \ 28 | --disable-tremor \ 29 | - --enable-vorbis \ 30 | + --disable-vorbis \ 31 | --disable-sidplay2 \ 32 | + --disable-ass \ 33 | + --disable-fribidi \ 34 | + --disable-taglib \ 35 | + --disable-live555 \ 36 | + --disable-schroedinger \ 37 | + --disable-matroska \ 38 | + --disable-goom \ 39 | + --disable-gsm \ 40 | + --disable-speex \ 41 | + --disable-speexdsp \ 42 | + --disable-freetype2 \ 43 | + --disable-lua \ 44 | + --disable-flac \ 45 | + --disable-ogg \ 46 | + --disable-dca \ 47 | + --disable-theora \ 48 | + --disable-modplug \ 49 | + --disable-png \ 50 | + --disable-openjpg \ 51 | + --disable-libxml2 \ 52 | + --disable-opus \ 53 | + --disable-mad \ 54 | + --disable-postproc \ 55 | + --disable-libmpeg2 \ 56 | + --disable-a52 \ 57 | + --disable-vncserver \ 58 | + --disable-png \ 59 | + --disable-jpeg \ 60 | --disable-samplerate \ 61 | - --disable-faad2 \ 62 | + --enable-faad2 \ 63 | --disable-harfbuzz \ 64 | - --enable-iconv 65 | + --disable-ssh2 \ 66 | + --disable-iconv 67 | 68 | # TODO: mpeg2, theora 69 | 70 | -- 71 | 2.0.0 72 | 73 | -------------------------------------------------------------------------------- /patches/ports-android/module-lite/ignore/0003-lite-mode-configure.sh-disable-modules.patch: -------------------------------------------------------------------------------- 1 | From c7951d93030f2240a981ecc357f4cc9bd4f6409e Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 16 Apr 2012 23:20:57 +0800 4 | Subject: [PATCH 3/4] lite-mode: configure.sh: disable modules 5 | 6 | --- 7 | configure.sh | 24 +++++++++++++++--------- 8 | 1 file changed, 15 insertions(+), 9 deletions(-) 9 | 10 | diff --git a/configure.sh b/configure.sh 11 | index 8dae0aa..e534c2f 100755 12 | --- a/configure.sh 13 | +++ b/configure.sh 14 | @@ -48,18 +48,21 @@ STRIP="${CROSS_COMPILE}strip" \ 15 | RANLIB="${CROSS_COMPILE}ranlib" \ 16 | AR="${CROSS_COMPILE}ar" \ 17 | PKG_CONFIG_LIBDIR=$VLC_SOURCEDIR/contrib/$TARGET_TUPLE/lib/pkgconfig \ 18 | -sh $VLC_SOURCEDIR/configure --host=$TARGET_TUPLE --build=x86_64-unknown-linux $EXTRA_PARAMS \ 19 | +MODULE_LITE=1 \ 20 | +sh $VLC_SOURCEDIR/configure --host=${TARGET_TUPLE} --build=x86_64-unknown-linux $EXTRA_PARAMS \ 21 | --disable-nls \ 22 | - --enable-live555 --enable-realrtsp \ 23 | + --disable-live555 --disable-realrtsp \ 24 | --enable-avformat \ 25 | --enable-swscale \ 26 | --enable-avcodec \ 27 | - --enable-opus \ 28 | + --disable-opus \ 29 | --enable-opensles \ 30 | --enable-android-surface \ 31 | - --enable-mkv \ 32 | - --enable-taglib \ 33 | + --enable-debug \ 34 | + --disable-mkv \ 35 | + --disable-taglib \ 36 | --enable-dvbpsi \ 37 | + --disable-freetype \ 38 | --disable-vlc --disable-shared \ 39 | --disable-update-check \ 40 | --disable-vlm \ 41 | @@ -95,10 +98,10 @@ sh $VLC_SOURCEDIR/configure --host=$TARGET_TUPLE --build=x86_64-unknown-linux $E 42 | --disable-skins2 \ 43 | --disable-mtp \ 44 | --disable-notify \ 45 | - --enable-libass \ 46 | + --disable-libass \ 47 | --disable-svg \ 48 | --disable-udev \ 49 | - --enable-libxml2 \ 50 | + --disable-libxml2 \ 51 | --disable-caca \ 52 | --disable-glx \ 53 | --enable-egl \ 54 | @@ -106,8 +109,11 @@ sh $VLC_SOURCEDIR/configure --host=$TARGET_TUPLE --build=x86_64-unknown-linux $E 55 | --disable-goom \ 56 | --disable-projectm \ 57 | --disable-sout \ 58 | - --enable-vorbis \ 59 | - --disable-faad \ 60 | + --disable-vorbis \ 61 | + --enable-faad \ 62 | --disable-x264 \ 63 | + --disable-postproc \ 64 | + --disable-a52 \ 65 | + --disable-libmpeg2 \ 66 | --disable-schroedinger --disable-dirac \ 67 | $* 68 | -- 69 | 1.9.0 70 | 71 | -------------------------------------------------------------------------------- /patches/ports-android/module-lite/ignore/0004-lite-mode-find_modules.sh-blacklist-modules.patch: -------------------------------------------------------------------------------- 1 | From a42903908b81d264aea9daf7f7859bf9f3267cac Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 28 May 2012 12:04:30 +0800 4 | Subject: [PATCH 4/4] lite-mode: find_modules.sh: blacklist modules 5 | 6 | --- 7 | find_modules.sh | 39 ++++++++++++++++++++++++++++++++++++++- 8 | 1 file changed, 38 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/find_modules.sh b/find_modules.sh 11 | index 6e70bb8..0be2ff5 100755 12 | --- a/find_modules.sh 13 | +++ b/find_modules.sh 14 | @@ -52,12 +52,49 @@ magnify 15 | gradient 16 | .*tospdif 17 | dtstofloat32 18 | -logger 19 | visual 20 | fb 21 | +aiff 22 | aout_file 23 | yuv 24 | .dummy 25 | +a52* 26 | +access_(attachment|mms|rar|udp|vrd) 27 | +aout_file 28 | +asf 29 | +avi 30 | +ay 31 | +compressor 32 | +decomp 33 | +dirac 34 | +dts 35 | +flac 36 | +flacsys 37 | +folder 38 | +karaoke 39 | +marq 40 | +libmpeg2 41 | +ogg 42 | +osd_parser 43 | +packetizer_(dirac|flac) 44 | +postproc 45 | +playlist 46 | +rtp 47 | +sdp 48 | +speex 49 | +stream_filter_(dash|rar) 50 | +subtitle 51 | +(cvd|svc|dvd)sub 52 | +subsde 53 | +subsdelay 54 | +tta 55 | +visual 56 | +vobsub 57 | +voc 58 | +wav 59 | +wave 60 | +xml 61 | +zip 62 | " 63 | 64 | regexp= 65 | -- 66 | 1.9.0 67 | 68 | -------------------------------------------------------------------------------- /patches/ports-android/module-lite/ignore/0005-lite-mode-switch-to-ijkplayer-ffmpeg.patch: -------------------------------------------------------------------------------- 1 | From 41bd6d3c55ce1e6fbe469f9db1add946c6fc1f99 Mon Sep 17 00:00:00 2001 2 | From: Ming Hu 3 | Date: Fri, 20 Jun 2014 16:00:34 +0800 4 | Subject: [PATCH] lite-mode: switch to ijkplayer ffmpeg 5 | 6 | --- 7 | compile.sh | 30 +++++++++++++++++++++++++++++- 8 | vlc-android/jni/Android.mk | 2 +- 9 | vlc-android/jni/libvlcjni_danmaku.c | 4 ++-- 10 | 3 files changed, 32 insertions(+), 4 deletions(-) 11 | 12 | diff --git a/compile.sh b/compile.sh 13 | index 3626997..d332827 100755 14 | --- a/compile.sh 15 | +++ b/compile.sh 16 | @@ -37,6 +37,14 @@ if [ -z "$ANDROID_ABI" ]; then 17 | exit 1 18 | fi 19 | 20 | +if [ -z "$IJKPLAYER" ]; then 21 | + IJKPLAYER="../../ijkplayer" 22 | +fi 23 | +if [ ! -d $IJKPLAYER ]; then 24 | + echo "Please set IJKPLAYER to ijkplayer source root and have ffmpeg-$ANDROID_ABI compiled." 25 | + exit 1 26 | +fi 27 | + 28 | # try to detect NDK version 29 | REL=$(grep -o '^r[0-9]*.*' $ANDROID_NDK/RELEASE.TXT 2>/dev/null|cut -b2-) 30 | case "$REL" in 31 | @@ -212,6 +220,25 @@ Cflags:" > contrib/${TARGET_TUPLE}/lib/pkgconfig/`echo $1|tr 'A-Z' 'a-z'`.pc 32 | mkdir -p contrib/${TARGET_TUPLE}/lib/pkgconfig 33 | gen_pc_file EGL 1.1 34 | gen_pc_file GLESv2 2 35 | +if [ ! -z $IJKPLAYER ]; then 36 | + if [ $ANDROID_ABI = "armeabi-v7a" ]; then 37 | + IJKPLAYER_ABI=armv7a 38 | + elif [ $ANDROID_ABI = "armeabi" ]; then 39 | + IJKPLAYER_ABI=armv5 40 | + elif [ $ANDROID_ABI = "x86" ]; then 41 | + IJKPLAYER_ABI=x86 42 | + else 43 | + echo "Unsupported ABI: ${ANDROID_ABI}." 44 | + exit 1 45 | + fi 46 | + IJKFFMPEG=$(cd ../$IJKPLAYER/android/build/ffmpeg-$IJKPLAYER_ABI/output/shared/; pwd) 47 | + # make bootstrap happy 48 | + cp $IJKFFMPEG/lib/pkgconfig/*.pc contrib/$TARGET_TUPLE/lib/pkgconfig 49 | + # make NDK happy 50 | + mkdir -p contrib/${TARGET_TUPLE}/include 51 | + ln -sf $IJKFFMPEG/include/* contrib/$TARGET_TUPLE/include 52 | + ln -sf $IJKFFMPEG/lib/libijkffmpeg.so contrib/$TARGET_TUPLE/lib/libijkffmpeg.so 53 | +fi 54 | 55 | cd contrib/android 56 | ../bootstrap --host=${TARGET_TUPLE} --disable-disc --disable-sout \ 57 | @@ -267,7 +294,8 @@ cd contrib/android 58 | --enable-faad2 \ 59 | --disable-harfbuzz \ 60 | --disable-ssh2 \ 61 | - --disable-iconv 62 | + --disable-iconv \ 63 | + --disable-ffmpeg 64 | 65 | # TODO: mpeg2, theora 66 | 67 | diff --git a/vlc-android/jni/Android.mk b/vlc-android/jni/Android.mk 68 | index a9a12da..81b44cb 100644 69 | --- a/vlc-android/jni/Android.mk 70 | +++ b/vlc-android/jni/Android.mk 71 | @@ -70,7 +70,7 @@ LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \ 72 | -ldl -lz -lm -llog \ 73 | -landroid \ 74 | -ldvbpsi \ 75 | - -lavformat -lavcodec -lswscale -lavutil \ 76 | + -lijkffmpeg \ 77 | -lgnutls -lgcrypt -lgpg-error \ 78 | -lnettle -lhogweed -lgmp \ 79 | -lEGL -lGLESv2 \ 80 | diff --git a/vlc-android/jni/libvlcjni_danmaku.c b/vlc-android/jni/libvlcjni_danmaku.c 81 | index 59a5441..7e577b7 100644 82 | --- a/vlc-android/jni/libvlcjni_danmaku.c 83 | +++ b/vlc-android/jni/libvlcjni_danmaku.c 84 | @@ -34,8 +34,8 @@ 85 | 86 | #include 87 | 88 | -#include "../../vlc/contrib/android/ffmpeg/libavutil/avstring.h" 89 | -#include "../../vlc/contrib/android/ffmpeg/libavutil/log.h" 90 | +#include 91 | +#include 92 | 93 | #include "libvlcjni.h" 94 | #include "aout.h" 95 | -- 96 | 1.8.5.2 (Apple Git-48) 97 | 98 | -------------------------------------------------------------------------------- /patches/ports-android/module-lite/ignore/0006-CXX-switch-to-stlport.patch: -------------------------------------------------------------------------------- 1 | From 4ad841a84a746fc07f539fc1b3f365cb6f4a9b45 Mon Sep 17 00:00:00 2001 2 | From: Ming Hu 3 | Date: Mon, 23 Jun 2014 17:54:29 +0800 4 | Subject: [PATCH] CXX: switch to stlport 5 | 6 | --- 7 | compile.sh | 5 +++-- 8 | vlc-android/jni/Android.mk | 4 ++-- 9 | 2 files changed, 5 insertions(+), 4 deletions(-) 10 | 11 | diff --git a/compile.sh b/compile.sh 12 | index d332827..a3bbee0 100755 13 | --- a/compile.sh 14 | +++ b/compile.sh 15 | @@ -185,8 +185,9 @@ fi 16 | 17 | EXTRA_CFLAGS="${EXTRA_CFLAGS} -O2" 18 | 19 | -EXTRA_CFLAGS="${EXTRA_CFLAGS} -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++${CXXSTL}/include" 20 | -EXTRA_CFLAGS="${EXTRA_CFLAGS} -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++${CXXSTL}/libs/${ANDROID_ABI}/include" 21 | +#EXTRA_CFLAGS="${EXTRA_CFLAGS} -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++${CXXSTL}/include" 22 | +#EXTRA_CFLAGS="${EXTRA_CFLAGS} -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++${CXXSTL}/libs/${ANDROID_ABI}/include" 23 | +EXTRA_CFLAGS="${EXTRA_CFLAGS} -I${ANDROID_NDK}/sources/cxx-stl/stlport/stlport" 24 | 25 | UNAMES=$(uname -s) 26 | MAKEFLAGS= 27 | diff --git a/vlc-android/jni/Android.mk b/vlc-android/jni/Android.mk 28 | index 81b44cb..f2f9273 100644 29 | --- a/vlc-android/jni/Android.mk 30 | +++ b/vlc-android/jni/Android.mk 31 | @@ -50,7 +50,7 @@ endif 32 | 33 | ARCH=$(ANDROID_ABI) 34 | 35 | -CPP_STATIC=$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++$(CXXSTL)/libs/$(ARCH)/libgnustl_static.a 36 | +CPP_STATIC=$(ANDROID_NDK)/sources/cxx-stl/stlport/libs/$(ARCH)/libstlport_shared.so 37 | 38 | LOCAL_CFLAGS := -std=gnu99 39 | ifeq ($(ARCH), armeabi) 40 | @@ -75,7 +75,7 @@ LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \ 41 | -lnettle -lhogweed -lgmp \ 42 | -lEGL -lGLESv2 \ 43 | -lfaad \ 44 | - $(CPP_STATIC) 45 | + -l$(CPP_STATIC) 46 | 47 | include $(BUILD_SHARED_LIBRARY) 48 | 49 | -- 50 | 1.8.5.2 (Apple Git-48) 51 | 52 | -------------------------------------------------------------------------------- /patches/ports-android/module-lite/ignore/1001-lite-mode-Android.mk-enable-faad.patch.ignore: -------------------------------------------------------------------------------- 1 | From 8bde7fd76dbc342c62d485ec0756db3f4017f14e Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Tue, 22 May 2012 14:50:16 +0800 4 | Subject: [PATCH] lite-mode: Android.mk: enable faad 5 | 6 | --- 7 | compile.sh | 1 + 8 | vlc-android/jni/Android.mk | 1 + 9 | 2 个文件被修改,插入 2 行(+) 10 | 11 | diff --git a/compile.sh b/compile.sh 12 | index 5121ade..a7ca8cf 100755 13 | --- a/compile.sh 14 | +++ b/compile.sh 15 | @@ -143,6 +143,7 @@ cd contrib/android 16 | --disable-live555 \ 17 | --disable-schroedinger \ 18 | --disable-matroska \ 19 | + --enable-faad2 \ 20 | --disable-samplerate 21 | 22 | # TODO: mpeg2, theora 23 | diff --git a/vlc-android/jni/Android.mk b/vlc-android/jni/Android.mk 24 | index a15b94c..6730113 100644 25 | --- a/vlc-android/jni/Android.mk 26 | +++ b/vlc-android/jni/Android.mk 27 | @@ -34,6 +34,7 @@ LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \ 28 | -lmpeg2 -ldca -la52 \ 29 | -lavformat -lavcodec -lswscale -lavutil -lpostproc -lopenjpeg \ 30 | -lpng -lgnutls -lgcrypt -lgpg-error \ 31 | + -lfaad \ 32 | $(CPP_STATIC) 33 | 34 | include $(BUILD_SHARED_LIBRARY) 35 | -- 36 | 1.7.10.2 37 | 38 | -------------------------------------------------------------------------------- /patches/ports-android/module-medium/0001-medium-mode-Android.mk-disable-modules.patch: -------------------------------------------------------------------------------- 1 | From f9464db6793d3774c096d73f7075113f253aaad3 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Fri, 23 Mar 2012 17:59:42 +0800 4 | Subject: [PATCH 1/4] medium-mode: Android.mk: disable modules 5 | 6 | --- 7 | vlc-android/jni/Android.mk | 11 ++++------- 8 | 1 个文件被修改,插入 4 行(+),删除 7 行(-) 9 | 10 | diff --git a/vlc-android/jni/Android.mk b/vlc-android/jni/Android.mk 11 | index f9efd9e..d94275a 100644 12 | --- a/vlc-android/jni/Android.mk 13 | +++ b/vlc-android/jni/Android.mk 14 | @@ -31,14 +31,11 @@ LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \ 15 | $(VLC_BUILD_DIR)/src/.libs/libvlccore.a \ 16 | $(VLC_BUILD_DIR)/compat/.libs/libcompat.a \ 17 | -ldl -lz -lm -llog \ 18 | - -ldvbpsi -lebml -lmatroska -ltag \ 19 | - -logg -lFLAC -ltheora \ 20 | - -lmpeg2 -ldca -la52 \ 21 | - -lavformat -lavcodec -lswscale -lavutil -lpostproc -lgsm -lopenjpeg \ 22 | -lliveMedia -lUsageEnvironment -lBasicUsageEnvironment -lgroupsock \ 23 | - -lspeex -lspeexdsp \ 24 | - -lxml2 -lpng -lgnutls -lgcrypt -lgpg-error \ 25 | - -lfreetype -liconv -lass -lfribidi \ 26 | + -ldvbpsi \ 27 | + -lmpeg2 -la52 \ 28 | + -lavformat -lavcodec -lswscale -lavutil -lpostproc \ 29 | + -lxml2 -lgnutls -lgcrypt -lgpg-error \ 30 | $(CPP_STATIC) 31 | 32 | include $(BUILD_SHARED_LIBRARY) 33 | -- 34 | 1.7.10.4 35 | 36 | -------------------------------------------------------------------------------- /patches/ports-android/module-medium/0002-medium-mode-compile.sh-disable-contrib.patch: -------------------------------------------------------------------------------- 1 | From b299af9d2c19810c469f4b47428842e95e6db7a3 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 28 May 2012 11:45:12 +0800 4 | Subject: [PATCH 2/4] medium-mode: compile.sh: disable contrib 5 | 6 | --- 7 | compile.sh | 19 +++++++++++++++++++ 8 | 1 个文件被修改,插入 19 行(+) 9 | 10 | diff --git a/compile.sh b/compile.sh 11 | index 4be7ab0..3d320aa 100755 12 | --- a/compile.sh 13 | +++ b/compile.sh 14 | @@ -115,6 +115,8 @@ if [ -z "${VLC_FAST_COMPILE}" ]; then 15 | --disable-sdl \ 16 | --disable-SDL_image \ 17 | --disable-fontconfig \ 18 | + --disable-ass \ 19 | + --disable-fribidi \ 20 | --disable-zvbi \ 21 | --disable-kate \ 22 | --disable-caca \ 23 | @@ -125,6 +127,23 @@ if [ -z "${VLC_FAST_COMPILE}" ]; then 24 | --disable-tremor \ 25 | --disable-vorbis \ 26 | --disable-sidplay2 \ 27 | + --disable-taglib \ 28 | + --enable-live555 \ 29 | + --disable-schroedinger \ 30 | + --disable-matroska \ 31 | + --disable-goom \ 32 | + --disable-gsm \ 33 | + --disable-speex \ 34 | + --disable-speexdsp \ 35 | + --disable-freetype2 \ 36 | + --disable-lua \ 37 | + --disable-flac \ 38 | + --disable-ogg \ 39 | + --disable-dca \ 40 | + --disable-theora \ 41 | + --disable-modplug \ 42 | + --disable-png \ 43 | + --disable-openjpg \ 44 | --disable-samplerate \ 45 | --disable-faad2 \ 46 | --disable-iconv 47 | -- 48 | 1.7.10.4 49 | 50 | -------------------------------------------------------------------------------- /patches/ports-android/module-medium/0003-medium-mode-configure.sh-disable-modules.patch: -------------------------------------------------------------------------------- 1 | From d628e050f576b3b3b24c9e1e2ce34444446056ff Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 16 Apr 2012 23:20:57 +0800 4 | Subject: [PATCH 3/4] medium-mode: configure.sh: disable modules 5 | 6 | --- 7 | configure.sh | 8 +++++--- 8 | 1 个文件被修改,插入 5 行(+),删除 3 行(-) 9 | 10 | diff --git a/configure.sh b/configure.sh 11 | index 71e39b4..5bb2477 100755 12 | --- a/configure.sh 13 | +++ b/configure.sh 14 | @@ -57,9 +57,11 @@ sh $VLC_SOURCEDIR/configure --host=$TARGET_TUPLE --build=x86_64-unknown-linux $E 15 | --enable-opensles \ 16 | --enable-audiotrack \ 17 | --enable-android-surface \ 18 | - --enable-mkv \ 19 | - --enable-taglib \ 20 | + --disable-mkv \ 21 | + --disable-taglib \ 22 | --enable-dvbpsi \ 23 | + --enable-debug \ 24 | + --disable-freetype \ 25 | --enable-iomx \ 26 | --disable-vlc --disable-shared \ 27 | --disable-vlm \ 28 | @@ -95,7 +97,7 @@ sh $VLC_SOURCEDIR/configure --host=$TARGET_TUPLE --build=x86_64-unknown-linux $E 29 | --disable-skins2 \ 30 | --disable-mtp \ 31 | --disable-notify \ 32 | - --enable-libass \ 33 | + --disable-libass \ 34 | --disable-svg \ 35 | --disable-sqlite \ 36 | --disable-udev \ 37 | -- 38 | 1.7.10.4 39 | 40 | -------------------------------------------------------------------------------- /patches/ports-android/module-medium/0004-medium-mode-find_modules.sh-blacklist-modules.patch: -------------------------------------------------------------------------------- 1 | From c624684ab103e1acdeef90018526b221afff20fe Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 28 May 2012 12:04:30 +0800 4 | Subject: [PATCH 4/4] medium-mode: find_modules.sh: blacklist modules 5 | 6 | --- 7 | find_modules.sh | 35 ++++++++++++++++++++++++++++++++++- 8 | 1 个文件被修改,插入 34 行(+),删除 1 行(-) 9 | 10 | diff --git a/find_modules.sh b/find_modules.sh 11 | index 322033a..c53eb3f 100755 12 | --- a/find_modules.sh 13 | +++ b/find_modules.sh 14 | @@ -51,12 +51,45 @@ magnify 15 | gradient 16 | .*tospdif 17 | dtstofloat32 18 | -logger 19 | visual 20 | fb 21 | +aiff 22 | aout_file 23 | yuv 24 | .dummy 25 | +access_(attachment|mms|rar|udp|vrd) 26 | +aout_file 27 | +avi 28 | +ay 29 | +compressor 30 | +decomp 31 | +dirac 32 | +dts 33 | +flac 34 | +flacsys 35 | +folder 36 | +karaoke 37 | +marq 38 | +ogg 39 | +osd_parser 40 | +packetizer_(dirac|flac) 41 | +playlist 42 | +rtp 43 | +sdp 44 | +speex 45 | +stream_filter_(dash|rar) 46 | +subtitle 47 | +(cvd|svc|dvd)sub 48 | +subsde 49 | +subsdelay 50 | +tta 51 | +visual 52 | +vobsub 53 | +voc 54 | +wav 55 | +wave 56 | +xml 57 | +zip 58 | " 59 | 60 | regexp= 61 | -- 62 | 1.7.10.4 63 | 64 | -------------------------------------------------------------------------------- /patches/ports-android/target-armv5/0001-target-abi-armv5.patch: -------------------------------------------------------------------------------- 1 | From 6a85d14f4b5c0ffc7025680b18c1ec1e100d6af5 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 10 Feb 2014 14:55:48 +0800 4 | Subject: [PATCH] target-abi: armv5 5 | 6 | --- 7 | target-abi.sh | 7 +++++++ 8 | 1 file changed, 7 insertions(+) 9 | create mode 100644 target-abi.sh 10 | 11 | diff --git a/target-abi.sh b/target-abi.sh 12 | new file mode 100644 13 | index 0000000..816339b 14 | --- /dev/null 15 | +++ b/target-abi.sh 16 | @@ -0,0 +1,7 @@ 17 | +#! /bin/sh 18 | + 19 | +# armv5 20 | +export ANDROID_ABI=armeabi 21 | +export NO_NEON=1 22 | +export NO_FPU=1 23 | +export NO_ARMV6=1 24 | -- 25 | 1.8.3.4 26 | 27 | -------------------------------------------------------------------------------- /patches/ports-android/target-armv6-vfp/0001-target-abi-armv6-vfp.patch: -------------------------------------------------------------------------------- 1 | From cfcacba211464f3109218c9d42656c024ed5ff08 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 10 Feb 2014 14:55:48 +0800 4 | Subject: [PATCH] target-abi: armv6-vfp 5 | 6 | --- 7 | target-abi.sh | 5 +++++ 8 | 1 file changed, 5 insertions(+) 9 | create mode 100644 target-abi.sh 10 | 11 | diff --git a/target-abi.sh b/target-abi.sh 12 | new file mode 100644 13 | index 0000000..16cf981 14 | --- /dev/null 15 | +++ b/target-abi.sh 16 | @@ -0,0 +1,5 @@ 17 | +#! /bin/sh 18 | + 19 | +# armv6-vfp 20 | +export ANDROID_ABI=armeabi 21 | +export NO_NEON=1 22 | -- 23 | 1.8.3.4 24 | 25 | -------------------------------------------------------------------------------- /patches/ports-android/target-armv6/0001-target-abi-armv6.patch: -------------------------------------------------------------------------------- 1 | From a40e8a5d147c1b2043b4ef84fba3d1e3cf82afa1 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 10 Feb 2014 14:55:48 +0800 4 | Subject: [PATCH] target-abi: armv6 5 | 6 | --- 7 | target-abi.sh | 6 ++++++ 8 | 1 file changed, 6 insertions(+) 9 | create mode 100644 target-abi.sh 10 | 11 | diff --git a/target-abi.sh b/target-abi.sh 12 | new file mode 100644 13 | index 0000000..3761c1b 14 | --- /dev/null 15 | +++ b/target-abi.sh 16 | @@ -0,0 +1,6 @@ 17 | +#! /bin/sh 18 | + 19 | +# armv6 20 | +export ANDROID_ABI=armeabi 21 | +export NO_NEON=1 22 | +export NO_FPU=1 23 | -- 24 | 1.8.3.4 25 | 26 | -------------------------------------------------------------------------------- /patches/ports-android/target-armv7a/0001-target-abi-armeabi-v7a.patch: -------------------------------------------------------------------------------- 1 | From bd339c60f494cb001d3a490a514e5ff14e996164 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 10 Feb 2014 14:55:48 +0800 4 | Subject: [PATCH] target-abi: armv7a 5 | 6 | --- 7 | target-abi.sh | 4 ++++ 8 | 1 file changed, 4 insertions(+) 9 | create mode 100644 target-abi.sh 10 | 11 | diff --git a/target-abi.sh b/target-abi.sh 12 | new file mode 100644 13 | index 0000000..a498485 14 | --- /dev/null 15 | +++ b/target-abi.sh 16 | @@ -0,0 +1,4 @@ 17 | +#! /bin/sh 18 | + 19 | +# armv7a 20 | +export ANDROID_ABI=armeabi-v7a 21 | -- 22 | 1.8.3.4 23 | 24 | -------------------------------------------------------------------------------- /patches/ports-android/target-x86/0001-target-abi-x86.patch: -------------------------------------------------------------------------------- 1 | From 147d515fb6afa693acf4e5162e28a41e24464a18 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 10 Feb 2014 14:55:48 +0800 4 | Subject: [PATCH] target-abi: x86 5 | 6 | --- 7 | target-abi.sh | 4 ++++ 8 | 1 file changed, 4 insertions(+) 9 | create mode 100644 target-abi.sh 10 | 11 | diff --git a/target-abi.sh b/target-abi.sh 12 | new file mode 100644 13 | index 0000000..3eda8b0 14 | --- /dev/null 15 | +++ b/target-abi.sh 16 | @@ -0,0 +1,4 @@ 17 | +#! /bin/sh 18 | + 19 | +# x86 20 | +export ANDROID_ABI=x86 21 | -- 22 | 1.8.3.4 23 | 24 | -------------------------------------------------------------------------------- /patches/vlc-app/0001-zlib-fix-zlib-build-on-android.patch: -------------------------------------------------------------------------------- 1 | From fd7e23e075f49ee1595796cf4dc025e760331a7b Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Thu, 17 May 2012 16:37:14 +0800 4 | Subject: [PATCH 1/2] zlib: fix zlib build on android 5 | 6 | --- 7 | contrib/src/zlib/rules.mak | 1 + 8 | contrib/src/zlib/zlib-android.patch | 12 ++++++++++++ 9 | 2 个文件被修改,插入 13 行(+) 10 | create mode 100644 contrib/src/zlib/zlib-android.patch 11 | 12 | diff --git a/contrib/src/zlib/rules.mak b/contrib/src/zlib/rules.mak 13 | index 4e07918..d7edb3a 100644 14 | --- a/contrib/src/zlib/rules.mak 15 | +++ b/contrib/src/zlib/rules.mak 16 | @@ -15,6 +15,7 @@ $(TARBALLS)/zlib-$(ZLIB_VERSION).tar.gz: 17 | zlib: zlib-$(ZLIB_VERSION).tar.gz .sum-zlib 18 | $(UNPACK) 19 | $(APPLY) $(SRC)/zlib/zlib-wince.patch 20 | + $(APPLY) $(SRC)/zlib/zlib-android.patch 21 | $(MOVE) 22 | 23 | .zlib: zlib 24 | diff --git a/contrib/src/zlib/zlib-android.patch b/contrib/src/zlib/zlib-android.patch 25 | new file mode 100644 26 | index 0000000..959b082 27 | --- /dev/null 28 | +++ b/contrib/src/zlib/zlib-android.patch 29 | @@ -0,0 +1,12 @@ 30 | +--- zlib-1.2.7/configure.orig 2012-12-23 17:56:47.000000000 +0800 31 | ++++ zlib-1.2.7/configure 2012-12-23 17:57:02.000000000 +0800 32 | +@@ -231,8 +231,7 @@ 33 | + SHAREDLIBV=libz.$VER$shared_ext 34 | + SHAREDLIBM=libz.$VER1$shared_ext 35 | + LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"} 36 | +- AR="/usr/bin/libtool" 37 | +- ARFLAGS="-o" ;; 38 | ++ ;; 39 | + *) LDSHARED=${LDSHARED-"$cc -shared"} ;; 40 | + esac 41 | + else 42 | -- 43 | 1.7.10.4 44 | 45 | -------------------------------------------------------------------------------- /patches/vlc-app/0002-fix-toolchain-config.patch: -------------------------------------------------------------------------------- 1 | From c9976db1bdba9b91acd95cb4f0b8825cb1f4e8be Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 5 Mar 2012 18:21:02 +0800 4 | Subject: [PATCH] fix toolchain config 5 | 6 | --- 7 | contrib/src/main.mak | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/contrib/src/main.mak b/contrib/src/main.mak 11 | index 69465e6..811ad19 100644 12 | --- a/contrib/src/main.mak 13 | +++ b/contrib/src/main.mak 14 | @@ -397,6 +397,7 @@ ifdef HAVE_CROSS_COMPILE 15 | endif 16 | echo "set(CMAKE_C_COMPILER $(CC))" >> $@ 17 | echo "set(CMAKE_CXX_COMPILER $(CXX))" >> $@ 18 | + echo "set(_CMAKE_TOOLCHAIN_PREFIX $(ANDROID_NDK)/toolchains/arm-linux-androideabi-4.7/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-)" >> $@ 19 | echo "set(CMAKE_FIND_ROOT_PATH $(PREFIX))" >> $@ 20 | echo "set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)" >> $@ 21 | echo "set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)" >> $@ 22 | -- 23 | 1.8.2.1 24 | 25 | -------------------------------------------------------------------------------- /patches/vlc-on-macosx/ignore/0002-fix-toolchain-config.patch: -------------------------------------------------------------------------------- 1 | From 7bde38d1618c9c2776c6b1104523afac82ba5b81 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Mon, 5 Mar 2012 18:21:02 +0800 4 | Subject: [PATCH 2/7] fix toolchain config 5 | 6 | --- 7 | contrib/src/main.mak | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/contrib/src/main.mak b/contrib/src/main.mak 11 | index 9ac80d2..7707523 100644 12 | --- a/contrib/src/main.mak 13 | +++ b/contrib/src/main.mak 14 | @@ -417,6 +417,7 @@ ifdef HAVE_DARWIN_OS 15 | endif 16 | echo "set(CMAKE_C_COMPILER $(CC))" >> $@ 17 | echo "set(CMAKE_CXX_COMPILER $(CXX))" >> $@ 18 | + echo "set(_CMAKE_TOOLCHAIN_PREFIX $(ANDROID_NDK)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-)" >> $@ 19 | echo "set(CMAKE_FIND_ROOT_PATH $(PREFIX))" >> $@ 20 | echo "set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)" >> $@ 21 | echo "set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)" >> $@ 22 | -- 23 | 1.7.9.4 24 | 25 | -------------------------------------------------------------------------------- /patches/vlc/0001-.gitignore.patch: -------------------------------------------------------------------------------- 1 | From e5fa94c4376370f9bf9bfde2d1ae9e21f3c89f21 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Tue, 22 Oct 2013 15:55:01 +0800 4 | Subject: [PATCH 01/42] .gitignore 5 | 6 | --- 7 | .gitignore | 5 +++++ 8 | 1 file changed, 5 insertions(+) 9 | 10 | diff --git a/.gitignore b/.gitignore 11 | index a9d0c62..2ca29c4 100644 12 | --- a/.gitignore 13 | +++ b/.gitignore 14 | @@ -52,3 +52,8 @@ build-* 15 | contrib-* 16 | install-* 17 | 18 | +# custom 19 | +contrib/android 20 | +pt 21 | +intl 22 | +android 23 | -- 24 | 1.9.0 25 | 26 | -------------------------------------------------------------------------------- /patches/vlc/0003-configure.ac-fix-build-of-faad.patch: -------------------------------------------------------------------------------- 1 | From 3b42a0d6a21e1c9c29845629de4d976b5d69d26b Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Tue, 22 Oct 2013 21:54:18 +0800 4 | Subject: [PATCH 03/42] configure.ac: fix build of faad 5 | 6 | --- 7 | configure.ac | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/configure.ac b/configure.ac 11 | index c0c7a03..3d1b67a 100644 12 | --- a/configure.ac 13 | +++ b/configure.ac 14 | @@ -675,7 +675,7 @@ AC_CHECK_FUNC(getopt_long,, [ 15 | AC_SUBST(GNUGETOPT_LIBS) 16 | 17 | AC_CHECK_LIB(m,cos,[ 18 | - VLC_ADD_LIBS([adjust wave ripple psychedelic gradient a52tofloat32 dtstofloat32 x264 goom noise grain scene chorus_flanger freetype swscale postproc equalizer spatializer param_eq samplerate freetype mpc qt4 compressor headphone_channel_mixer normvol audiobargraph_a audiobargraph_v mono colorthres extract ball hotkeys mosaic gaussianblur x262 x26410b hqdn3d anaglyph oldrc ncurses oldmovie glspectrum],[-lm]) 19 | + VLC_ADD_LIBS([adjust wave ripple psychedelic gradient a52tofloat32 dtstofloat32 x264 goom noise grain scene chorus_flanger freetype swscale postproc faad equalizer spatializer param_eq samplerate freetype mpc qt4 compressor headphone_channel_mixer normvol audiobargraph_a audiobargraph_v mono colorthres extract ball hotkeys mosaic gaussianblur x262 x26410b hqdn3d anaglyph oldrc ncurses oldmovie glspectrum],[-lm]) 20 | LIBM="-lm" 21 | ], [ 22 | LIBM="" 23 | -- 24 | 1.9.0 25 | 26 | -------------------------------------------------------------------------------- /patches/vlc/0004-main.mak-add-CHOST-for-cross-compile.patch: -------------------------------------------------------------------------------- 1 | From 29bcf918662538d29bf6daac1c36b295ca86239d Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Sat, 11 Aug 2012 13:07:07 +0800 4 | Subject: [PATCH 04/42] main.mak: add CHOST for cross-compile 5 | 6 | --- 7 | contrib/src/main.mak | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/contrib/src/main.mak b/contrib/src/main.mak 11 | index 45ba470..5cd8e03 100644 12 | --- a/contrib/src/main.mak 13 | +++ b/contrib/src/main.mak 14 | @@ -269,6 +269,7 @@ endif 15 | HOSTTOOLS := \ 16 | CC="$(CC)" CXX="$(CXX)" LD="$(LD)" \ 17 | AR="$(AR)" CCAS="$(CCAS)" RANLIB="$(RANLIB)" STRIP="$(STRIP)" \ 18 | + CHOST="$(CHOST)" \ 19 | PATH="$(PREFIX)/bin:$(PATH)" 20 | HOSTVARS := $(HOSTTOOLS) \ 21 | CPPFLAGS="$(CPPFLAGS)" \ 22 | -- 23 | 1.9.0 24 | 25 | -------------------------------------------------------------------------------- /patches/vlc/0005-core-tcp-recalculate-timeout-for-EINTR.patch: -------------------------------------------------------------------------------- 1 | From f64b0f1ea61eefc5b8d17adf4038e19c43d789d3 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Sat, 28 Jul 2012 11:20:15 +0800 4 | Subject: [PATCH 05/42] core: tcp: recalculate timeout for EINTR 5 | 6 | --- 7 | src/network/tcp.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++---- 8 | 1 file changed, 48 insertions(+), 4 deletions(-) 9 | 10 | diff --git a/src/network/tcp.c b/src/network/tcp.c 11 | index 083861d..95ae279 100644 12 | --- a/src/network/tcp.c 13 | +++ b/src/network/tcp.c 14 | @@ -149,6 +149,7 @@ int net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port, 15 | if (timeout < 0) 16 | timeout = -1; 17 | 18 | + msg_Dbg( p_this, "net: ipv4-timeout %d", timeout ); 19 | for (struct addrinfo *ptr = res; ptr != NULL; ptr = ptr->ai_next) 20 | { 21 | int fd = net_Socket( p_this, ptr->ai_family, 22 | @@ -175,10 +176,53 @@ int net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port, 23 | { .fd = evfd, .events = POLLIN }, 24 | }; 25 | 26 | - do 27 | - /* NOTE: timeout screwed up if we catch a signal (EINTR) */ 28 | - val = poll (ufd, sizeof (ufd) / sizeof (ufd[0]), timeout); 29 | - while ((val == -1) && (net_errno == EINTR)); 30 | + if( timeout <= 0 ) 31 | + { 32 | + do 33 | + val = poll (ufd, sizeof (ufd) / sizeof (ufd[0]), timeout); 34 | + while ((val == -1) && (net_errno == EINTR)); 35 | + } 36 | + else 37 | + { 38 | + struct timeval tv_deadline; 39 | + gettimeofday( &tv_deadline, 0 ); 40 | + 41 | + tv_deadline.tv_sec += ( ( timeout ) / 1000 ); 42 | + tv_deadline.tv_usec += ( ( timeout % 1000 ) * 1000 ); 43 | + if( tv_deadline.tv_usec >= 1000000 ) 44 | + { 45 | + tv_deadline.tv_usec -= 1000000; 46 | + tv_deadline.tv_sec += 1; 47 | + } 48 | + 49 | + int i_wait = timeout; 50 | + while( true ) 51 | + { 52 | + val = poll( ufd, sizeof( ufd ) / sizeof( ufd[0] ), i_wait ); 53 | + if( val >= 0 ) 54 | + break; 55 | + else if( net_errno != EINTR ) 56 | + break; 57 | + 58 | + /* recalculate timeout */ 59 | + struct timeval tv_end; 60 | + gettimeofday( &tv_end, 0 ); 61 | + 62 | + struct timeval tv_wait; 63 | + tv_wait.tv_sec = tv_deadline.tv_sec - tv_end.tv_sec; 64 | + tv_wait.tv_usec = tv_deadline.tv_usec - tv_end.tv_usec; 65 | + 66 | + /* no need to normalize tv_wait */ 67 | + i_wait = tv_wait.tv_sec * 1000 + ( tv_wait.tv_usec + 999 ) / 1000; 68 | + if( i_wait <= 0 ) 69 | + { 70 | + /* continue poll */ 71 | + msg_Err( p_this, "timed out with EINTR" ); 72 | + val = 0; 73 | + break; 74 | + } 75 | + } 76 | + } 77 | 78 | switch (val) 79 | { 80 | -- 81 | 1.9.0 82 | 83 | -------------------------------------------------------------------------------- /patches/vlc/0008-core-vlc_stream-define-new-control-code.patch: -------------------------------------------------------------------------------- 1 | From 79c3d39b828e3400af90f9416abce826822fb6bf Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Thu, 21 Jun 2012 15:35:02 +0800 4 | Subject: [PATCH 08/42] core: vlc_stream: define new control code 5 | 6 | --- 7 | include/vlc_stream.h | 6 ++++++ 8 | 1 file changed, 6 insertions(+) 9 | 10 | diff --git a/include/vlc_stream.h b/include/vlc_stream.h 11 | index 10a98ef..bd9d0fe 100644 12 | --- a/include/vlc_stream.h 13 | +++ b/include/vlc_stream.h 14 | @@ -122,6 +122,12 @@ enum stream_query_e 15 | STREAM_SET_PRIVATE_ID_STATE = 0x1000, /* arg1= int i_private_data, bool b_selected res=can fail */ 16 | STREAM_SET_PRIVATE_ID_CA, /* arg1= int i_program_number, uint16_t i_vpid, uint16_t i_apid1, uint16_t i_apid2, uint16_t i_apid3, uint8_t i_length, uint8_t *p_data */ 17 | STREAM_GET_PRIVATE_ID_STATE, /* arg1=int i_private_data arg2=bool * res=can fail */ 18 | + 19 | + /* */ 20 | + STREAM_GET_CACHED_SIZE, /**< arg1= uint64_t * res=can fail (0 if no sense)*/ 21 | + 22 | + /* for clock gap in youku httplive/mpeg2ts */ 23 | + STREAM_HTTPLIVE_GET_SEGMENT_START, 24 | }; 25 | 26 | VLC_API int stream_Read( stream_t *s, void *p_read, int i_read ); 27 | -- 28 | 1.9.0 29 | 30 | -------------------------------------------------------------------------------- /patches/vlc/0009-core-vlc_array-support-vlc_array_set.patch: -------------------------------------------------------------------------------- 1 | From d131c8ca3373f67b3a573c48f93d549bb04ccf54 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Tue, 19 Jun 2012 17:04:09 +0800 4 | Subject: [PATCH 09/42] core: vlc_array: support vlc_array_set 5 | 6 | --- 7 | include/vlc_arrays.h | 6 ++++++ 8 | 1 file changed, 6 insertions(+) 9 | 10 | diff --git a/include/vlc_arrays.h b/include/vlc_arrays.h 11 | index 91f5405..6a8e24a 100644 12 | --- a/include/vlc_arrays.h 13 | +++ b/include/vlc_arrays.h 14 | @@ -366,6 +366,12 @@ vlc_array_remove( vlc_array_t * p_array, int i_index ) 15 | } 16 | } 17 | 18 | +static inline void 19 | +vlc_array_set( vlc_array_t * p_array, void * p_elem, int i_index ) 20 | +{ 21 | + p_array->pp_elems[i_index] = p_elem; 22 | +} 23 | + 24 | 25 | /************************************************************************ 26 | * Dictionaries 27 | -- 28 | 1.9.0 29 | 30 | -------------------------------------------------------------------------------- /patches/vlc/0010-core-src-add-es_out_managed.patch: -------------------------------------------------------------------------------- 1 | From 697405e37ce12906c6ad0b013366a7cccc9bc487 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Thu, 21 Jun 2012 15:44:39 +0800 4 | Subject: [PATCH 10/42] core: src: add es_out_managed 5 | 6 | --- 7 | src/Makefile.am | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/src/Makefile.am b/src/Makefile.am 11 | index 842fc73..14567d5 100644 12 | --- a/src/Makefile.am 13 | +++ b/src/Makefile.am 14 | @@ -45,6 +45,7 @@ pluginsinclude_HEADERS = \ 15 | ../include/vlc_epg.h \ 16 | ../include/vlc_es.h \ 17 | ../include/vlc_es_out.h \ 18 | + ../include/vlc_es_out_managed.h \ 19 | ../include/vlc_events.h \ 20 | ../include/vlc_filter.h \ 21 | ../include/vlc_fourcc.h \ 22 | @@ -363,6 +364,7 @@ SOURCES_libvlc_common = \ 23 | input/demux.c \ 24 | input/es_out.c \ 25 | input/es_out_timeshift.c \ 26 | + input/es_out_managed.c \ 27 | input/event.c \ 28 | input/input.c \ 29 | input/info.h \ 30 | -- 31 | 1.9.0 32 | 33 | -------------------------------------------------------------------------------- /patches/vlc/0013-plugin-stream_filter-add-ringbuf-membuf.patch: -------------------------------------------------------------------------------- 1 | From 6cf08a253710eae0d3697d6e435b37f3c441ff4f Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Tue, 22 Oct 2013 14:36:09 +0800 4 | Subject: [PATCH 13/42] plugin: stream_filter: add ringbuf, membuf 5 | 6 | --- 7 | modules/stream_filter/Makefile.am | 12 ++++++++++++ 8 | 1 file changed, 12 insertions(+) 9 | 10 | diff --git a/modules/stream_filter/Makefile.am b/modules/stream_filter/Makefile.am 11 | index fc712b5..ef27fce 100644 12 | --- a/modules/stream_filter/Makefile.am 13 | +++ b/modules/stream_filter/Makefile.am 14 | @@ -113,5 +113,17 @@ if HAVE_GCRYPT 15 | stream_filter_LTLIBRARIES += libhttplive_plugin.la 16 | endif 17 | 18 | +libstream_filter_ringbuf_plugin_la_SOURCES = stream_filter/ringbuf.c 19 | +libstream_filter_ringbuf_plugin_la_CFLAGS = $(AM_CFLAGS) 20 | +libstream_filter_ringbuf_plugin_la_LIBADD = $(AM_LIBADD) 21 | +libstream_filter_ringbuf_plugin_la_DEPENDENCIES = 22 | +stream_filter_LTLIBRARIES += libstream_filter_ringbuf_plugin.la 23 | + 24 | +libstream_filter_membuf_plugin_la_SOURCES = stream_filter/membuf.c 25 | +libstream_filter_membuf_plugin_la_CFLAGS = $(AM_CFLAGS) 26 | +libstream_filter_membuf_plugin_la_LIBADD = $(AM_LIBADD) 27 | +libstream_filter_membuf_plugin_la_DEPENDENCIES = 28 | +stream_filter_LTLIBRARIES += libstream_filter_membuf_plugin.la 29 | + 30 | librecord_plugin_la_SOURCES = stream_filter/record.c 31 | stream_filter_LTLIBRARIES += librecord_plugin.la 32 | -- 33 | 1.9.0 34 | 35 | -------------------------------------------------------------------------------- /patches/vlc/0015-http-add-http-option-to-disable-range-header.patch: -------------------------------------------------------------------------------- 1 | From 78f92869f633ba9b9407544b9eb8cf7a8c91ecc0 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Thu, 19 Apr 2012 20:51:53 +0800 4 | Subject: [PATCH 15/42] http: add http option to disable range header 5 | 6 | --- 7 | modules/access/http.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 8 | 1 file changed, 47 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/modules/access/http.c b/modules/access/http.c 11 | index 3908fb7..0cbf6f4 100644 12 | --- a/modules/access/http.c 13 | +++ b/modules/access/http.c 14 | @@ -94,6 +94,10 @@ static void Close( vlc_object_t * ); 15 | "slash, e.g. FooBar/1.2.3. This option can only be specified per input " \ 16 | "item, not globally.") 17 | 18 | +#define HOSTS_REJECT_RANGE N_("Exclude hosts from range header detection") 19 | +#define HOSTS_REJECT_RANGE_LONGTEXT N_(\ 20 | + "You can disable 'range' header detection which are certern to be rejected. ") 21 | + 22 | vlc_module_begin () 23 | set_description( N_("HTTP input") ) 24 | set_capability( "access", 0 ) 25 | @@ -118,6 +122,12 @@ vlc_module_begin () 26 | change_safe() 27 | add_bool( "http-forward-cookies", true, FORWARD_COOKIES_TEXT, 28 | FORWARD_COOKIES_LONGTEXT, true ) 29 | + 30 | + add_string( "http-hosts-reject-range", NULL, 31 | + HOSTS_REJECT_RANGE, 32 | + HOSTS_REJECT_RANGE_LONGTEXT, 33 | + false ) 34 | + 35 | /* 'itpc' = iTunes Podcast */ 36 | add_shortcut( "http", "https", "unsv", "itpc", "icyx" ) 37 | set_callbacks( Open, Close ) 38 | @@ -141,6 +151,8 @@ struct access_sys_t 39 | char *psz_referrer; 40 | http_auth_t auth; 41 | 42 | + char *psz_hosts_reject_range; 43 | + 44 | /* Proxy */ 45 | bool b_proxy; 46 | vlc_url_t proxy; 47 | @@ -355,6 +367,13 @@ static int OpenWithCookies( vlc_object_t *p_this, const char *psz_access, 48 | } 49 | } 50 | 51 | + p_sys->psz_hosts_reject_range = var_InheritString( p_access, "http-hosts-reject-range" ); 52 | + if( p_sys->psz_hosts_reject_range ) 53 | + { 54 | + msg_Dbg( p_access, "http-hosts-reject-range" ); 55 | + msg_Dbg( p_access, p_sys->psz_hosts_reject_range ); 56 | + } 57 | + 58 | /* HTTP referrer */ 59 | p_sys->psz_referrer = var_InheritString( p_access, "http-referrer" ); 60 | 61 | @@ -1184,8 +1203,34 @@ static int Request( access_t *p_access, uint64_t i_tell ) 62 | if( p_sys->i_version == 1 && ! p_sys->b_continuous ) 63 | { 64 | p_sys->b_persist = true; 65 | - net_Printf( p_access, p_sys->fd, pvs, 66 | - "Range: bytes=%"PRIu64"-\r\n", i_tell ); 67 | + 68 | + if ( p_sys->url.psz_host && *p_sys->url.psz_host ) { 69 | + bool b_reject_range = false; 70 | + if( p_sys->psz_hosts_reject_range && *p_sys->psz_hosts_reject_range ) 71 | + { 72 | + int i_host_len = strlen( p_sys->url.psz_host ); 73 | + 74 | + const char* p_host = p_sys->psz_hosts_reject_range; 75 | + while ( p_host && *p_host ) { 76 | + if ( !strncasecmp(p_host, p_sys->url.psz_host, i_host_len )) { 77 | + b_reject_range = true; 78 | + break; 79 | + } 80 | + 81 | + p_host = strstr( p_host, "," ); 82 | + if ( p_host ) 83 | + p_host++; 84 | + } 85 | + } 86 | + 87 | + if (b_reject_range) { 88 | + msg_Dbg( p_access, "disable range header detection" ); 89 | + } else { 90 | + msg_Dbg( p_access, "Range: bytes=%"PRIu64"-\r\n", i_tell ); 91 | + net_Printf( p_access, p_sys->fd, pvs, 92 | + "Range: bytes=%"PRIu64"-\r\n", i_tell ); 93 | + } 94 | + } 95 | net_Printf( p_access, p_sys->fd, pvs, "Connection: close\r\n" ); 96 | } 97 | 98 | -- 99 | 1.9.0 100 | 101 | -------------------------------------------------------------------------------- /patches/vlc/0016-httplive-peek-more-bytes-to-detect-m3u8.patch: -------------------------------------------------------------------------------- 1 | From 3ef16c53f1b2ee2c986a7df4094f4456d1cf2235 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Wed, 11 Jul 2012 14:50:38 +0800 4 | Subject: [PATCH 16/42] httplive: peek more bytes to detect m3u8 5 | 6 | --- 7 | modules/stream_filter/httplive.c | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c 11 | index fa745af..b2dc1e9 100644 12 | --- a/modules/stream_filter/httplive.c 13 | +++ b/modules/stream_filter/httplive.c 14 | @@ -181,7 +181,7 @@ static bool isHTTPLiveStreaming(stream_t *s) 15 | { 16 | const uint8_t *peek; 17 | 18 | - int size = stream_Peek(s->p_source, &peek, 46); 19 | + int size = stream_Peek(s->p_source, &peek, 100); 20 | if (size < 7) 21 | return false; 22 | 23 | -- 24 | 1.9.0 25 | 26 | -------------------------------------------------------------------------------- /patches/vlc/0020-httplive-retry-segment-if-failed.patch: -------------------------------------------------------------------------------- 1 | From 750ef17ec612ebd322b4bfab61deeb5d91ccbf8a Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Sun, 29 Jul 2012 16:44:03 +0800 4 | Subject: [PATCH 20/42] httplive: retry segment if failed 5 | 6 | --- 7 | modules/stream_filter/httplive.c | 9 ++++++++- 8 | 1 file changed, 8 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c 11 | index 8fad2f3..2709484 100644 12 | --- a/modules/stream_filter/httplive.c 13 | +++ b/modules/stream_filter/httplive.c 14 | @@ -1852,7 +1852,14 @@ static int hls_Download(stream_t *s, segment_t *segment) 15 | vlc_cond_wait(&p_sys->wait, &p_sys->lock); 16 | vlc_mutex_unlock(&p_sys->lock); 17 | 18 | - stream_t *p_ts = stream_UrlNew(s, segment->url); 19 | + stream_t *p_ts = NULL; 20 | + for( int i = 0; i < 3; ++i ) 21 | + { 22 | + /* retry or may stalling */ 23 | + p_ts = stream_UrlNew(s, segment->url); 24 | + if( p_ts ) 25 | + break; 26 | + } 27 | if (p_ts == NULL) 28 | return VLC_EGENERIC; 29 | 30 | -- 31 | 1.9.0 32 | 33 | -------------------------------------------------------------------------------- /patches/vlc/0021-avcodec-fix-broken-picture.patch: -------------------------------------------------------------------------------- 1 | From 3bc21a87a0ce56b277c90bbc44214540d4998e15 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Sat, 16 Jun 2012 15:02:07 +0800 4 | Subject: [PATCH 21/42] avcodec: fix broken picture 5 | 6 | --- 7 | modules/codec/avcodec/video.c | 7 ++++++- 8 | 1 file changed, 6 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c 11 | index 022dee1..0084dfc 100644 12 | --- a/modules/codec/avcodec/video.c 13 | +++ b/modules/codec/avcodec/video.c 14 | @@ -468,10 +468,12 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block ) 15 | 16 | p_sys->i_late_frames = 0; 17 | 18 | +#if 0 19 | post_mt( p_sys ); 20 | if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY ) 21 | avcodec_flush_buffers( p_context ); 22 | wait_mt( p_sys ); 23 | +#endif 24 | 25 | block_Release( p_block ); 26 | return NULL; 27 | @@ -487,10 +489,12 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block ) 28 | } 29 | 30 | if( !p_dec->b_pace_control && (p_sys->i_late_frames > 0) && 31 | - (mdate() - p_sys->i_late_frames_start > INT64_C(5000000)) ) 32 | + (mdate() - p_sys->i_late_frames_start > INT64_C(50000000)) ) 33 | { 34 | if( p_sys->i_pts > VLC_TS_INVALID ) 35 | { 36 | + msg_Err( p_dec, "more than 50 seconds of late video -> " 37 | + "dropping frame (computer too slow ?)" ); 38 | p_sys->i_pts = VLC_TS_INVALID; /* To make sure we recover properly */ 39 | } 40 | if( p_block ) 41 | @@ -543,6 +547,7 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block ) 42 | { 43 | /* It creates broken picture 44 | * FIXME either our parser or ffmpeg is broken */ 45 | + b_drawpicture = true; 46 | #if 0 47 | if( p_sys->b_hurry_up ) 48 | p_context->skip_frame = __MAX( p_context->skip_frame, 49 | -- 50 | 1.9.0 51 | 52 | -------------------------------------------------------------------------------- /patches/vlc/0023-omxil-echo-OMX-name.patch: -------------------------------------------------------------------------------- 1 | From b86966445f0768d7dd31dc5e5339c8aa11c4b07b Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Sun, 22 Jul 2012 18:21:32 +0800 4 | Subject: [PATCH 23/42] omxil: echo OMX name 5 | 6 | --- 7 | modules/codec/omxil/omxil.c | 5 +++++ 8 | 1 file changed, 5 insertions(+) 9 | 10 | diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c 11 | index baff733..67d6d6a 100644 12 | --- a/modules/codec/omxil/omxil.c 13 | +++ b/modules/codec/omxil/omxil.c 14 | @@ -1173,6 +1173,11 @@ static int OpenGeneric( vlc_object_t *p_this, bool b_encode ) 15 | if (!p_sys->b_use_pts) 16 | msg_Dbg( p_dec, "using dts timestamp mode for %s", p_sys->psz_component); 17 | 18 | + if( p_dec->fmt_in.i_cat != VIDEO_ES ) 19 | + var_SetString( p_dec, "module-audio-decoder-impl", p_sys->psz_component ); 20 | + else 21 | + var_SetString( p_dec, "module-video-decoder-impl", p_sys->psz_component ); 22 | + 23 | return VLC_SUCCESS; 24 | 25 | error: 26 | -- 27 | 1.9.0 28 | 29 | -------------------------------------------------------------------------------- /patches/vlc/0025-omxil-disable-audio-codec.patch: -------------------------------------------------------------------------------- 1 | From 1214139fc39e49c686bdaa202a030420dd7fdc16 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Wed, 4 Jul 2012 18:28:44 +0800 4 | Subject: [PATCH 25/42] omxil: disable audio codec 5 | 6 | --- 7 | modules/codec/omxil/omxil.c | 3 +++ 8 | 1 file changed, 3 insertions(+) 9 | 10 | diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c 11 | index 3943ac0..5a28fbd 100644 12 | --- a/modules/codec/omxil/omxil.c 13 | +++ b/modules/codec/omxil/omxil.c 14 | @@ -989,6 +989,9 @@ static int OpenDecoder( vlc_object_t *p_this ) 15 | if( 0 || !GetOmxRole(p_dec->fmt_in.i_codec, p_dec->fmt_in.i_cat, false) ) 16 | return VLC_EGENERIC; 17 | 18 | + if( p_dec->fmt_in.i_cat != VIDEO_ES ) 19 | + return VLC_EGENERIC; 20 | + 21 | status = OpenGeneric( p_this, false ); 22 | if(status != VLC_SUCCESS) return status; 23 | 24 | -- 25 | 1.9.0 26 | 27 | -------------------------------------------------------------------------------- /patches/vlc/0026-omxil-disable-debug-info.patch: -------------------------------------------------------------------------------- 1 | From f1cf4254f62095cc0e0b0a7fcca87d4232f30678 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Sun, 22 Jul 2012 18:43:17 +0800 4 | Subject: [PATCH 26/42] omxil: disable debug info 5 | 6 | --- 7 | modules/codec/omxil/omxil.c | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c 11 | index 5a28fbd..d636d46 100644 12 | --- a/modules/codec/omxil/omxil.c 13 | +++ b/modules/codec/omxil/omxil.c 14 | @@ -42,7 +42,7 @@ 15 | #include "OMX_Broadcom.h" 16 | 17 | #ifndef NDEBUG 18 | -# define OMXIL_EXTRA_DEBUG 19 | +//# define OMXIL_EXTRA_DEBUG 20 | #endif 21 | 22 | #define SENTINEL_FLAG 0x10000 23 | -- 24 | 1.9.0 25 | 26 | -------------------------------------------------------------------------------- /patches/vlc/0027-omxil-always-use-pts-if-set.patch: -------------------------------------------------------------------------------- 1 | From bcce56ea1432dcb5cb349a2de099512d6e297204 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Tue, 30 Oct 2012 20:58:35 +0800 4 | Subject: [PATCH 27/42] omxil: always use pts if set 5 | 6 | revert commit 1f18696f679fe520b64d60cb933fe50d3dfc3215 7 | --- 8 | modules/codec/omxil/omxil.c | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c 12 | index d636d46..e15eb42 100644 13 | --- a/modules/codec/omxil/omxil.c 14 | +++ b/modules/codec/omxil/omxil.c 15 | @@ -1526,7 +1526,7 @@ more_input: 16 | p_header->nFilledLen = p_block->i_buffer - i_input_used; 17 | p_header->nOffset = 0; 18 | p_header->nFlags = OMX_BUFFERFLAG_ENDOFFRAME; 19 | - if (p_sys->b_use_pts && p_block->i_pts) 20 | + if (p_sys->b_use_pts) 21 | p_header->nTimeStamp = ToOmxTicks(p_block->i_pts); 22 | else 23 | p_header->nTimeStamp = ToOmxTicks(p_block->i_dts); 24 | -- 25 | 1.9.0 26 | 27 | -------------------------------------------------------------------------------- /patches/vlc/0028-mediacodec-disable-OMX.MTK.VIDEO.DECODER.AVC.patch: -------------------------------------------------------------------------------- 1 | From f17f93a58f5472d98c448b80c227701555d58de2 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Wed, 23 Oct 2013 21:22:05 +0800 4 | Subject: [PATCH 28/42] mediacodec: disable OMX.MTK.VIDEO.DECODER.AVC 5 | 6 | --- 7 | modules/codec/omxil/android_mediacodec.c | 22 +++++++++++++++------- 8 | 1 file changed, 15 insertions(+), 7 deletions(-) 9 | 10 | diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c 11 | index ba70fdc..a6a7a74 100644 12 | --- a/modules/codec/omxil/android_mediacodec.c 13 | +++ b/modules/codec/omxil/android_mediacodec.c 14 | @@ -430,13 +430,21 @@ static int OpenDecoder(vlc_object_t *p_this) 15 | jobject name = (*env)->CallObjectMethod(env, info, p_sys->get_name); 16 | jsize name_len = (*env)->GetStringUTFLength(env, name); 17 | const char *name_ptr = (*env)->GetStringUTFChars(env, name, NULL); 18 | - msg_Dbg(p_dec, "using %.*s", name_len, name_ptr); 19 | - p_sys->name = malloc(name_len + 1); 20 | - memcpy(p_sys->name, name_ptr, name_len); 21 | - p_sys->name[name_len] = '\0'; 22 | - (*env)->ReleaseStringUTFChars(env, name, name_ptr); 23 | - codec_name = name; 24 | - break; 25 | + if (name_len == 0 || name_ptr == NULL) { 26 | + msg_Dbg(p_dec, "invalid codec name %.*s", name_len, name_ptr); 27 | + } else if (0 == strncmp(name_ptr, "OMX.MTK.VIDEO.DECODER.AVC", name_len)) { 28 | + msg_Dbg(p_dec, "disable %.*s", name_len, name_ptr); 29 | + (*env)->ReleaseStringUTFChars(env, name, name_ptr); 30 | + (*env)->DeleteLocalRef(env, name); 31 | + } else { 32 | + msg_Dbg(p_dec, "using %.*s", name_len, name_ptr); 33 | + p_sys->name = malloc(name_len + 1); 34 | + memcpy(p_sys->name, name_ptr, name_len); 35 | + p_sys->name[name_len] = '\0'; 36 | + (*env)->ReleaseStringUTFChars(env, name, name_ptr); 37 | + codec_name = name; 38 | + break; 39 | + } 40 | } 41 | (*env)->DeleteLocalRef(env, info); 42 | } 43 | -- 44 | 1.9.0 45 | 46 | -------------------------------------------------------------------------------- /patches/vlc/0032-avcodec-do-not-align-dimensions-on-android.patch: -------------------------------------------------------------------------------- 1 | From abe1ab5063f791cf060ab51e21978b19ee696a72 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Thu, 24 Oct 2013 16:29:21 +0800 4 | Subject: [PATCH] avcodec: do not align dimensions on android 5 | 6 | --- 7 | modules/codec/avcodec/video.c | 3 ++- 8 | 1 file changed, 2 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c 11 | index edfa389..80e867e 100644 12 | --- a/modules/codec/avcodec/video.c 13 | +++ b/modules/codec/avcodec/video.c 14 | @@ -129,13 +129,14 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec, 15 | int width = p_context->coded_width; 16 | int height = p_context->coded_height; 17 | 18 | +#ifndef __ANDROID__ 19 | if( p_sys->p_va == NULL ) 20 | { 21 | int aligns[AV_NUM_DATA_POINTERS]; 22 | 23 | avcodec_align_dimensions2(p_context, &width, &height, aligns); 24 | } 25 | - 26 | +#endif 27 | 28 | if( width == 0 || height == 0 || width > 8192 || height > 8192 ) 29 | { 30 | -- 31 | 1.8.5.2 (Apple Git-48) 32 | 33 | -------------------------------------------------------------------------------- /patches/vlc/0033-MediaCodec-limit-single-instance.patch: -------------------------------------------------------------------------------- 1 | From 84b7a324641faff3f0c7b2329c49aa3896845f97 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Thu, 19 Dec 2013 11:20:15 +0800 4 | Subject: [PATCH 33/42] MediaCodec: limit single instance 5 | 6 | --- 7 | modules/codec/omxil/android_mediacodec.c | 9 +++++++++ 8 | 1 file changed, 9 insertions(+) 9 | 10 | diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c 11 | index a6a7a74..00f85ef 100644 12 | --- a/modules/codec/omxil/android_mediacodec.c 13 | +++ b/modules/codec/omxil/android_mediacodec.c 14 | @@ -255,6 +255,7 @@ static void CloseDecoder(vlc_object_t *); 15 | static picture_t *DecodeVideo(decoder_t *, block_t **); 16 | 17 | static void InvalidateAllPictures(decoder_t *); 18 | +static vlc_mutex_t single_instance = VLC_STATIC_MUTEX; 19 | 20 | /***************************************************************************** 21 | * Module descriptor 22 | @@ -318,6 +319,13 @@ static int OpenDecoder(vlc_object_t *p_this) 23 | if ((p_dec->p_sys = p_sys = calloc(1, sizeof(*p_sys))) == NULL) 24 | return VLC_ENOMEM; 25 | 26 | + /* */ 27 | + if (vlc_mutex_trylock(&single_instance) != 0) { 28 | + msg_Err(p_dec, "Can't start more than one instance at a time"); 29 | + free(p_sys); 30 | + return VLC_ENOMEM; 31 | + } 32 | + 33 | p_dec->pf_decode_video = DecodeVideo; 34 | 35 | p_dec->fmt_out.i_cat = p_dec->fmt_in.i_cat; 36 | @@ -587,6 +595,7 @@ static void CloseDecoder(vlc_object_t *p_this) 37 | if (p_sys->timestamp_fifo) 38 | timestamp_FifoRelease(p_sys->timestamp_fifo); 39 | free(p_sys); 40 | + vlc_mutex_unlock(&single_instance); 41 | } 42 | 43 | /***************************************************************************** 44 | -- 45 | 1.9.0 46 | 47 | -------------------------------------------------------------------------------- /patches/vlc/0034-omxil-limit-single-instance.patch: -------------------------------------------------------------------------------- 1 | From 0f08d3bd48dfd527ee68888adcc2fdb54629a841 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Thu, 19 Dec 2013 11:20:25 +0800 4 | Subject: [PATCH 34/42] omxil: limit single instance 5 | 6 | --- 7 | modules/codec/omxil/omxil.c | 12 ++++++++++++ 8 | 1 file changed, 12 insertions(+) 9 | 10 | diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c 11 | index e15eb42..9e2827e 100644 12 | --- a/modules/codec/omxil/omxil.c 13 | +++ b/modules/codec/omxil/omxil.c 14 | @@ -74,6 +74,8 @@ static OMX_ERRORTYPE OmxEmptyBufferDone( OMX_HANDLETYPE, OMX_PTR, 15 | static OMX_ERRORTYPE OmxFillBufferDone( OMX_HANDLETYPE, OMX_PTR, 16 | OMX_BUFFERHEADERTYPE * ); 17 | 18 | +static vlc_mutex_t single_instance = VLC_STATIC_MUTEX; 19 | + 20 | /***************************************************************************** 21 | * Module descriptor 22 | *****************************************************************************/ 23 | @@ -1042,6 +1044,14 @@ static int OpenGeneric( vlc_object_t *p_this, bool b_encode ) 24 | return VLC_ENOMEM; 25 | } 26 | 27 | + /* */ 28 | + if (vlc_mutex_trylock(&single_instance) != 0) { 29 | + msg_Err(p_dec, "Can't start more than one instance at a time"); 30 | + free(p_sys); 31 | + DeinitOmxCore(); 32 | + return VLC_EGENERIC; 33 | + } 34 | + 35 | /* Initialise the thread properties */ 36 | if(!b_encode) 37 | { 38 | @@ -1854,6 +1864,8 @@ static void CloseGeneric( vlc_object_t *p_this ) 39 | vlc_cond_destroy (&p_sys->out.fifo.wait); 40 | 41 | free( p_sys ); 42 | + 43 | + vlc_mutex_unlock(&single_instance); 44 | } 45 | 46 | /***************************************************************************** 47 | -- 48 | 1.9.0 49 | 50 | -------------------------------------------------------------------------------- /patches/vlc/0036-MediaCodec-echo-name.patch: -------------------------------------------------------------------------------- 1 | From 6cea6f59cc037775d729ec20fcde794389fe3e76 Mon Sep 17 00:00:00 2001 2 | From: Zhang Rui 3 | Date: Thu, 13 Feb 2014 12:41:38 +0800 4 | Subject: [PATCH 36/42] MediaCodec: echo name 5 | 6 | --- 7 | modules/codec/omxil/android_mediacodec.c | 9 +++++++++ 8 | 1 file changed, 9 insertions(+) 9 | 10 | diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c 11 | index c246725..9cf9e32 100644 12 | --- a/modules/codec/omxil/android_mediacodec.c 13 | +++ b/modules/codec/omxil/android_mediacodec.c 14 | @@ -592,6 +592,15 @@ static int OpenDecoder(vlc_object_t *p_this) 15 | if (!p_sys->timestamp_fifo) 16 | goto error; 17 | 18 | + if (p_sys->direct_rendering) { 19 | + char *psz_tmp = NULL; 20 | + asprintf( &psz_tmp, "%s, SurfaceRender", p_sys->name ); 21 | + var_SetString( p_dec, "module-video-decoder-impl", psz_tmp ); 22 | + free( psz_tmp ); 23 | + } else { 24 | + var_SetString( p_dec, "module-video-decoder-impl", p_sys->name ); 25 | + } 26 | + 27 | return VLC_SUCCESS; 28 | 29 | error: 30 | -- 31 | 1.9.0 32 | 33 | -------------------------------------------------------------------------------- /patches/vlc/0038-MediaCodec-check-exception-before-release-buffer.patch: -------------------------------------------------------------------------------- 1 | From 1ab72527c896403a2d84f7823e5d3776367bc759 Mon Sep 17 00:00:00 2001 2 | From: Zhang Rui 3 | Date: Wed, 19 Feb 2014 16:34:32 +0800 4 | Subject: [PATCH 38/42] MediaCodec: check exception before release buffer 5 | 6 | --- 7 | modules/codec/omxil/android_mediacodec.c | 5 +++++ 8 | 1 file changed, 5 insertions(+) 9 | 10 | diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c 11 | index 564d473..6cbfcf9 100644 12 | --- a/modules/codec/omxil/android_mediacodec.c 13 | +++ b/modules/codec/omxil/android_mediacodec.c 14 | @@ -760,6 +760,11 @@ static void DisplayBuffer(picture_sys_t* p_picsys, bool b_render) 15 | /* Release the MediaCodec buffer. */ 16 | JNIEnv *env = NULL; 17 | vlcjni_setup_thread_env(&env); 18 | + if ((*env)->ExceptionOccurred(env)) { 19 | + msg_Err(p_dec, "Exception before MediaCodec.releaseOutputBuffer (DisplayBuffer)"); 20 | + (*env)->ExceptionClear(env); 21 | + } 22 | + 23 | (*env)->CallVoidMethod(env, p_sys->codec, p_sys->release_output_buffer, i_index, b_render); 24 | if ((*env)->ExceptionOccurred(env)) { 25 | msg_Err(p_dec, "Exception in MediaCodec.releaseOutputBuffer (DisplayBuffer)"); 26 | -- 27 | 1.9.0 28 | 29 | -------------------------------------------------------------------------------- /patches/vlc/0040-contrib-src-main.mak-make-Fedora-happy.patch: -------------------------------------------------------------------------------- 1 | From f454bb320e6c5f50383793c69544108ff0e8d2b9 Mon Sep 17 00:00:00 2001 2 | From: Ming Hu 3 | Date: Wed, 26 Feb 2014 15:18:15 +0800 4 | Subject: [PATCH 40/42] contrib/src/main.mak: make Fedora happy 5 | 6 | --- 7 | contrib/src/main.mak | 5 +++++ 8 | 1 file changed, 5 insertions(+) 9 | 10 | diff --git a/contrib/src/main.mak b/contrib/src/main.mak 11 | index 5cd8e03..6bf4ec9 100644 12 | --- a/contrib/src/main.mak 13 | +++ b/contrib/src/main.mak 14 | @@ -307,7 +307,12 @@ APPLY = (cd $(UNPACK_DIR) && patch -fp1) < 15 | pkg_static = (cd $(UNPACK_DIR) && ../../../contrib/src/pkg-static.sh $(1)) 16 | MOVE = mv $(UNPACK_DIR) $@ && touch $@ 17 | 18 | +AUTOMAKE_TEST=$(shell which automake) 19 | +ifeq ($(AUTOMAKE_TEST), "/bin/automake") 20 | AUTOMAKE_DATA_DIRS=$(foreach n,$(foreach n,$(subst :, ,$(shell echo $$PATH)),$(abspath $(n)/../share)),$(wildcard $(n)/automake*)) 21 | +else 22 | +AUTOMAKE_DATA_DIRS=$(abspath $(dir $(shell which automake))/../share/automake*) 23 | +endif 24 | UPDATE_AUTOCONFIG = for dir in $(AUTOMAKE_DATA_DIRS); do \ 25 | if test -f "$${dir}/config.sub" -a -f "$${dir}/config.guess"; then \ 26 | cp "$${dir}/config.sub" "$${dir}/config.guess" $(UNPACK_DIR); \ 27 | -- 28 | 1.9.0 29 | 30 | -------------------------------------------------------------------------------- /patches/vlc/0042-configure-vorbis-is-not-mandatory.patch: -------------------------------------------------------------------------------- 1 | From 225fa3c93b278808db78dc32ede521fb1d20b925 Mon Sep 17 00:00:00 2001 2 | From: Ming Hu 3 | Date: Wed, 9 Apr 2014 11:36:36 +0800 4 | Subject: [PATCH 42/42] configure: vorbis is not mandatory 5 | 6 | --- 7 | configure.ac | 8 +++++--- 8 | 1 file changed, 5 insertions(+), 3 deletions(-) 9 | 10 | diff --git a/configure.ac b/configure.ac 11 | index 3d1b67a..4ef6f89 100644 12 | --- a/configure.ac 13 | +++ b/configure.ac 14 | @@ -2000,9 +2000,11 @@ dnl 15 | dnl ogg demux plugin 16 | dnl 17 | PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto]) 18 | -PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [ 19 | - AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis]) 20 | -],[]) 21 | +if test "x${enable_ogg}" = "xyes"; then 22 | + PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [ 23 | + AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis]) 24 | + ],[]) 25 | +fi 26 | PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}]) 27 | if test "${enable_sout}" != "no"; then 28 | PKG_ENABLE_MODULES_VLC([MUX_OGG], [], [ogg >= 1.0], [Ogg mux support], [auto]) 29 | -- 30 | 1.9.0 31 | 32 | -------------------------------------------------------------------------------- /patches/vlc/0045-mediacodec-check-exception-after-queueInputBuffer.patch: -------------------------------------------------------------------------------- 1 | From 7fb984397df6ab69055e676a03ff15ca0067c30e Mon Sep 17 00:00:00 2001 2 | From: Ming Hu 3 | Date: Thu, 10 Jul 2014 12:41:05 +0800 4 | Subject: [PATCH] mediacodec: check exception after queueInputBuffer 5 | 6 | --- 7 | modules/codec/omxil/android_mediacodec.c | 6 ++++++ 8 | 1 file changed, 6 insertions(+) 9 | 10 | diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c 11 | index 041020f..aae1353 100644 12 | --- a/modules/codec/omxil/android_mediacodec.c 13 | +++ b/modules/codec/omxil/android_mediacodec.c 14 | @@ -1128,6 +1128,12 @@ static picture_t *DecodeVideo(decoder_t *p_dec, block_t **pp_block) 15 | timestamp_FifoPut(p_sys->timestamp_fifo, p_block->i_pts ? VLC_TS_INVALID : p_block->i_dts); 16 | (*env)->CallVoidMethod(env, p_sys->codec, p_sys->queue_input_buffer, index, 0, size, ts, 0); 17 | (*env)->DeleteLocalRef(env, buf); 18 | + if ((*env)->ExceptionOccurred(env)) { 19 | + msg_Warn(p_dec, "Exception in MediaCodec.queueInputBuffer"); 20 | + (*env)->ExceptionClear(env); 21 | + p_sys->error_state = true; 22 | + break; 23 | + } 24 | p_sys->decoded = true; 25 | break; 26 | } 27 | -- 28 | 2.0.0 29 | 30 | -------------------------------------------------------------------------------- /patches/vlc/0046-MediaCodec-add-k3v2-to-white-list.patch: -------------------------------------------------------------------------------- 1 | From 27874645721e8f3f1b89b71a47194d7c1c0f74b2 Mon Sep 17 00:00:00 2001 2 | From: ctiao 3 | Date: Mon, 3 Nov 2014 15:17:45 +0800 4 | Subject: [PATCH] MediaCodec: add k3v2 to white list 5 | 6 | --- 7 | modules/codec/omxil/android_mediacodec.c | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c 11 | index aae1353..b3b4bd9 100644 12 | --- a/modules/codec/omxil/android_mediacodec.c 13 | +++ b/modules/codec/omxil/android_mediacodec.c 14 | @@ -310,6 +310,7 @@ static const codec_quirk_t s_codec_quirk_list[] = { 15 | {"OMX.SEC.AVC.Decoder", MCODEC_PREFER, MCODEC_PREFER}, 16 | 17 | {"OMX.ittiam.", MCODEC_UNSUPPORT, MCODEC_UNSUPPORT}, 18 | + {"OMX.k3.", MCODEC_PREFER, MCODEC_PREFER}, 19 | 20 | {NULL, MCODEC_UNKNOWN, MCODEC_UNKNOWN}, 21 | }; 22 | -- 23 | 1.8.5.2 (Apple Git-48) 24 | 25 | -------------------------------------------------------------------------------- /patches/vlc/0047-MediaCodec-add-Intel-to-white-list.patch: -------------------------------------------------------------------------------- 1 | From 808bc14a6b8e0d4ee32dca27852db505331d2ef7 Mon Sep 17 00:00:00 2001 2 | From: ctiao 3 | Date: Mon, 3 Nov 2014 15:59:01 +0800 4 | Subject: [PATCH] MediaCodec: add Intel to white list 5 | 6 | --- 7 | modules/codec/omxil/android_mediacodec.c | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c 11 | index b3b4bd9..b11ff2b 100644 12 | --- a/modules/codec/omxil/android_mediacodec.c 13 | +++ b/modules/codec/omxil/android_mediacodec.c 14 | @@ -311,6 +311,7 @@ static const codec_quirk_t s_codec_quirk_list[] = { 15 | 16 | {"OMX.ittiam.", MCODEC_UNSUPPORT, MCODEC_UNSUPPORT}, 17 | {"OMX.k3.", MCODEC_PREFER, MCODEC_PREFER}, 18 | + {"OMX.Intel.", MCODEC_PREFER, MCODEC_PREFER}, 19 | 20 | {NULL, MCODEC_UNKNOWN, MCODEC_UNKNOWN}, 21 | }; 22 | -- 23 | 1.8.5.2 (Apple Git-48) 24 | 25 | -------------------------------------------------------------------------------- /patches/vlc/ignore/0001-zlib-fix-zlib-build-on-android.patch: -------------------------------------------------------------------------------- 1 | From 79b93771bc8df887b003dfea9164e817c16a1f1f Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Thu, 17 May 2012 16:37:14 +0800 4 | Subject: [PATCH 01/33] zlib: fix zlib build on android 5 | 6 | --- 7 | contrib/src/zlib/rules.mak | 2 +- 8 | contrib/src/zlib/zlib-android.patch | 13 +++++++++++++ 9 | 2 个文件被修改,插入 14 行(+),删除 1 行(-) 10 | create mode 100644 contrib/src/zlib/zlib-android.patch 11 | 12 | diff --git a/contrib/src/zlib/rules.mak b/contrib/src/zlib/rules.mak 13 | index 210da1e..cd86013 100644 14 | --- a/contrib/src/zlib/rules.mak 15 | +++ b/contrib/src/zlib/rules.mak 16 | @@ -15,7 +15,7 @@ $(TARBALLS)/zlib-$(ZLIB_VERSION).tar.gz: 17 | zlib: zlib-$(ZLIB_VERSION).tar.gz .sum-zlib 18 | $(UNPACK) 19 | $(APPLY) $(SRC)/zlib/zlib-wince.patch 20 | - $(APPLY) $(SRC)/zlib/zlib-osx.patch 21 | + $(APPLY) $(SRC)/zlib/zlib-android.patch 22 | $(MOVE) 23 | 24 | .zlib: zlib 25 | diff --git a/contrib/src/zlib/zlib-android.patch b/contrib/src/zlib/zlib-android.patch 26 | new file mode 100644 27 | index 0000000..a315212 28 | --- /dev/null 29 | +++ b/contrib/src/zlib/zlib-android.patch 30 | @@ -0,0 +1,13 @@ 31 | +diff -ru zlib.orig/configure zlib/configure 32 | +--- zlib.orig/configure 2012-05-17 16:29:12.000000000 +0800 33 | ++++ zlib/configure 2012-05-17 16:29:50.000000000 +0800 34 | +@@ -206,8 +206,7 @@ 35 | + SHAREDLIBV=libz.$VER$shared_ext 36 | + SHAREDLIBM=libz.$VER1$shared_ext 37 | + LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"} 38 | +- AR="libtool" 39 | +- ARFLAGS="-o" ;; 40 | ++ ;; 41 | + *) LDSHARED=${LDSHARED-"$cc -shared"} ;; 42 | + esac 43 | + else 44 | -- 45 | 1.7.10.4 46 | 47 | -------------------------------------------------------------------------------- /patches/vlc/ignore/0011-plugin-access-add-sina.patch: -------------------------------------------------------------------------------- 1 | From 12d93c835d50f6092bf456d170ccfdc40557ff3e Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Thu, 21 Jun 2012 15:47:39 +0800 4 | Subject: [PATCH 11/36] plugin: access: add sina 5 | 6 | --- 7 | modules/access/Modules.am | 11 +++++++++++ 8 | 1 个文件被修改,插入 11 行(+) 9 | 10 | diff --git a/modules/access/Modules.am b/modules/access/Modules.am 11 | index ae61db3..d58a381 100644 12 | --- a/modules/access/Modules.am 13 | +++ b/modules/access/Modules.am 14 | @@ -167,6 +167,17 @@ if HAVE_XCB 15 | libvlc_LTLIBRARIES += libxcb_screen_plugin.la 16 | endif 17 | 18 | +libaccess_sinahttp_plugin_la_SOURCES = sina/sinahttp.c 19 | +libaccess_sinahttp_plugin_la_CFLAGS = $(AM_CFLAGS) 20 | +libaccess_sinahttp_plugin_la_LIBADD = $(AM_LIBADD) 21 | +libaccess_sinahttp_plugin_la_DEPENDENCIES = 22 | +libvlc_LTLIBRARIES += libaccess_sinahttp_plugin.la 23 | + 24 | +libaccess_sinaxml_plugin_la_SOURCES = sina/sinaxml.c 25 | +libaccess_sinaxml_plugin_la_CFLAGS = $(AM_CFLAGS) $(LIBXML2_CFLAGS) 26 | +libaccess_sinaxml_plugin_la_LIBADD = $(AM_LIBADD) $(LIBXML2_LIBS) 27 | +libaccess_sinaxml_plugin_la_DEPENDENCIES = 28 | +libvlc_LTLIBRARIES += libaccess_sinaxml_plugin.la 29 | 30 | ### Digital TV ### 31 | 32 | -- 33 | 1.7.10.4 34 | 35 | -------------------------------------------------------------------------------- /patches/vlc/ignore/0013-configure.ac-add-android_nativewindow.patch: -------------------------------------------------------------------------------- 1 | From 74ba7d6c2db1acd2e00d14fec05ab318d40244d5 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Sat, 27 Jul 2013 21:04:04 +0800 4 | Subject: [PATCH] configure.ac: add android_nativewindow 5 | 6 | --- 7 | configure.ac | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/configure.ac b/configure.ac 11 | index 35bc422..d0dd3dc 100644 12 | --- a/configure.ac 13 | +++ b/configure.ac 14 | @@ -3237,6 +3237,8 @@ if test "${enable_android_surface}" = "yes"; then 15 | VLC_ADD_LIBS([android_surface], [-ldl]) 16 | VLC_ADD_PLUGIN([android_opaque]) 17 | VLC_ADD_LIBS([android_opaque], [-ldl]) 18 | + VLC_ADD_PLUGIN([android_nativewindow]) 19 | + VLC_ADD_LIBS([android_nativewindow], [-ldl]) 20 | fi 21 | fi 22 | 23 | -- 24 | 1.8.3.4 25 | 26 | -------------------------------------------------------------------------------- /patches/vlc/ignore/0014-plugin-video_output-android_nativewindow.patch: -------------------------------------------------------------------------------- 1 | From 396aa44244d4847ab340f9dea02ad33f763ac071 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Sat, 27 Jul 2013 21:04:25 +0800 4 | Subject: [PATCH] plugin: video_output: android_nativewindow 5 | 6 | --- 7 | modules/video_output/Modules.am | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/modules/video_output/Modules.am b/modules/video_output/Modules.am 11 | index 4b0b2ed..c6cfaf0 100644 12 | --- a/modules/video_output/Modules.am 13 | +++ b/modules/video_output/Modules.am 14 | @@ -14,6 +14,7 @@ SOURCES_vout_coregraphicslayer = coregraphicslayer.m 15 | SOURCES_vout_ios2 = ios2.m opengl.h opengl.c 16 | SOURCES_android_surface = android/surface.c android/utils.c 17 | SOURCES_android_opaque = android/opaque.c 18 | +SOURCES_android_nativewindow = androidnativewindow.c 19 | 20 | if HAVE_DECKLINK 21 | libdecklinkoutput_plugin_la_SOURCES = decklink.cpp 22 | -- 23 | 1.8.3.4 24 | 25 | -------------------------------------------------------------------------------- /patches/vlc/ignore/0019-input-fix-video-delay-after-clock-gap-for-youku-m3u8.patch: -------------------------------------------------------------------------------- 1 | From 85b352917a626674f5cdd3c54b9b951412f5734c Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Tue, 8 May 2012 15:20:54 +0800 4 | Subject: [PATCH 19/32] input: fix video delay after clock gap for youku m3u8 5 | 6 | --- 7 | src/audio_output/input.c | 4 ++-- 8 | 1 个文件被修改,插入 2 行(+),删除 2 行(-) 9 | 10 | diff --git a/src/audio_output/input.c b/src/audio_output/input.c 11 | index 1c36e64..57dc8b9 100644 12 | --- a/src/audio_output/input.c 13 | +++ b/src/audio_output/input.c 14 | @@ -391,7 +391,7 @@ block_t *aout_InputPlay(audio_output_t *p_aout, aout_input_t *p_input, 15 | 16 | mtime_t drift = start_date - p_buffer->i_pts; 17 | 18 | - if( drift < -i_input_rate * 3 * AOUT_MAX_PTS_ADVANCE / INPUT_RATE_DEFAULT ) 19 | + if( drift < -i_input_rate * 3 * AOUT_MAX_PTS_ADVANCE * 30 / INPUT_RATE_DEFAULT ) 20 | { 21 | msg_Warn( p_aout, "buffer way too early (%"PRId64"), clearing queue", 22 | drift ); 23 | @@ -405,7 +405,7 @@ block_t *aout_InputPlay(audio_output_t *p_aout, aout_input_t *p_input, 24 | drift = 0; 25 | } 26 | else 27 | - if( drift > +i_input_rate * 3 * AOUT_MAX_PTS_DELAY / INPUT_RATE_DEFAULT ) 28 | + if( drift > +i_input_rate * 3 * AOUT_MAX_PTS_DELAY * 30 / INPUT_RATE_DEFAULT ) 29 | { 30 | msg_Warn( p_aout, "buffer way too late (%"PRId64"), dropping buffer", 31 | drift ); 32 | -- 33 | 1.7.10.4 34 | 35 | -------------------------------------------------------------------------------- /patches/vlc/ignore/0024-avcodec-fix-broken-picture.patch: -------------------------------------------------------------------------------- 1 | From 8e61308be73ee0f0f57348fc46ccb52b85aff15f Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Sat, 16 Jun 2012 15:02:07 +0800 4 | Subject: [PATCH 24/33] avcodec: fix broken picture 5 | 6 | --- 7 | modules/codec/avcodec/video.c | 12 +++++++++--- 8 | 1 个文件被修改,插入 9 行(+),删除 3 行(-) 9 | 10 | diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c 11 | index b2e4271..df69a7b 100644 12 | --- a/modules/codec/avcodec/video.c 13 | +++ b/modules/codec/avcodec/video.c 14 | @@ -494,8 +494,9 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block ) 15 | return NULL; 16 | } 17 | 18 | - if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) ) 19 | + if( p_block->i_flags & (BLOCK_FLAG_CORRUPTED) ) 20 | { 21 | + msg_Err( p_dec, "corrupted video -> dropping frame" ); 22 | p_sys->i_pts = VLC_TS_INVALID; /* To make sure we recover properly */ 23 | 24 | p_sys->i_late_frames = 0; 25 | @@ -506,6 +507,10 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block ) 26 | block_Release( p_block ); 27 | return NULL; 28 | } 29 | + else if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY) ) 30 | + { 31 | + msg_Err( p_dec, "discontinuity video -> no dropping frame" ); 32 | + } 33 | 34 | if( p_block->i_flags & BLOCK_FLAG_PREROLL ) 35 | { 36 | @@ -516,11 +521,11 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block ) 37 | } 38 | 39 | if( !p_dec->b_pace_control && (p_sys->i_late_frames > 0) && 40 | - (mdate() - p_sys->i_late_frames_start > INT64_C(5000000)) ) 41 | + (mdate() - p_sys->i_late_frames_start > INT64_C(50000000)) ) 42 | { 43 | if( p_sys->i_pts > VLC_TS_INVALID ) 44 | { 45 | - msg_Err( p_dec, "more than 5 seconds of late video -> " 46 | + msg_Err( p_dec, "more than 50 seconds of late video -> " 47 | "dropping frame (computer too slow ?)" ); 48 | p_sys->i_pts = VLC_TS_INVALID; /* To make sure we recover properly */ 49 | } 50 | @@ -570,6 +575,7 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block ) 51 | { 52 | /* It creates broken picture 53 | * FIXME either our parser or ffmpeg is broken */ 54 | + b_drawpicture = true; 55 | #if 0 56 | if( p_sys->b_hurry_up ) 57 | p_context->skip_frame = __MAX( p_context->skip_frame, 58 | -- 59 | 1.7.10.4 60 | 61 | -------------------------------------------------------------------------------- /patches/vlc/ignore/0033-plugin-access-add-yahls.patch: -------------------------------------------------------------------------------- 1 | From a39a801484a68aa65da95502005d20763999e2e7 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Wed, 25 Jul 2012 11:36:00 +0800 4 | Subject: [PATCH 33/34] plugin: access: add yahls 5 | 6 | --- 7 | modules/access/Modules.am | 8 ++++++++ 8 | 1 个文件被修改,插入 8 行(+) 9 | 10 | diff --git a/modules/access/Modules.am b/modules/access/Modules.am 11 | index 9e97c73..0a549ba 100644 12 | --- a/modules/access/Modules.am 13 | +++ b/modules/access/Modules.am 14 | @@ -179,6 +179,14 @@ libaccess_sinaxml_plugin_la_LIBADD = $(AM_LIBADD) $(LIBXML2_LIBS) 15 | libaccess_sinaxml_plugin_la_DEPENDENCIES = 16 | libvlc_LTLIBRARIES += libaccess_sinaxml_plugin.la 17 | 18 | +libaccess_yahls_plugin_la_SOURCES = \ 19 | + yahls/yahls.c \ 20 | + yahls/m3u8parser.c 21 | +libaccess_yahls_plugin_la_CFLAGS = $(AM_CFLAGS) 22 | +libaccess_yahls_plugin_la_LIBADD = $(AM_LIBADD) 23 | +libaccess_yahls_plugin_la_DEPENDENCIES = 24 | +libvlc_LTLIBRARIES += libaccess_yahls_plugin.la 25 | + 26 | ### Digital TV ### 27 | 28 | libdtv_plugin_la_SOURCES = \ 29 | -- 30 | 1.7.10.4 31 | 32 | -------------------------------------------------------------------------------- /patches/vlc/module-full/nothing: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilibili/vlc-android-macbuild/d3f6d9c16346b43336a8b68942ab27b2790032f1/patches/vlc/module-full/nothing -------------------------------------------------------------------------------- /patches/vlc/module-lite/ignore/1001-lite-mode-ffmpeg-disable-modules.patch: -------------------------------------------------------------------------------- 1 | From 11ce6783f6c651369e04014cbbc7a056edd0815e Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Thu, 22 Mar 2012 18:45:25 +0800 4 | Subject: [PATCH] lite-mode: ffmpeg: disable modules 5 | 6 | --- 7 | contrib/src/ffmpeg/rules.mak | 46 +++++++++++++++++++++++++++++++++++++++++++- 8 | 1 file changed, 45 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/contrib/src/ffmpeg/rules.mak b/contrib/src/ffmpeg/rules.mak 11 | index 4ce4682..285f94d 100644 12 | --- a/contrib/src/ffmpeg/rules.mak 13 | +++ b/contrib/src/ffmpeg/rules.mak 14 | @@ -35,7 +35,7 @@ FFMPEGCONF += \ 15 | --disable-iconv 16 | endif 17 | 18 | -DEPS_ffmpeg = zlib gsm openjpeg 19 | +DEPS_ffmpeg = zlib 20 | 21 | # Optional dependencies 22 | ifndef BUILD_NETWORK 23 | @@ -58,6 +58,50 @@ FFMPEGCONF += --enable-thumb 24 | endif 25 | endif 26 | 27 | +# Disable mostly 28 | +FFMPEGCONF += \ 29 | + --enable-runtime-cpudetect \ 30 | + --disable-network \ 31 | + --disable-protocols \ 32 | + --disable-decoder=libvpx \ 33 | + --disable-decoder=bink \ 34 | + --disable-encoders \ 35 | + --disable-libgsm \ 36 | + --disable-libopenjpeg \ 37 | + --disable-decoders \ 38 | + --enable-decoder=aac \ 39 | + --enable-decoder=aac_latm \ 40 | + --enable-decoder=aasc \ 41 | + --enable-decoder=ac3 \ 42 | + --enable-decoder=amrnb \ 43 | + --enable-decoder=amrwb \ 44 | + --enable-decoder=flv \ 45 | + --enable-decoder=h263 \ 46 | + --enable-decoder=h263i \ 47 | + --enable-decoder=h264 \ 48 | + --enable-decoder=hevc \ 49 | + --enable-decoder=mp3 \ 50 | + --enable-decoder=mp3adu \ 51 | + --enable-decoder=mp3adufloat \ 52 | + --enable-decoder=mp3float \ 53 | + --enable-decoder=mp3on4 \ 54 | + --enable-decoder=mp3on4float \ 55 | + --enable-decoder=mpeg1video \ 56 | + --enable-decoder=mpeg2video \ 57 | + --enable-decoder=mpeg4 \ 58 | + --enable-decoder=mpeg4v1 \ 59 | + --enable-decoder=mpeg4v2 \ 60 | + --enable-decoder=mpeg4v3 \ 61 | + --enable-decoder=vp3 \ 62 | + --enable-decoder=vp5 \ 63 | + --enable-decoder=vp6 \ 64 | + --enable-decoder=vp6a \ 65 | + --enable-decoder=vp6f \ 66 | + --enable-decoder=vp8 \ 67 | + --enable-decoder=vc1 \ 68 | + --enable-decoder=vc1_vdpau \ 69 | + --enable-decoder=vc1image 70 | + 71 | ifdef HAVE_CROSS_COMPILE 72 | FFMPEGCONF += --enable-cross-compile 73 | ifndef HAVE_DARWIN_OS 74 | -- 75 | 1.8.5.2 (Apple Git-48) 76 | 77 | -------------------------------------------------------------------------------- /patches/vlc/module-lite/ignore/1002-ffmpeg-bump-tested-hash.patch: -------------------------------------------------------------------------------- 1 | From 17fb3044a7896ea528e46b49fa200f08122cfe5a Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Tue, 26 Feb 2013 19:01:29 +0800 4 | Subject: [PATCH 1002/1003] ffmpeg: bump tested hash 5 | 6 | --- 7 | contrib/src/ffmpeg/rules.mak | 6 +++--- 8 | 1 file changed, 3 insertions(+), 3 deletions(-) 9 | 10 | diff --git a/contrib/src/ffmpeg/rules.mak b/contrib/src/ffmpeg/rules.mak 11 | index 385752d..59c296f 100644 12 | --- a/contrib/src/ffmpeg/rules.mak 13 | +++ b/contrib/src/ffmpeg/rules.mak 14 | @@ -2,11 +2,11 @@ 15 | 16 | #Uncomment the one you want 17 | #USE_LIBAV ?= 1 18 | -#USE_FFMPEG ?= 1 19 | +USE_FFMPEG ?= 1 20 | 21 | ifdef USE_FFMPEG 22 | -HASH=HEAD 23 | -FFMPEG_SNAPURL := http://git.videolan.org/?p=ffmpeg.git;a=snapshot;h=$(HASH);sf=tgz 24 | +HASH=ijk-r0.1.2-dev 25 | +FFMPEG_SNAPURL := https://github.com/bbcallen/FFmpeg/archive/$(HASH).tar.gz 26 | else 27 | HASH=HEAD 28 | FFMPEG_SNAPURL := http://git.libav.org/?p=libav.git;a=snapshot;h=$(HASH);sf=tgz 29 | -- 30 | 1.9.0 31 | 32 | -------------------------------------------------------------------------------- /patches/vlc/module-lite/ignore/1003-contrib-enable-minium-remuxing-through-ffmpeg.patch: -------------------------------------------------------------------------------- 1 | From 4725b275af2eb0bb206e2589136fdbb96bac7e4c Mon Sep 17 00:00:00 2001 2 | From: Ming Hu 3 | Date: Mon, 9 Jun 2014 10:47:27 +0800 4 | Subject: [PATCH 1003/1003] contrib: enable minium remuxing through ffmpeg 5 | 6 | --- 7 | contrib/src/ffmpeg/rules.mak | 5 +++++ 8 | 1 file changed, 5 insertions(+) 9 | 10 | diff --git a/contrib/src/ffmpeg/rules.mak b/contrib/src/ffmpeg/rules.mak 11 | index 321a491..931d07c 100644 12 | --- a/contrib/src/ffmpeg/rules.mak 13 | +++ b/contrib/src/ffmpeg/rules.mak 14 | @@ -102,6 +102,11 @@ FFMEPGCONF += \ 15 | --enable-decoder=vc1_vdpau \ 16 | --enable-decoder=vc1image 17 | 18 | +# Support remuxing to certain formats 19 | +FFMPEGCONF += --enable-protocol=file 20 | +FFMPEGCONF += --enable-muxer=mp4 21 | +FFMPEGCONF += --enable-bsf=aac_adtstoasc 22 | + 23 | ifdef HAVE_CROSS_COMPILE 24 | FFMPEGCONF += --enable-cross-compile 25 | ifndef HAVE_DARWIN_OS 26 | -- 27 | 1.8.5.2 (Apple Git-48) 28 | 29 | -------------------------------------------------------------------------------- /patches/vlc/module-medium/1001-medium-mode-ffmpeg-disable-modules.patch: -------------------------------------------------------------------------------- 1 | From 0df53e2dc975aa714bb9436777eccb5d28ecfac3 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Thu, 22 Mar 2012 18:45:25 +0800 4 | Subject: [PATCH 1001/1002] medium-mode: ffmpeg: disable modules 5 | 6 | --- 7 | contrib/src/ffmpeg/rules.mak | 48 +++++++++++++++++++++++++++++++++++++++--- 8 | 1 个文件被修改,插入 45 行(+),删除 3 行(-) 9 | 10 | diff --git a/contrib/src/ffmpeg/rules.mak b/contrib/src/ffmpeg/rules.mak 11 | index ed6d8e8..c8fda76 100644 12 | --- a/contrib/src/ffmpeg/rules.mak 13 | +++ b/contrib/src/ffmpeg/rules.mak 14 | @@ -6,10 +6,52 @@ FFMPEG_SNAPURL := http://git.libav.org/?p=libav.git;a=snapshot;h=HEAD;sf=tgz 15 | FFMPEGCONF = \ 16 | --cc="$(CC)" \ 17 | --disable-doc \ 18 | + --disable-network \ 19 | + --disable-protocols \ 20 | --disable-decoder=libvpx \ 21 | --disable-decoder=bink \ 22 | - --enable-libgsm \ 23 | - --enable-libopenjpeg \ 24 | + --disable-decoders \ 25 | + --enable-decoder=aac \ 26 | + --enable-decoder=aac_latm \ 27 | + --enable-decoder=aasc \ 28 | + --enable-decoder=ac3 \ 29 | + --enable-decoder=amrnb \ 30 | + --enable-decoder=amrwb \ 31 | + --enable-decoder=flv \ 32 | + --enable-decoder=h263 \ 33 | + --enable-decoder=h263i \ 34 | + --enable-decoder=h264 \ 35 | + --enable-decoder=mp3 \ 36 | + --enable-decoder=mp3adu \ 37 | + --enable-decoder=mp3adufloat \ 38 | + --enable-decoder=mp3float \ 39 | + --enable-decoder=mp3on4 \ 40 | + --enable-decoder=mp3on4float \ 41 | + --enable-decoder=mpeg1video \ 42 | + --enable-decoder=mpeg2video \ 43 | + --enable-decoder=mpeg4 \ 44 | + --enable-decoder=mpeg4v1 \ 45 | + --enable-decoder=mpeg4v2 \ 46 | + --enable-decoder=mpeg4v3 \ 47 | + --enable-decoder=wmalossless \ 48 | + --enable-decoder=wmapro \ 49 | + --enable-decoder=wmav1 \ 50 | + --enable-decoder=wmav2 \ 51 | + --enable-decoder=wmavoice \ 52 | + --enable-decoder=wmv1 \ 53 | + --enable-decoder=wmv2 \ 54 | + --enable-decoder=wmv3 \ 55 | + --enable-decoder=wmv3_vdpau \ 56 | + --enable-decoder=wmv3image \ 57 | + --enable-decoder=vp3 \ 58 | + --enable-decoder=vp5 \ 59 | + --enable-decoder=vp6 \ 60 | + --enable-decoder=vp6a \ 61 | + --enable-decoder=vp6f \ 62 | + --enable-decoder=vp8 \ 63 | + --enable-decoder=vc1 \ 64 | + --enable-decoder=vc1_vdpau \ 65 | + --enable-decoder=vc1image \ 66 | --disable-debug \ 67 | --disable-avdevice \ 68 | --disable-devices \ 69 | @@ -20,7 +62,7 @@ FFMPEGCONF = \ 70 | # --disable-ffserver \ 71 | # --disable-ffplay \ 72 | # --disable-ffprobe 73 | -DEPS_ffmpeg = zlib gsm openjpeg 74 | +DEPS_ffmpeg = zlib 75 | 76 | # Optional dependencies 77 | ifdef BUILD_ENCODERS 78 | -- 79 | 1.7.10.4 80 | 81 | -------------------------------------------------------------------------------- /patches/vlc/module-medium/1002-medium-mode-Modules.am-disable-modules.patch: -------------------------------------------------------------------------------- 1 | From 33b7f453f5320c0571cda0cd42b80996a34987b1 Mon Sep 17 00:00:00 2001 2 | From: bbcallen 3 | Date: Tue, 3 Jul 2012 18:40:11 +0800 4 | Subject: [PATCH 1002/1002] medium-mode: Modules.am: disable modules 5 | 6 | --- 7 | modules/access/Modules.am | 9 ++------- 8 | modules/codec/Modules.am | 2 +- 9 | modules/demux/Modules.am | 2 +- 10 | modules/stream_filter/Modules.am | 2 -- 11 | 4 个文件被修改,插入 4 行(+),删除 11 行(-) 12 | 13 | diff --git a/modules/access/Modules.am b/modules/access/Modules.am 14 | index a1ca3ef..a053f46 100644 15 | --- a/modules/access/Modules.am 16 | +++ b/modules/access/Modules.am 17 | @@ -3,14 +3,9 @@ 18 | # obviously does not. Here is a fix for that. 19 | LIBTOOL=@LIBTOOL@ --tag=CC 20 | 21 | -BASE_SUBDIRS = bd mms rtp rtsp screen vcd vcdx zip 22 | -EXTRA_SUBDIRS = dshow 23 | +BASE_SUBDIRS = rtp rtsp zip 24 | SUBDIRS = $(BASE_SUBDIRS) 25 | -DIST_SUBDIRS = $(BASE_SUBDIRS) $(EXTRA_SUBDIRS) 26 | - 27 | -if HAVE_WIN32 28 | -SUBDIRS += dshow 29 | -endif 30 | +DIST_SUBDIRS = $(BASE_SUBDIRS) 31 | 32 | libfilesystem_plugin_la_SOURCES = \ 33 | fs.h \ 34 | diff --git a/modules/codec/Modules.am b/modules/codec/Modules.am 35 | index 6f0fddd..a1e1efd 100644 36 | --- a/modules/codec/Modules.am 37 | +++ b/modules/codec/Modules.am 38 | @@ -1,4 +1,4 @@ 39 | -SUBDIRS = loader dmo avcodec shine spudec wmafixed omxil 40 | +SUBDIRS = avcodec wmafixed omxil 41 | SOURCES_a52 = a52.c a52.h 42 | SOURCES_dts = dts.c 43 | SOURCES_flac = flac.c 44 | diff --git a/modules/demux/Modules.am b/modules/demux/Modules.am 45 | index 45d2b45..0d2f3de 100644 46 | --- a/modules/demux/Modules.am 47 | +++ b/modules/demux/Modules.am 48 | @@ -1,4 +1,4 @@ 49 | -SUBDIRS = asf avformat avi mkv mp4 mpeg playlist 50 | +SUBDIRS = asf avformat mp4 mpeg 51 | SOURCES_flacsys = flac.c 52 | SOURCES_ogg = ogg.c ogg.h oggseek.c oggseek.h vorbis.h kate_categories.c \ 53 | kate_categories.h xiph.h 54 | diff --git a/modules/stream_filter/Modules.am b/modules/stream_filter/Modules.am 55 | index 78efb7d..55b22ae 100644 56 | --- a/modules/stream_filter/Modules.am 57 | +++ b/modules/stream_filter/Modules.am 58 | @@ -1,5 +1,3 @@ 59 | -SUBDIRS = dash 60 | - 61 | SOURCES_decomp = decomp.c 62 | SOURCES_stream_filter_record = record.c 63 | 64 | -- 65 | 1.7.10.4 66 | 67 | -------------------------------------------------------------------------------- /sync-vlc.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | TARGET_LIST=" 4 | vlc-lite-armv7a 5 | vlc-lite-armv5 6 | vlc-lite-armv6 7 | vlc-lite-armv6-vfp 8 | vlc-lite-x86 9 | " 10 | 11 | for TARGET in ${TARGET_LIST} 12 | do 13 | 14 | echo "sync $TARGET" 15 | cd $TARGET 16 | git checkout master 17 | git pull 18 | echo "sync $TARGET/vlc" 19 | cd vlc 20 | git checkout master 21 | git pull 22 | cd ../.. 23 | 24 | done 25 | 26 | --------------------------------------------------------------------------------