I am working with Openh264 library. I worked before with this library in Linux environment. But I haven't found any working documentation to link openh264 library on Xcode.
I have tried other solutions to add .a or .so library files in Xcode like: i) How to import a C++ library into a Xcode Objective C project? ii) How to link or load shared libraries (.so) in Objective C?
But Unfortunately I failed each time. I got OpenH264 from this link: https://github.com/cisco/openh264 . I can execute demo encoder decoder project which is given by Openh264 library but I need help to link this library in my own project. Thanks in advance.
Here are the steps to integrate OpenH264 Library to any Xcode Project:
That's it... this is the procedure of building and linking openh264 library. Now you can easily call openh264 library functions. Here I am giving a simple working code of Encoder initialization calling OpenH264 library function.
//Adding Header files
#include "codec_api.h"
#include "codec_def.h"
//Calling OpenH264 Library function to initialize Encoder
- (IBAction)EncoderTestBtn:(id)sender {
NSLog(@"Inside EncoderTestBtn");
ISVCEncoder *pEncoder = NULL;
int iRet = -1;
iRet = WelsCreateSVCEncoder(&pEncoder);
if(iRet == 0)
{
NSLog(@"Rajib_Check: Encoder Initialization SUCCESSFUL");
}
else
{
NSLog(@"Rajib_Check: ERROR--> iRet returned with = %d", iRet);
}
}