bilibili / ijkplayer

Android/iOS video player based on FFmpeg n3.4, with MediaCodec, VideoToolbox support.
GNU General Public License v2.0
32.42k stars 8.11k forks source link

AVMediaType iOS11 重复定义 #3604

Open ghost opened 6 years ago

ghost commented 6 years ago

FFMpeg 中 定义了 “enum AVMediaType”,iOS 11中AVFoundation中新增了一个定义“typedef NSString * AVMediaType NS_EXTENSIBLE_STRING_ENUM;”,调试工具xcode9,报重复定义的冲突,请问有办法解决或者绕过去吗?

ghost commented 6 years ago

0.8.1 demo 编译过程没有出现“ AVMediaType”重复定义的提示 ,但是 ios 10 运行正常, ios 11 无法播放,播放的视频是online sample是中的在线视频

ghost commented 6 years ago

0.8.3版本demo 正常, 但移植到工程之后,提示 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMediaFormat.h:14:20: Typedef redefinition with different types ('NSString ' vs 'AVMediaType') 个人理解是 FFMpeg 中的 “enum AVMediaType”, 与 AVFoundation 中的 “typedef NSString AVMediaType 。。。“ 冲突,请问如何解决这个问题,谢谢

ghost commented 6 years ago

导入工程的方式是,ijkplayer 源代码的拷贝,没有制作成framework,因为需要修改部分源代码,增加接口

WyProjectStorage commented 6 years ago

同样的问题,解决了么?

WyProjectStorage commented 6 years ago

@yhm

marlin2023 commented 6 years ago

修改ffmpeg源码中enum AVMediaType 变量名字,重新编译。

WyProjectStorage commented 6 years ago

@chris-magic 主要是找不到FFmpeg的源码

marlin2023 commented 6 years ago

去官网搞 ffmpeg.org

ghost commented 6 years ago

@WyProjectStorage 修改AVMediaType,改成别的名字, 改十处八处也就,不多

pedrovillarruel commented 6 years ago

Go to your files that call 'AVMediaType' such as ffmpeg and change the permissions in each file 'GetInfo' give yourself write and read access. Open the files in ffmpeg avutil.h in another program (I used Sublime) and edit your file as needed. Do this for all your files that use the AVMediaType in your project that are giving you the name error.

Do not change anything in the AVFoundation Framework, only make changes to your project files such as when using ffmpeg and files avutil.h, avcodec.h, avformat.h