Using a C library in my iphone app (ffmpeg)
I want to use the ffmpeg library (and maybe others) in my iPhone App. But I have absolutly no idea how I can use the files that are in the downloaded zip, and get them to work in my XCode project.
I read something about .a files and frameworks. Maybe you can give me a descr开发者_如何学编程iption how to implement it?
1st, you're not allowed to do anything with open-source on apple market : basically, any open-source library tainting your code (thus GPL, but also LGPL as dynamic linking is forbidden) will have your application removed if spotted. The VLC case (removed from app store) proved that GPL is not compatible for app store license (look for app store and gpl and google and you'll find hundreds of links)
Second, you have to transform the code you received (say source code) into a static library (a .a
file). To do that, you need to compile it, here you have basically 3 solutions:
- put all the files into your xcode project and tweak until it works (thus not creating static library, directly merging the code with yours) : this seems the easiest, but will be a nightmare in terms of maintenance (each time you'll want to upgrade the statuc lib)
- compile externally, by hacking the makefile to use the correct compiler (the one in for ios, in iphone platform folder)
- add a subproject in your xcode project to compile the library
My advice goes for 2 (that's what I do with boost) but it's not a straight path
EDIT : don't forget that software video decoding will drain your battery and you might have poor performance
精彩评论