static GMSubtitleSource::SUBTITLE_TYPE GetSubtitleType(OMX_STRING type)
{
    GMSubtitleSource::SUBTITLE_TYPE type1;
    if(fsl_osal_strcmp(type, "3gpp") == 0) {
        type1 = GMSubtitleSource::TYPE_3GPP;
    }
    else if(fsl_osal_strcmp(type, "srt") == 0) {
        type1 = GMSubtitleSource::TYPE_SRT;
    }
    else
        type1 = GMSubtitleSource::TYPE_UNKNOWN;

    return type1;
}
Beispiel #2
0
OMX_ERRORTYPE  LibavAudioDec::SetRoleFormat(OMX_STRING role)
{
    OMX_ERRORTYPE ret = OMX_ErrorNone;

    if(fsl_osal_strcmp(role, "audio_decoder.adpcm") == 0) {
        CodingType = OMX_AUDIO_CodingADPCM;
        fsl_osal_strcpy((fsl_osal_char*)name, LIBAV_COMP_NAME_ADPCMDEC);
        OMX_INIT_STRUCT(&(InputMode.PcmMode), OMX_AUDIO_PARAM_PCMMODETYPE);
    }
	else if(fsl_osal_strcmp(role, "audio_decoder.g711") == 0) {
        CodingType = OMX_AUDIO_CodingG711;
        fsl_osal_strcpy((fsl_osal_char*)name, LIBAV_COMP_NAME_G711DEC);
        OMX_INIT_STRUCT(&(InputMode.AdpcmMode), OMX_AUDIO_PARAM_ADPCMMODETYPE)
    }
fsl_osal_ptr ShareLibarayMgr::load(fsl_osal_char *lib_name) 
{
	LIB_INFO *pLibInfo;

	if (lib_name == NULL)
	{
		LOG_ERROR("Library name is NULL.\n");
		return NULL;
	}

	/** Check if the library already loaded */
	for (fsl_osal_s32 i = 0; ; i ++)
	{
		pLibInfo = lib_info.GetNode(i);
		if(pLibInfo == NULL)
		{
			break;
		}

		if (!fsl_osal_strcmp(pLibInfo->lib_name, lib_name))
		{
			pLibInfo->refCount ++;
			LOG_DEBUG("The reference times of the lib: %s is: %d\n", pLibInfo->lib_name, \
					pLibInfo->refCount);
			return pLibInfo->hlib;
		}
	}

    const fsl_osal_char *cError;

	fsl_osal_ptr pLibHandle = dlopen(lib_name, RTLD_NOW);
	if (pLibHandle == NULL)
	{
		LOG_WARNING("Can't open library: %s\n", lib_name);
		printf("Can't open library: %s\n", lib_name);
        cError = dlerror();
        LOG_WARNING("%s\n", cError);
        printf("%s\n", cError);
		return NULL;
	}

	pLibInfo = FSL_NEW(LIB_INFO, ());
	if (pLibInfo == NULL)
	{
		LOG_ERROR("New LIB_INFO fail.\n");
		return NULL;
	}
	
	fsl_osal_strcpy(pLibInfo->lib_name, lib_name);
	pLibInfo->hlib = pLibHandle;
	pLibInfo->refCount = 1;

	lib_info.Add(pLibInfo);

	return pLibHandle;
}