- support new license & config data API from PVQA/AQuA
This commit is contained in:
parent
8e4f2152d2
commit
2aff120468
|
|
@ -550,7 +550,7 @@ void AgentImpl::processGetMediaStats(Json::Value& request, Json::Value& answer)
|
|||
}
|
||||
MT::PSevanaAqua sa = mAquaMap[sessionIter->first];
|
||||
MT::SevanaAqua::AudioBuffer test(mAquaIncoming.data(), mAquaIncoming.size()),
|
||||
reference;
|
||||
reference(referenceAudio.data(), referenceAudio.size());
|
||||
test.mRate = AUDIO_SAMPLERATE; reference.mRate = AUDIO_SAMPLERATE;
|
||||
test.mChannels = AUDIO_CHANNELS; reference.mChannels = AUDIO_CHANNELS;
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue