- support new license & config data API from PVQA/AQuA
This commit is contained in:
@@ -184,6 +184,36 @@ bool SevanaPVQA::initializeLibrary(const std::string& pathToLicenseFile, const s
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SevanaPVQA::initializeLibraryWithData(const void* license_buffer, size_t license_len,
|
||||
const void* config_buffer, size_t config_len)
|
||||
{
|
||||
mPvqaLoaded = false;
|
||||
|
||||
ICELogInfo(<< "Sevana PVQA is about to be initialized via byte buffers.");
|
||||
|
||||
// Initialize PVQA library
|
||||
if (!mLibraryConfiguration)
|
||||
{
|
||||
mInstanceCounter = 0;
|
||||
mLibraryErrorCode = PVQA_InitLibWithLicData(license_buffer, license_len);
|
||||
if (mLibraryErrorCode)
|
||||
{
|
||||
ICELogError(<< "Problem when initializing PVQA library. Error code: " << mLibraryErrorCode);
|
||||
return false;
|
||||
}
|
||||
|
||||
mLibraryConfiguration = PVQA_LoadCFGData(config_buffer, config_len, &mLibraryErrorCode);
|
||||
if (!mLibraryConfiguration)
|
||||
{
|
||||
PVQA_ReleaseLib();
|
||||
ICELogError(<< "Problem with PVQA configuration file.");
|
||||
return false;
|
||||
}
|
||||
mPvqaLoaded = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SevanaPVQA::isInitialized()
|
||||
{
|
||||
return mPvqaLoaded;
|
||||
@@ -573,6 +603,11 @@ int SevanaAqua::initializeLibrary(const std::string& pathToLicenseFile)
|
||||
}
|
||||
|
||||
|
||||
int SevanaAqua::initializeLibrary(const void* buffer, size_t len)
|
||||
{
|
||||
return SSA_InitLibWithData(buffer, len);
|
||||
}
|
||||
|
||||
void SevanaAqua::releaseLibrary()
|
||||
{
|
||||
SSA_ReleaseLib();
|
||||
|
||||
@@ -77,6 +77,8 @@ public:
|
||||
static void setupAndroidEnvironment(void* environment, void* appcontext);
|
||||
#endif
|
||||
static bool initializeLibrary(const std::string& pathToLicenseFile, const std::string& pathToConfigFile);
|
||||
static bool initializeLibraryWithData(const void* license_buffer, size_t license_len,
|
||||
const void* config_buffer, size_t config_len);
|
||||
static bool isInitialized();
|
||||
|
||||
static int getLibraryError();
|
||||
@@ -144,6 +146,8 @@ protected:
|
||||
public:
|
||||
// Returns 0 (zero) on successful initialization, otherwise it is error code
|
||||
static int initializeLibrary(const std::string& pathToLicenseFile);
|
||||
static int initializeLibrary(const void* buffer, size_t len);
|
||||
|
||||
static void releaseLibrary();
|
||||
static std::string getVersion();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user