AudioDevice *AudioDeviceFactory::create(const std::string &name,
                                        const std::string &dev_name)
{
  CreatorMap::iterator it = creator_map.find(name);
  if (it == creator_map.end())
  {
    return 0;
  }
  return it->second(dev_name);
} /* AudioDeviceFactory::create */
Пример #2
0
StreamHandler* StreamHandlerFactory::createHandlerForStream(AVStream* stream)
{
	if(!g_creatorMap)
		return 0;
	
	int codecID = stream->codec->codec_id;
	CreatorMap::iterator it = g_creatorMap->find(codecID);
	
	if(it == g_creatorMap->end())
		return 0;
	
	return it->second(stream);
}