jin封装ffmpeg库遇到的问题汇总

1、编译时遇到问题

1.编译的时候出现如下错误:

.........

/Users/zhaodebo/workspace/code/MyNdk/app/src/main/jni/include/libavutil/imgutils.h:80:28: error: 'uint8_t' was not declared in this scope
/Users/zhaodebo/workspace/code/MyNdk/app/src/main/jni/include/libavutil/imgutils.h:80:37: error: 'data' was not declared in this scope
/Users/zhaodebo/workspace/code/MyNdk/app/src/main/jni/include/libavutil/imgutils.h:80:46: error: expected primary-expression before 'enum'
/Users/zhaodebo/workspace/code/MyNdk/app/src/main/jni/include/libavutil/imgutils.h:80:74: error: expected primary-expression before 'int'
/Users/zhaodebo/workspace/code/MyNdk/app/src/main/jniinclude/libavutil/imgutils.h:81:28: error: 'uint8_t' was not declared in this scope
/Users/zhaodebo/workspace/code/MyNdk/app/src/main/jni/include/libavutil/imgutils.h:81:37: error: 'ptr' was not declared in this scope
/Users/zhaodebo/workspace/code/MyNdk/app/src/main/jniinclude/libavutil/imgutils.h:81:42: error: expected primary-expression before 'const'
/Users/zhaodebo/workspace/code/MyNdk/app/src/main/jni/include/libavutil/imgutils.h:81:64: error: expression list treated as compound expression in initializer [-fpermissive]
/Users/zhaodebo/workspace/code/MyNdk/app/src/main/jni/include/libavutil/imgutils.h:93:20: error: 'uint8_t' was not declared in this scope
.......

解决办法:这是因为找不到uint8_t这些定义,网上说什么修改ffmpeg里面的某个common.h头文件加上这些定义什么的呀,其实完全不用这么做,本身有个系统文件是有这些定义的,加上头文件#include <inttypes.h>即可,注意需要加在引用ffmpeg头文件之前

此问题解决办法引用:http://blog.csdn.net/cjj198561/article/details/33417965


2、编译时遇到问题

/Users/zhaodebo/workspace/code/MyNdk/app/src/main/jni/include/libavutil/common.h: In function 'int32_t av_clipl_int32_c(int64_t)':
/Users/zhaodebo/workspace/code/MyNdk/app/src/main/jni/include/libavutil/common.h:205:47: error: 'UINT64_C' was not declared in this scope

解决办法:这个时候需要手动在你的代码里面加上几句代码,注意需要加在引用ffmpeg头文件之前。直接上代码:


#ifndef __MICloudPub___H264Decoder__
#define __MICloudPub___H264Decoder__

#ifndef UINT64_C
#define UINT64_C(value) __CONCAT(value, ULL)
#endif

#endif


3、编译出现问题:

/Users/zhaodebo/workspace/code/MyNdk/app/src/main/jni/MyLibrary.cpp:19: error: undefined reference to 'avcodec_register_all()'
collect2: error: ld returned 1 exit status

明明有这个头文件和函数,但就是找不到。


解决办法:

在Android.mk中添加如下一句话:

LOCAL_ALLOW_UNDEFINED_SYMBOLS := true

4、问题:

/Users/zhaodebo/workspace/code/MyNdk/app/src/main/jni/include/libavutil/avutil.h:209:1: error: expected initializer before 'ring'
 ring(enum AVMediaType media_type);


解决办法:

关键词“expected initializer before...”是说在before后面提示地方附近有语法错误,注意排查。





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值