海思MPP移植到eclipse下实现在eclipse下用海思交叉编译器实现编译

 
  

题记:为了将视频采集及压缩部分代码,和live555糅合到一起。想先将海思MPP移植到eclipse下实现在eclipse下用海思交叉编译器实现编译,实现在eclipse下编译出可执行文件然后放到海思开发平台下运行。这样就可以再接下来的将live555糅合后可以实行。以下是主要过程:

新建一个工程后要将 各个.c文件放到SRC目录下。  

海思MPP移植到eclipse下实现在eclipse下用海思交叉编译器实现编译_第1张图片


2 将用到的头文件放到指定目录下,注意要必须是所有头文件,下图是路径,我建立了个文件夹hi_include

其中下图中的hi...是hi_include,hi_incldue放的是MPP用到的所有头文件。
海思MPP移植到eclipse下实现在eclipse下用海思交叉编译器实现编译_第2张图片

3 将库函数进行配置。我放在了hi_lib文件夹下,并且在工程文件里还要添加库文件路径。主要各个库文件之间有严格的依赖关系,顺序不能颠倒。

我是先根据MPP的sample_venc目录下make命令后的变异顺序所依赖的库文件进行配置,make之后


arm-hisiv100nptl-linux-gcc -Wall -g -I/home/frank/hi3518/mpp/sample/venc/../common -I/home/frank/hi3518/mpp/include -I/home/frank/
hi3518/mpp/component/acodec -I/home/frank/hi3518/mpp/extdrv/tw2865 -Dhi3518 -DHICHIP=0x35180100 -DSENSOR_TYPE=APTINA_AR0130_DC_720P_
30FPS -DHI_DEBUG -DHI_XXXX -lpthread -lm -lpthread -lm -o sample_venc sample_venc.o /home/frank/hi3518/mpp/sample/venc/../common/loa
dbmp.o /home/frank/hi3518/mpp/sample/venc/../common/sample_comm_audio.o /home/frank/hi3518/mpp/sample/venc/../common/sample_comm_isp
.o /home/frank/hi3518/mpp/sample/venc/../common/sample_comm_sys.o /home/frank/hi3518/mpp/sample/venc/../common/sample_comm_vda.o /ho
me/frank/hi3518/mpp/sample/venc/../common/sample_comm_venc.o /home/frank/hi3518/mpp/sample/venc/../common/sample_comm_vi.o /home/fra
nk/hi3518/mpp/sample/venc/../common/sample_comm_vo.o /home/frank/hi3518/mpp/sample/venc/../common/sample_comm_vpss.o /home/frank/hi3
518/mpp/lib/libmpi.a /home/frank/hi3518/mpp/lib/libVoiceEngine.a /home/frank/hi3518/mpp/lib/libaec.a /home/frank/hi3518/mpp/lib/libr
esampler.a /home/frank/hi3518/mpp/lib/libanr.a /home/frank/hi3518/mpp/lib/libisp.a /home/frank/hi3518/mpp/lib/libsns_ar0130_720p.a
 
  然后,eclipse配置: 
  

海思MPP移植到eclipse下实现在eclipse下用海思交叉编译器实现编译_第3张图片

编译的时候出现错误:

Building file: ../Src/loadbmp.c
Invoking: Cross GCC Compiler
arm-hisiv100nptl-linux-gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Src/loadbmp.d" -MT"Src/loadbmp.d" -o "Src/loadbmp.o" "../Src/loadbmp.c"
Finished building: ../Src/loadbmp.c
 
Building file: ../Src/sample_comm_audio.c
Invoking: Cross GCC Compiler
arm-hisiv100nptl-linux-gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Src/sample_comm_audio.d" -MT"Src/sample_comm_audio.d" -o "Src/sample_comm_audio.o" "../Src/sample_comm_audio.c"
Finished building: ../Src/sample_comm_audio.c
 
Building file: ../Src/sample_comm_isp.c
Invoking: Cross GCC Compiler
arm-hisiv100nptl-linux-gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Src/sample_comm_isp.d" -MT"Src/sample_comm_isp.d" -o "Src/sample_comm_isp.o" "../Src/sample_comm_isp.c"
Finished building: ../Src/sample_comm_isp.c
 
