void MediaPlayerFactory::registerBuiltinFactories() {
    Mutex::Autolock lock_(&sLock);

    if (sInitComplete)
        return;

    registerFactory_l(new StagefrightPlayerFactory(), STAGEFRIGHT_PLAYER);
    registerFactory_l(new NuPlayerFactory(), NU_PLAYER);
    registerFactory_l(new TestPlayerFactory(), TEST_PLAYER);

    sInitComplete = true;
}
void MediaPlayerFactory::registerBuiltinFactories() {
    Mutex::Autolock lock_(&sLock);

    if (sInitComplete)
        return;

#ifdef FSL_GM_PLAYER
    registerFactory_l(new OMXPlayerFactory(), OMX_PLAYER);
#endif
    registerFactory_l(new StagefrightPlayerFactory(), STAGEFRIGHT_PLAYER);
    registerFactory_l(new NuPlayerFactory(), NU_PLAYER);
    registerFactory_l(new SonivoxPlayerFactory(), SONIVOX_PLAYER);
    registerFactory_l(new TestPlayerFactory(), TEST_PLAYER);

    sInitComplete = true;
}
void MediaPlayerFactory::registerBuiltinFactories() {
    Mutex::Autolock lock_(&sLock);

    if (sInitComplete)
        return;

    registerFactory_l(new StagefrightPlayerFactory(), STAGEFRIGHT_PLAYER);
    registerFactory_l(new NuPlayerFactory(), NU_PLAYER);
    registerFactory_l(new SonivoxPlayerFactory(), SONIVOX_PLAYER);
    registerFactory_l(new TestPlayerFactory(), TEST_PLAYER);

    const char* FACTORY_LIB           = "libdashplayer.so";
    const char* FACTORY_CREATE_FN     = "CreateDASHFactory";

    MediaPlayerFactory::IFactory* pFactory  = NULL;
    void* pFactoryLib = NULL;
    typedef MediaPlayerFactory::IFactory* (*CreateDASHDriverFn)();
    ALOGE("calling dlopen on FACTORY_LIB");
    pFactoryLib = ::dlopen(FACTORY_LIB, RTLD_LAZY);
    if (pFactoryLib == NULL) {
      ALOGE("Failed to open FACTORY_LIB Error : %s ",::dlerror());
    } else {
      CreateDASHDriverFn pCreateFnPtr;
      ALOGE("calling dlsym on pFactoryLib for FACTORY_CREATE_FN ");
      pCreateFnPtr = (CreateDASHDriverFn) dlsym(pFactoryLib, FACTORY_CREATE_FN);
      if (pCreateFnPtr == NULL) {
          ALOGE("Could not locate pCreateFnPtr");
      } else {
        pFactory = pCreateFnPtr();
        if(pFactory == NULL) {
          ALOGE("Failed to invoke CreateDASHDriverFn...");
        } else {
          ALOGE("registering DASH Player factory...");
          registerFactory_l(pFactory,DASH_PLAYER);
        }
      }
    }
    sInitComplete = true;
}
status_t MediaPlayerFactory::registerFactory(IFactory* factory,
                                             player_type type) {
    Mutex::Autolock lock_(&sLock);
    return registerFactory_l(factory, type);
}