Skip to content
ck edited this page Jun 26, 2017 · 2 revisions

Welcome to the v4l2test wiki!

how to build v4l2test project ?

  • setup build enviroment

  • build ffmpeg for android

  • build v4l2test project

  • build CameraDVR apk

first setup the build enviroment. we need a ubuntu PC or server, which install all the package for building android source (refer to http://source.android.com/ and https://developer.android.com/). download the whole android source code and build.

install the android standalone toolchain

you can download from:

link: https://pan.baidu.com/s/1sl6ULOx
passcode: 4aj6

extra toolchain package, and set the PATH enviroment variable:

tar xvf arm-linux-androideabi-4.7.1-full-linux-x86.tar.bz2 $HOME
echo "export PATH=$PATH:$HOME/arm-linux-androideabi-4.7.1/bin" >> $HOME/.bashrc
source $HOME/.bashrc
arm-linux-androideabi-gcc -v

download the v4l2test source code

git clone https://github.com/rockcarry/v4l2test.git

build ffmpeg for android

cd $HOME/v4l2test/ffmpeg
./build_ffmpeg_for_android.sh

build v4l2test project

make sure android source code have already build successed.

cd $HOME/android-source-dir/
cp -r $HOME/v4l2test .

source build/envsetup.sh
lunch
(pick a combo for lunch)

cd v4l2test
mm -B

build CameraDVR apk

cd $HOME/android-source-dir/
git clone https://github.com/rockcarry/CameraDVR.git
cd CameraDVR
mm -B

libffrecorder_jni.so file of CameraDVR comes from the build result of v4l2test project. when debugging, if modifies the v4l2test project source code, we need build and update libffrecorder_jni.so for CameraDVR project.

others

all source codes are debuged on AllWinner A33 android 4.4 platform. codes directly access /dev/video* devices, so we need fix the permisson issue when porting to other platform.

I have the android source of AllWinner A33, so I did not test how to build v4l2test using NDK. In theory, it's possible to build v4l2test using NDK. but I am not sure and also don't know how.

if someone find the way and build successfuly using NDK, please tell me, appreciate for sharing experience with me.

some SoC platform dose not implements the standard linux v4l2 video device, such as qcom. so if want to use this project on it, we need change the source code.