Building file: ../Src/sample_comm_sys.c
Invoking: Cross GCC Compiler
arm-hisiv100nptl-linux-gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Src/sample_comm_sys.d" -MT"Src/sample_comm_sys.d" -o "Src/sample_comm_sys.o" "../Src/sample_comm_sys.c"
Finished building: ../Src/sample_comm_sys.c
 
Building file: ../Src/sample_comm_vda.c
Invoking: Cross GCC Compiler
arm-hisiv100nptl-linux-gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Src/sample_comm_vda.d" -MT"Src/sample_comm_vda.d" -o "Src/sample_comm_vda.o" "../Src/sample_comm_vda.c"
Finished building: ../Src/sample_comm_vda.c
 
Building file: ../Src/sample_comm_venc.c
Invoking: Cross GCC Compiler
arm-hisiv100nptl-linux-gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Src/sample_comm_venc.d" -MT"Src/sample_comm_venc.d" -o "Src/sample_comm_venc.o" "../Src/sample_comm_venc.c"
Finished building: ../Src/sample_comm_venc.c
 
Building file: ../Src/sample_comm_vi.c
Invoking: Cross GCC Compiler
arm-hisiv100nptl-linux-gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Src/sample_comm_vi.d" -MT"Src/sample_comm_vi.d" -o "Src/sample_comm_vi.o" "../Src/sample_comm_vi.c"
Finished building: ../Src/sample_comm_vi.c
 
Building file: ../Src/sample_comm_vo.c
Invoking: Cross GCC Compiler
arm-hisiv100nptl-linux-gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Src/sample_comm_vo.d" -MT"Src/sample_comm_vo.d" -o "Src/sample_comm_vo.o" "../Src/sample_comm_vo.c"
Finished building: ../Src/sample_comm_vo.c
 
Building file: ../Src/sample_comm_vpss.c
Invoking: Cross GCC Compiler
arm-hisiv100nptl-linux-gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Src/sample_comm_vpss.d" -MT"Src/sample_comm_vpss.d" -o "Src/sample_comm_vpss.o" "../Src/sample_comm_vpss.c"
Finished building: ../Src/sample_comm_vpss.c
 
Building file: ../Src/sample_venc.cpp
Invoking: Cross G++ Compiler
arm-hisiv100nptl-linux-g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Src/sample_venc.d" -MT"Src/sample_venc.d" -o "Src/sample_venc.o" "../Src/sample_venc.cpp"
Finished building: ../Src/sample_venc.cpp
 
