版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
把底层库打包进 JAR的方法[1/3] 背景最近用到 JavaCV做直播项目,在从 github上下载了一个叫RtmpRecoder的项目时,发现RtmpRecoder用到了通过JavaCV运用到ffmpeg,于是下载了JavaCV-bin(javacv-1.2-src.zip),解压后发现里面只有jar包,却没有发现任何底层库----没有底层库怎么调到ffmpeg那?带着这个疑问, 按照《【JavaCV与Android】在Android工程里配置 JavaCV》里介绍的,解压了其中一个 jar文件ffmpeg-android-arm.jar,在目录javacv-bin/ffmpeg-android-arm/lib/armeabi 下果然发现有一堆动态库。第一次见到 JAR包中也可以包含底层库,很惊奇,就想知道是怎么做到的。就 google搜索了下,发现可以运用Jar2Lib和jace技术生成。此外,JavaCPP技术能便捷的实现把底层库打包进 JAR,能部分代替 JNI技术(但是不能代替底层回调Java层)。在此,贴出具体方法,以备查阅。 [2/3][转]JaceandJar2LibJar2LibLatestVersionJar2LibisacommandlinetoolforgeneratingC++wrapperlibrariesaroundJavaJARfiles.ItexposestheentirepublicJavaAPIoftheJARinthecorrespondingC++sharedlibrary,delegatingtoJavaviaJNI.ThewrappingisperformedusingJace.WeuseJar2LibtogeneratetheBF-CPPbindingsforBio-Formats,whichweuseinourWiscScanacquisitionsoftware.Historicalnote:Jar2LibwasoriginallydevelopedtointegrateBio-FormatswiththeInsightToolkit,forusewiththeFARSIGHTproject.However,wenowhaveandedicatedinter-processsolutionforITKintegrationinsteadwhichiseasiertobuildfromsource,sinceithasnocompile-timedependencies.Nonetheless,BF-CPPisstilltherecommendedin-processsolutionforBio-Formatsnativecodeintegration.Downloadjace-r39.jarWerecommendusingJar2Libviathecppwrap-maven-plugin;see"Installationandusage"below.IfyouprefertouseJar2LibdirectlyfromthecommandlineoutsideMaven:DownloadtheJARslinkedabove,aswellasApacheVelocity1.7anditsdependencies.WithallnecessaryJARsinyourcurrentworkingdirectory,youcanrunJar2Libonthecommandlineasfollows:library.jar[library2.jar...][-conflictsconflicts.txt][-headerheader.txt][-extrascmake_extras.txt][-output/path/to/output-project][-corejava_core_classes.txtLanguageJavaSourceCodejar2libInstallationandUsageTheeasiestwaytouseJar2LibisviaourcppwrapMavenplugin,whichtakesadvantageoftheMavenplug-ininfrastructuretoeasilyconvertaJavalibrarytoC++usingJar2Lib,withoutrequiringanyknowledgeofJar2Lib'sworkingsorsyntax.Forexample,itcircumventsanyneedtodownloadtransitivedependencies.更详细信息,请参考网址技术JavaCPP
是一个开源库,它提供了在
Java
中高效访问本地C++的方法。采用
JNI
技术实现,所以支持所有
Java
实现包括 Android 系统,Avian和RoboVM。3.1JavaCPPPresets--PrebuiltJavaBindingstoC/C++LibrariesThesearepartofaprojectthatwecalltheJavaCPPPresets.ManycoexistinthesameGitHubrepository,andalluseJavaCPPtowrappredefinedC/C++librariesfromopen-sourceland.ThebindingsexposealmostalloftherelevantAPIsandmakethemavailableinaportableanduser-friendlyfashiontoanyJavavirtualmachine(includingAndroid),asiftheywerelikeanyothernormalJavalibraries.WehavepresetsforthefollowingC/C++libraries:OpenCV–[sampleusage]–Morethan2500optimizedcomputervisionandmachinelearningalgorithmsFFmpeg–[sampleusage]–Acomplete,cross-platformsolutiontorecord,convertandstreamaudioandvideoFlyCapture–[sampleusage]–Imageacquisitionandcameracontrolsoftwarelibdc1394–[sampleusage]–Ahigh-levelAPIforDCAM/IIDCcamerasOpenKinect–[sampleusage]–OpensourcelibrarytousetheXboxKinectvideoInput–[sampleusage]–AfreeWindowsvideocapturelibraryARToolKitPlus –[sampleusage]–Marker-basedaugmentedrealitytrackinglibraryChilitags–[sampleusage]–Robustfiducialmarkersforaugmentedrealityandroboticsflandmark–[sampleusage]–Open-sourceimplementationoffaciallandmarkdetectorFFTW–[sampleusage]–FastcomputingofthediscreteFouriertransform(DFT)inoneormoredimensionsGSL–[sampleusage]–TheGNUScientificLibrary,anumericallibraryforCandC++programmersLLVM–[sampleusage]–AcollectionofmodularandreusablecompilerandtoolchaintechnologiesLeptonica–[sampleusage]–SoftwareusefulforimageprocessingandimageanalysisapplicationsTesseract–[sampleusage]–ProbablythemostaccurateopensourceOCRengineavailableCaffe–[sampleusage]–AfastopenframeworkfordeeplearningCUDA –[sampleusage]–ArguablythemostpopularparallelcomputingplatformforGPUsMXNet –[sampleusage]–FlexibleandefficientlibraryfordeeplearningTensorFlow–[sampleusage]–ComputationusingdataflowgraphsforscalablemachinelearningAddhereyourfavoriteC/C++library,forexample:OpenNI,OpenMesh,PCL,etc.Readabouthowtodo
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 妇科肿瘤手术中的代谢免疫调控策略
- 妇科恶性肿瘤靶向免疫联合治疗的优化方案
- 女职工职业健康监护特殊规范与实操
- 大数据驱动的库存周转优化策略
- 大数据在应急物资调度中的应用
- 台词考试诗词大全及答案
- 2025年中职(制冷和空调设备运行与维护)制冷系统安装测试题及答案
- 2025年中职国土资源调查与管理(测量实操)试题及答案
- 2026年绿色租赁创新模式项目评估报告
- 2025年中职包装设计(包装基础设计)试题及答案
- 器官移植术后排斥反应的风险分层管理
- 护坡绿化劳务合同范本
- 临床绩效的DRG与CMI双指标调控
- 2026年湛江日报社公开招聘事业编制工作人员备考题库及完整答案详解
- 2025-2026学年人教版数学三年级上学期期末仿真模拟试卷一(含答案)
- 2025年凉山教师业务素质测试题及答案
- 企业尽职调查内容提纲-中英文对照
- GB/T 18997.1-2020铝塑复合压力管第1部分:铝管搭接焊式铝塑管
- 物料提升机保养记录表
- 方志文献《兖州府志》
- 光伏电源项目工程建设管理资料表格格式汇编
评论
0/150
提交评论