【问题标题】:ffmpeg use on iOSffmpeg 在 iOS 上的使用
【发布时间】:2012-04-19 15:31:06
【问题描述】:

我了解要在 iOS 应用程序中使用 FFmpeg,您需要使用 ./configure 和 make 来生成 .a 文件,然后将其添加到项目中。

我的问题是,一旦 .a 文件出现在项目导航器和 Link Binary With Libraries 部分中,你如何在你的类中实际使用它们?我看到没有“框架”可以在#import 语句,所以我不知道如何访问类的方法和属性。

【问题讨论】:

    标签: iphone c++ c ios ffmpeg


    【解决方案1】:

    每个.a文件都有一些实现文件,每个实现文件都有一个接口文件,objc-c的实现文件是.m/.mm,接口文件是.h和C/C++一样,所以如果你想使用库,您需要导入头文件(.h)。头文件可以告诉你类的方法和属性

    【讨论】:

      【解决方案2】:

      您只需将头文件 (.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);
      

      【讨论】:

        猜你喜欢
        • 2017-11-03
        • 2016-05-11
        • 2016-06-23
        • 2022-12-13
        • 2016-11-08
        • 2020-01-17
        • 2016-03-15
        • 2021-05-10
        • 2020-04-26
        相关资源
        最近更新 更多