//***************************************************************************************************// CWelsLib::CWelsLib (void* pEncCtx) { m_pInterface[0] = m_pInterface[1] = NULL; #ifndef NO_DYNAMIC_VP #if defined(_WIN32) const str_t WelsVPLib[] = "welsvp.dll"; HMODULE shModule = LoadLibrary (WelsVPLib); if (!shModule) WelsLog (pEncCtx, WELS_LOG_ERROR, "welsvp load lib dynamic failed module=%x\n", shModule); #elif defined(MACOS) const str_t WelsVPLib[] = "welsvp.bundle"; str_t pCurPath[256]; GetCurrentModulePath (pCurPath, 256); strlcat (pCurPath, WelsVPLib, 256); CFBundleRef shModule = LoadBundle (pCurPath); if (!shModule) WelsLog (pEncCtx, WELS_LOG_ERROR, "welsvp load lib dynamic failed module=%x\n", shModule); #elif defined(__GNUC__) const str_t WelsVPLib[] = "./libwelsvp.so"; void* shModule = NULL; shModule = dlopen (WelsVPLib, RTLD_LAZY); if (shModule == NULL) printf ("dlopen %s iRet=%x, err=%s\n", WelsVPLib, shModule, dlerror()); #endif m_pVpLib = (void*)shModule; #endif }
bool load_bundle_welsdec() { char achPath[512] = {0}; GetCurrentModulePath(achPath, 512); strlcat(achPath, H264DecoderDLL, 512); g_at264Module = LoadBundle(achPath); if (g_at264Module == NULL) return false; return true; }
int create_texture(std::string name) { std::string path = GetCurrentModulePath(); // includes trailing slash return createTexture((path + name).c_str()); }