Example #1
0
//***************************************************************************************************//
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
}
nsresult
sbStringBundle::LoadBundle(nsIStringBundle* aBundle)
{
  // Validate arguments.
  NS_ENSURE_ARG_POINTER(aBundle);

  // Function variables.
  nsresult rv;

  // Add the string bundle to the list of string bundles.
  mStringBundleList.AppendObject(aBundle);

  // Get the list of included string bundles.
  nsTArray<nsString> includeBundleList;
  nsAutoString includeBundleListString;
  rv = aBundle->GetStringFromName
                  (NS_LITERAL_STRING("include_bundle_list").get(),
                   getter_Copies(includeBundleListString));
  if (NS_SUCCEEDED(rv)) {
    nsString_Split(includeBundleListString,
                   NS_LITERAL_STRING(","),
                   includeBundleList);
  }

  // Load each of the included string bundles.
  PRUint32 bundleCount = includeBundleList.Length();
  for (PRUint32 i = 0; i < bundleCount; i++) {
    rv = LoadBundle(includeBundleList[i]);
    NS_ENSURE_SUCCESS(rv, rv);
  }

  return NS_OK;
}
Example #3
0
int32_t WelsEncBundleLoad() {

  char achPath[512] = {0};

  WelsEncGetCurrentModulePath (achPath, 512);
  strlcat (achPath, H264EncoderDLL, 512);

  g_at264Module = LoadBundle (achPath);

  if (g_at264Module == NULL)
    return 1;
  else
    return 0;
}
nsresult
sbStringBundle::Initialize()
{
  nsresult rv;

  // Get the base string bundle service.
  mBaseStringBundleService = do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
  NS_ENSURE_SUCCESS(rv, rv);

  // Load the string bundle.
  rv = LoadBundle(mBaseStringBundle);
  NS_ENSURE_SUCCESS(rv, rv);

  return NS_OK;
}
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;

}
nsresult
sbStringBundle::LoadBundle(nsAString& aBundleURLSpec)
{
  nsresult rv;

  // Create a new bundle.
  nsCOMPtr<nsIStringBundle> bundle;
  rv = mBaseStringBundleService->CreateBundle
         (NS_ConvertUTF16toUTF8(aBundleURLSpec).BeginReading(),
          getter_AddRefs(bundle));
  NS_ENSURE_SUCCESS(rv, rv);

  // Load the bundle.
  rv = LoadBundle(bundle);
  NS_ENSURE_SUCCESS(rv, rv);

  return NS_OK;
}