2012-04-05 32 views
0

我知道,要在iOS應用程序中使用FFmpeg,請使用./configure和make生成將添加到項目中的.a文件。ffmpeg在iOS上使用

我的問題是,一旦.a文件出現在項目導航器和Link Binary With Libraries部分中,您如何在類中實際使用它們?我發現沒有「框架」可用於一個#import語句,所以我不知道如何訪問類的方法和屬性。

回答

0

每個.a文件都有一些實現文件,每個實現文件都有一個接口文件,objc-c實現文件是.m/.mm,接口文件是.h,如C/C++,所以如果你想使用該庫,您需要導入頭文件(.h)。頭文件可以告訴你類的方法和屬性

1

你只需要將頭文件(.h)導入到實現(.m)文件中並繼續。舉個例子 ;

#import "avformat.h" 

// Some code goes here 

    /* 
    * avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options) 
    */ 
    int openInputValue = avformat_open_input(&pFormatCtx, utf8FilePath, inputFormat, nil); 
    NSLog(@"%s - %d # openInputValue = %d", __PRETTY_FUNCTION__, __LINE__, openInputValue);