JNI calls. A static library file

Source: Internet
Author: User

 

========================================================== =============================== Original blog, for reprinted, please declare the Source: lanyan -- Mobile Internet veterans ========================================== ==================================

The android project requires a total of FFMPEG, and the source code is introduced for ndk-build compilation. Every time it takes about 15 minutes, let's take the. A file compiled for use directly.

 

The competition on the internet is successful. Here we will share the script with you.

Create the Android. mk and application. mk files in the JNI directory, as shown in the following figure. Modify the corresponding content for compilation. OK.

Android. mk

 

# Copyright (c) 2009 the android open source project # licensed under the Apache license, version 2.0 (the "License "); # You may not use this file before t in compliance with the license. # You may obtain a copy of the license at # http://www.apache.org/licenses/LICENSE-2.0## unless required by applicable law or agreed to in writing, software # distributed under the license is distributed on an "as is" basis, # Without warranties or conditions of any kind, either express or implied. # See the license for the specific language governing permissions and # limitations under the license. # local_path: = $ (call my-DIR) include $ (clear_vars) local_module: = androidcamera local_src_files: = androidcamera. CPP \ cameraself/ccamdevice_init.c \ newbuffer/bufferqueue. CPP \ newbuffer/mymalloc. CPP \ cameraself/tcpchannel_connect.c \ newdecoder/decodelib. CPP \ cameraself/extensions \ Protocol: = libavformat libavcodec libswscale libavutil libpostproc ffmpeglocal_c_includes: = $ (local_path)/newbuffer \ $ (local_path)/newdecoder \ $ (local_path) /newdecoder/FFMPEG \ $ (local_path)/cameraself \ local_arm_mode: = kernel: =-runtime-I $ (local_path)/newdecoder/FFMPEG/local_ldlibs + =-lloginclude $ (kernel) include $ (call all-makefiles-under, $ (local_path)/newdecoder)

 

Application. mk

 

 
App_cflags + =-fexceptions # app_stl: = gnustl_staticapp_stl: = stlport_staticapp_abi: = armeabi

 

 

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.