コード例 #1
0
/**
 * 	\fn ADM_av_loadPlugins
 *  \brief load all audio device plugins
 */
uint8_t ADM_av_loadPlugins(const char *path)
{
#define MAX_EXTERNAL_FILTER 100

	char *files[MAX_EXTERNAL_FILTER];
	uint32_t nbFile;


    // PushBack our dummy one : TODO FIXME
    ADM_AudioDevices *dummyDevice=new ADM_AudioDevices("Dummy","Dummy audio device", 
                                DummyGetVersion,
                                DummyCreateAudioDevice,
                                DummyDeleteAudioDevice);
    
    ListOfAudioDevices.append(dummyDevice); 
	memset(files,0,sizeof(char *)*MAX_EXTERNAL_FILTER);
	printf("[ADM_av_plugin] Scanning directory %s\n",path);

	if(!buildDirectoryContent(&nbFile, path, files, MAX_EXTERNAL_FILTER, SHARED_LIB_EXT))
	{
		printf("[ADM_av_plugin] Cannot parse plugin\n");
		return 0;
	}

	for(int i=0;i<nbFile;i++)
		tryLoadingFilterPlugin(files[i]);

	printf("[ADM_av_plugin] Scanning done\n");
        clearDirectoryContent(nbFile,files);

	return 1;
}
コード例 #2
0
/**
 * \fn parseFolder
 * @param folder
 */
static void parseFolder(const char *folder) 
{
        char *files[MAX_EXTERNAL_FILTER];
    uint32_t nbFile;

    memset(files,0,sizeof(char *)*MAX_EXTERNAL_FILTER);
    printf("[ADM_ve6_plugin] Scanning directory %s\n",folder);

    if(!buildDirectoryContent(&nbFile, folder, files, MAX_EXTERNAL_FILTER, SHARED_LIB_EXT))
    {
        printf("[ADM_ve6_plugin] Cannot parse plugin\n");
        return ;
    }   

    for(int i=0;i<nbFile;i++)
        tryLoadingEncoderPlugin(files[i]);
        
        printf("[ADM_ve6_plugin] Scanning done\n");
        clearDirectoryContent(nbFile,files);        
}
コード例 #3
0
/**
 * 	\fn ADM_mx_loadPlugins
 *  \brief load all audio device plugins
 */
uint8_t ADM_mx_loadPlugins(const char *path)
{
#define MAX_EXTERNAL_FILTER 100
// FIXME Factorize

	char *files[MAX_EXTERNAL_FILTER];
	uint32_t nbFile;

	memset(files,0,sizeof(char *)*MAX_EXTERNAL_FILTER);
	printf("[ADM_mx_plugin] Scanning directory %s\n",path);

	if(!buildDirectoryContent(&nbFile, path, files, MAX_EXTERNAL_FILTER, SHARED_LIB_EXT))
	{
		printf("[ADM_av_plugin] Cannot parse plugin\n");
		return 0;
	}

	for(int i=0;i<nbFile;i++)
		tryLoadingMuxerPlugin(files[i]);

	printf("[ADM_mx_plugin] Scanning done\n");
    // Sort muxers by displayName, bubble sort
    int nb=ListOfMuxers.size();
    for(int i=0;i<nb;i++)
        for(int j=i+1;j<nb;j++)
        {
             ADM_dynMuxer *a,*b;
             a=ListOfMuxers[i];
             b=ListOfMuxers[j];
             if(strcmp(a->displayName,b->displayName)>0)
             {
                ListOfMuxers[j]=a;
                ListOfMuxers[i]=b;
             }
        }
        clearDirectoryContent(nbFile,files);
	return 1;
}
コード例 #4
0
std::vector<std::string> PluginManager::pluginFileList(const char* directory)
{
	std::vector<std::string> fileList;
	const int MAX_EXTERNAL_FILTER = 1000;
	char *files[MAX_EXTERNAL_FILTER];
	uint32_t fileCount;

	memset(files, 0, sizeof(char*) * MAX_EXTERNAL_FILTER);

	if (!buildDirectoryContent(&fileCount, directory, files, MAX_EXTERNAL_FILTER, SHARED_LIB_EXT))
	{
		printf("[PluginManager] Cannot query directory %s\n", directory);
	}

	for (uint32_t fileIndex = 0; fileIndex < fileCount; fileIndex++)
	{
		fileList.push_back(files[fileIndex]);
	}

	clearDirectoryContent(fileCount, files);

	return fileList;
}
コード例 #5
0
/**
 * 	\fn ADM_ad_GetPluginVersion
 *  \brief load all audio plugins
 */
uint8_t ADM_vf_loadPlugins(const char *path)
{
#define MAX_EXTERNAL_FILTER 100

	char *files[MAX_EXTERNAL_FILTER];
	uint32_t nbFile;

	memset(files,0,sizeof(char *)*MAX_EXTERNAL_FILTER);
	printf("[ADM_vf_plugin] Scanning directory %s\n",path);

	if(!buildDirectoryContent(&nbFile, path, files, MAX_EXTERNAL_FILTER, SHARED_LIB_EXT))
	{
		printf("[ADM_vf_plugin] Cannot parse plugin\n");
		return 0;
	}

	for(int i=0;i<nbFile;i++)
		tryLoadingVideoFilterPlugin(files[i]);

	printf("[ADM_vf_plugin] Scanning done, found %d video filer(s)\n", (int)ADM_vf_getNbFilters());
    clearDirectoryContent(nbFile,files);
    sortVideoFiltersByName();
	return 1;
}