Building target: hi_MPP
Invoking: Cross G++ Linker
arm-hisiv100nptl-linux-g++ -L/opt/hisi-linux-nptl/arm-hisiv100-linux/target/usr/lib/hi_lib -o "hi_MPP"  ./Src/loadbmp.o ./Src/sample_comm_audio.o ./Src/sample_comm_isp.o ./Src/sample_comm_sys.o ./Src/sample_comm_vda.o ./Src/sample_comm_venc.o ./Src/sample_comm_vi.o ./Src/sample_comm_vo.o ./Src/sample_comm_vpss.o ./Src/sample_venc.o   -lmpi -lVoiceEngine -laec -lresampler -lanr -lisp -lsns_ar0130_720p
/opt/hisi-linux-nptl/arm-hisiv100-linux/target/usr/lib/hi_lib/libmpi.a(mpi_adec.o): In function `HI_MPI_ADEC_ReleaseFrame':
mpi_adec.c:(.text+0x648): undefined reference to `sem_getvalue'
mpi_adec.c:(.text+0x6f0): undefined reference to `sem_post'
/opt/hisi-linux-nptl/arm-hisiv100-linux/target/usr/lib/hi_lib/libmpi.a(mpi_adec.o): In function `HI_MPI_ADEC_GetFrame':
mpi_adec.c:(.text+0x928): undefined reference to `sem_wait'
mpi_adec.c:(.text+0x9dc): undefined reference to `sem_getvalue'
/opt/hisi-linux-nptl/arm-hisiv100-linux/target/usr/lib/hi_lib/libmpi.a(mpi_adec.o): In function `MPI_ADEC_SendStream':
mpi_adec.c:(.text+0x1074): undefined reference to `sem_getvalue'
mpi_adec.c:(.text+0x1128): undefined reference to `sem_wait'
mpi_adec.c:(.text+0x124c): undefined reference to `sem_post'
mpi_adec.c:(.text+0x137c): undefined reference to `sem_getvalue'
mpi_adec.c:(.text+0x1398): undefined reference to `sem_wait'
mpi_adec.c:(.text+0x14c0): undefined reference to `sem_post'
mpi_adec.c:(.text+0x1734): undefined reference to `sem_post'
mpi_adec.c:(.text+0x1788): undefined reference to `sem_post'
mpi_adec.c:(.text+0x1988): undefined reference to `sem_post'
mpi_adec.c:(.text+0x19e4): undefined reference to `sem_post'
/opt/hisi-linux-nptl/arm-hisiv100-linux/target/usr/lib/hi_lib/libmpi.a(mpi_adec.o): In function `MPI_ADEC_ClearChnBuf':
mpi_adec.c:(.text+0x1fa0): undefined reference to `sem_getvalue'
mpi_adec.c:(.text+0x1fac): undefined reference to `sem_getvalue'
mpi_adec.c:(.text+0x1fec): undefined reference to `sem_trywait'
mpi_adec.c:(.text+0x2018): undefined reference to `sem_post'
mpi_adec.c:(.text+0x203c): undefined reference to `sem_getvalue'
mpi_adec.c:(.text+0x2088): undefined reference to `sem_post'
mpi_adec.c:(.text+0x2094): undefined reference to `sem_post'
/opt/hisi-linux-nptl/arm-hisiv100-linux/target/usr/lib/hi_lib/libmpi.a(mpi_adec.o): In function `MPI_ADEC_DestroyChn':
mpi_adec.c:(.text+0x22b4): undefined reference to `sem_getvalue'
mpi_adec.c:(.text+0x22c0): undefined reference to `sem_getvalue'
mpi_adec.c:(.text+0x23d8): undefined reference to `sem_getvalue'
mpi_adec.c:(.text+0x23e4): undefined reference to `sem_getvalue'
mpi_adec.c:(.text+0x23fc): undefined reference to `sem_post'
mpi_adec.c:(.text+0x2410): undefined reference to `sem_post'
mpi_adec.c:(.text+0x2454): undefined reference to `sem_destroy'
mpi_adec.c:(.text+0x2464): undefined reference to `sem_destroy'
mpi_adec.c:(.text+0x2534): undefined reference to `sem_post'
mpi_adec.c:(.text+0x259c): undefined reference to `sem_destroy'
mpi_adec.c:(.text+0x25ec): undefined reference to `sem_post'
mpi_adec.c:(.text+0x2620): undefined reference to `pthread_join'
/opt/hisi-linux-nptl/arm-hisiv100-linux/target/usr/lib/hi_lib/libmpi.a(mpi_adec.o): In function `MPI_ADEC_CreateChn':
mpi_adec.c:(.text+0x2af8): undefined reference to `sem_init'
mpi_adec.c:(.text+0x2b10): undefined reference to `sem_init'
mpi_adec.c:(.text+0x2b8c): undefined reference to `pthread_create'
./Src/sample_comm_audio.o: In function `SAMPLE_COMM_AUDIO_CreatTrdAiAo':
/home/frank/workspace1/hi_MPP/Debug/../Src/sample_comm_audio.c:291: undefined reference to `pthread_create'
./Src/sample_comm_audio.o: In function `SAMPLE_COMM_AUDIO_CreatTrdAiAenc':
/home/frank/workspace1/hi_MPP/Debug/../Src/sample_comm_audio.c:310: undefined reference to `pthread_create'
./Src/sample_comm_audio.o: In function `SAMPLE_COMM_AUDIO_CreatTrdAencAdec':
/home/frank/workspace1/hi_MPP/Debug/../Src/sample_comm_audio.c:333: undefined reference to `pthread_create'
./Src/sample_comm_audio.o: In function `SAMPLE_COMM_AUDIO_CreatTrdFileAdec':
/home/frank/workspace1/hi_MPP/Debug/../Src/sample_comm_audio.c:354: undefined reference to `pthread_create'
./Src/sample_comm_audio.o: In function `SAMPLE_COMM_AUDIO_DestoryTrdAi':
/home/frank/workspace1/hi_MPP/Debug/../Src/sample_comm_audio.c:368: undefined reference to `pthread_join'
./Src/sample_comm_audio.o: In function `SAMPLE_COMM_AUDIO_DestoryTrdAencAdec':
/home/frank/workspace1/hi_MPP/Debug/../Src/sample_comm_audio.c:382: undefined reference to `pthread_join'
./Src/sample_comm_audio.o: In function `SAMPLE_COMM_AUDIO_DestoryTrdFileAdec':
/home/frank/workspace1/hi_MPP/Debug/../Src/sample_comm_audio.c:396: undefined reference to `pthread_join'
./Src/sample_comm_isp.o: In function `SAMPLE_COMM_ISP_Run':
/home/frank/workspace1/hi_MPP/Debug/../Src/sample_comm_isp.c:589: undefined reference to `pthread_create'
./Src/sample_comm_isp.o: In function `SAMPLE_COMM_ISP_Stop':
/home/frank/workspace1/hi_MPP/Debug/../Src/sample_comm_isp.c:678: undefined reference to `pthread_join'
./Src/sample_comm_vda.o: In function `SAMPLE_COMM_VDA_MdStart':
/home/frank/workspace1/hi_MPP/Debug/../Src/sample_comm_vda.c:371: undefined reference to `pthread_create'
./Src/sample_comm_vda.o: In function `SAMPLE_COMM_VDA_OdStart':
/home/frank/workspace1/hi_MPP/Debug/../Src/sample_comm_vda.c:452: undefined reference to `pthread_create'
./Src/sample_comm_vda.o: In function `SAMPLE_COMM_VDA_MdStop':
/home/frank/workspace1/hi_MPP/Debug/../Src/sample_comm_vda.c:469: undefined reference to `pthread_join'
./Src/sample_comm_vda.o: In function `SAMPLE_COMM_VDA_OdStop':
/home/frank/workspace1/hi_MPP/Debug/../Src/sample_comm_vda.c:516: undefined reference to `pthread_join'
./Src/sample_comm_venc.o: In function `SAMPLE_COMM_VENC_StartGetStream':
/home/frank/workspace1/hi_MPP/Debug/../Src/sample_comm_venc.c:1014: undefined reference to `pthread_create'
./Src/sample_comm_venc.o: In function `SAMPLE_COMM_VENC_StopGetStream':
/home/frank/workspace1/hi_MPP/Debug/../Src/sample_comm_venc.c:1025: undefined reference to `pthread_join'
/opt/hisi-linux-nptl/arm-hisiv100-linux/target/usr/lib/hi_lib/libmpi.a(mpi_aenc.o): In function `MPI_AENC_DestroyGetFrmProc':
mpi_aenc.c:(.text+0x30): undefined reference to `pthread_join'
/opt/hisi-linux-nptl/arm-hisiv100-linux/target/usr/lib/hi_lib/libmpi.a(mpi_aenc.o): In function `MPI_AENC_CreateGetFrmProc':
mpi_aenc.c:(.text+0x8c): undefined reference to `pthread_create'
collect2: ld returned 1 exit status
make: *** [hi_MPP] 错误 1
然后发现缺少libpthread.a这个库文件,加上后正确

00:13:42 **** Incremental Build of configuration Debug for project hi_MPP ****
make all
make: 没有什么可以做的为 `all'。

那么接下来,我就可以进一步分析代码,争取可以尽快移植到Live555上,实现糅合

头文件下载链接

工程链接地址

你可能感兴趣的:(海思开发)