Android Development Practice: Compiling vlc-for-android

Source: Internet
Author: User

The recent development of streaming media in Android, always wanted to learn a powerful VLC, just take this opportunity to study the vlc-for-android code, to see how excellent open source audio and video player is implemented. This article summarizes how to compile vlc-for-android under the Linux platform.


Compilation environment: Ubuntu 14.04 64BIT,VLC version 2.1.5


Reference article: https://wiki.videolan.org/AndroidCompile/


1. Preparing the compilation environment


Basically in accordance with the introduction of this wiki is enough, in order to successfully complete the compilation, it is recommended to first ensure that the relevant software or dependent libraries have been downloaded, I would like to highlight a few key considerations.


(1) Android SDK: must use SDK Platform Android 5.0, API 21, because vlc-for-android use some of the Android 5.0 API.


(2) It is best to install the following dependent software through Apt-get installation, or update to the latest version

Git,apache-ant (or Ant), autoconf, Automake, Autopoint, CMake, gawk (or Nawk), GCC, g++, Libtool, M4, Patch, Pkg-config, R Agel, Subversion, unzip.


2. Download the source package


Download Vlc-for-android the latest source code directly from Git:


git clone git://git.videolan.org/vlc-ports/android.git


3. Compiling VLC source and VLC Android project


(1) Configuring the compilation environment variable


Specific reference wiki introduction, you can write a shell script to do, to avoid each compilation to be configured, below is my environment variable, can be modified according to your path:


#! /bin/shexport Android_sdk=/opt/android/sdk/export Android_ndk=/opt/android/android-ndk-r10/export ANT_DIR=/opt/ Android/ant/export path= $PATH: $ANDROID _sdk/platform-tools: $ANDROID _sdk/tools: $ANT _direxport android_abi= armeabi-v7a


(2) Perform compilation


SH compile.sh


VLC is worthy of using such a wide range of players, its compilation script is written very powerful and intelligent, directly by executing compile.sh, it will automatically check all dependencies and download the missing library through the network.


First, it will download VLC source code and store it in the current directory. Then go to download the dependent third-party library file.


Of course, due to the existence of GFW, sometimes the download will fail, this time, you need to manually go to Google search It is downloading the dependent files, manually downloaded and then placed in the Vlc/contrib/tarballs directory, and then back to the command line to re-execute SH compile.sh


All third-party library files it relies on:


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/54/51/wKioL1R-8zDTtDmZAAPrtC3xkEQ853.jpg "title=" Untitled. png "alt=" wkiol1r-8zdttdmzaaprtc3xkeq853.jpg "/>


(3) Compile problem


The compilation process was smooth and there was only one big problem, as follows:


google/protobuf/unittest.proto:853:21:missing field Number.google/protobuf/unittest.proto:862:1: Reached End of Input in message definition (missing '} '). Make[3]: * * * [Unittest_proto_middleman] Error 1


Online also can't find the solution, I looked down on GitHub Protobuf's readme, and then downloaded the latest protobuf put to vlc/contrib/tarballs/ Contrib-android-arm-linux-androideabi/protobuf directory, execute./configure--disable-shared, then compile, did not expect to go directly.


4. Loading the Java project for Vlc-for-android


After compiling the pass, you can see the debug version of the APK directly in the Vlc-android/bin directory, and the following is simply the whole project of loading vlc-android in eclipse.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/54/52/wKiom1R-8i7gNVkQAAB0RDllS6Y772.jpg "title=" 2.png " alt= "Wkiom1r-8i7gnvkqaab0rdlls6y772.jpg"/>

Open Eclipse, select Import, put all the works in the Vlc-for-android directory into eclipse (I removed the TV project), there are 5 required projects, of which VLC is the main project and the other four are LIB projects. No surprises, just run the VLC project and you can see the VLC Player app on your Android phone!


5. Summary


Vlc-for-android the compilation process is simply introduced here, have any questions welcome message discussion or letter [email protected] exchange.


This article is from the "Shadow Three People" blog, please be sure to keep this source http://ticktick.blog.51cto.com/823160/1586072

Android Development Practice: Compiling vlc-for-android

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.