fragmentcollector_mpd.cpp
/**
 * @brief Generates fragment URL from media information
 *
 * @param[out] fragmentUrl         Fragment URL
 * @param[in]  fragmentDescriptor  Descriptor
 * @param[in]  media               Media information string
 */
@brief Generates fragment URL from media information
@param[out] fragmentUrl         Fragment URL
@param[in]  fragmentDescriptor  Descriptor
@param[in]  media               Media information string
@brief Generates fragment URL from media information @param [ out ] fragmentUrl Fragment URL @param [ in ] fragmentDescriptor Descriptor @param [ in ] media Media information string
static void GetFragmentUrl( char fragmentUrl[MAX_URI_LENGTH], const FragmentDescriptor *fragmentDescriptor, std::string media)
{
	std::string constructedUri;
	if (fragmentDescriptor->baseUrls->size() > 0)
	{
		constructedUri = fragmentDescriptor->baseUrls->at(0)->GetUrl();
		if(gpGlobalConfig->dashIgnoreBaseURLIfSlash)
		{
			if (constructedUri == "/")
			{
				logprintf("%s:%d ignoring baseurl /\n", __FUNCTION__, __LINE__);
				constructedUri.clear();
			}
		}
		if( constructedUri.compare(0, 7, "http://")==0 || constructedUri.compare(0, 8, "https://")==0 )
		{
			if( constructedUri.back() != '/' )
			{
				constructedUri += '/';
			}
		}
	}
	else
	{
		traceprintf("%s:%d BaseURL not available\n", __FUNCTION__, __LINE__);
	}
	constructedUri += media;
	replace(constructedUri, "Bandwidth", fragmentDescriptor->Bandwidth);
	replace(constructedUri, "RepresentationID", fragmentDescriptor->RepresentationID);
	replace(constructedUri, "Number", fragmentDescriptor->Number);
	replace(constructedUri, "Time", fragmentDescriptor->Time );
	aamp_ResolveURL(fragmentUrl, fragmentDescriptor->manifestUrl, constructedUri.c_str());
}
static void GetFragmentUrl ( char fragmentUrl [ MAX_URI_LENGTH ] , const FragmentDescriptor * fragmentDescriptor , std :: string media ) { std :: string constructedUri ; if ( fragmentDescriptor -> baseUrls -> size ( ) > 0 ) { constructedUri = fragmentDescriptor -> baseUrls -> at ( 0 ) -> GetUrl ( ) ; if ( gpGlobalConfig -> dashIgnoreBaseURLIfSlash ) { if ( constructedUri == " " ) { logprintf ( " \n " , __FUNCTION__ , __LINE__ ) ; constructedUri . clear ( ) ; } } if ( constructedUri . compare ( 0 , 7 , " " ) == 0 || constructedUri . compare ( 0 , 8 , " " ) == 0 ) { if ( constructedUri . back ( ) != ' ' ) { constructedUri += ' ' ; } } } else { traceprintf ( " \n " , __FUNCTION__ , __LINE__ ) ; } constructedUri += media ; replace ( constructedUri , " " , fragmentDescriptor -> Bandwidth ) ; replace ( constructedUri , " " , fragmentDescriptor -> RepresentationID ) ; replace ( constructedUri , " " , fragmentDescriptor -> Number ) ; replace ( constructedUri , " " , fragmentDescriptor -> Time ) ; aamp_ResolveURL ( fragmentUrl , fragmentDescriptor -> manifestUrl , constructedUri . c_str ( ) ) ; }
@brief Generates fragment URL from media information
 @param[out] fragmentUrl         Fragment URL
 @param[in]  fragmentDescriptor  Descriptor
 @param[in]  media               Media information string
@brief Generates fragment URL from media information @param [ out ] fragmentUrl Fragment URL @param [ in ] fragmentDescriptor Descriptor @param [ in ] media Media information string
//Add '/' to BaseURL if not already available.