drm/ave/drm.cpp
/**
 * @brief Get index of drm meta-data which is not yet configured
 *
 * @param[in] drmMetadataIdx   Indexed DRM meta-data
 * @param[in] drmMetadataCount Count of meta-data present in the index
 */
@brief Get index of drm meta-data which is not yet configured
@param[in] drmMetadataIdx   Indexed DRM meta-data
@param[in] drmMetadataCount Count of meta-data present in the index
@brief Get index of drm meta - data which is not yet configured @param [ in ] drmMetadataIdx Indexed DRM meta - data @param [ in ] drmMetadataCount Count of meta - data present in the index
int AveDrmManager::GetNewMetadataIndex(DrmMetadataNode* drmMetadataIdx, int drmMetadataCount)
{
	int idx = -1;
	pthread_mutex_lock(&aveDrmManagerMutex);
	for (int j = drmMetadataCount - 1; j >= 0; j--)
	{
		bool matched = false;
		for (int i = 0; i < sAveDrmManager.size(); i++)
		{
			if (0 == memcmp(drmMetadataIdx[j].sha1Hash, sAveDrmManager[i]->mSha1Hash, DRM_SHA1_HASH_LEN))
			{
				matched = true;
				break;
			}
		}
		if (!matched)
		{
			idx = j;
			break;
		}
	}
	pthread_mutex_unlock(&aveDrmManagerMutex);
	return idx;
}
int AveDrmManager :: GetNewMetadataIndex ( DrmMetadataNode * drmMetadataIdx , int drmMetadataCount ) { int idx = -1 ; pthread_mutex_lock ( & aveDrmManagerMutex ) ; for ( int j = drmMetadataCount - 1 ; j >= 0 ; j -- ) { bool matched = false ; for ( int i = 0 ; i < sAveDrmManager . size ( ) ; i ++ ) { if ( 0 == memcmp ( drmMetadataIdx [ j ] . sha1Hash , sAveDrmManager [ i ] -> mSha1Hash , DRM_SHA1_HASH_LEN ) ) { matched = true ; break ; } } if ( ! matched ) { idx = j ; break ; } } pthread_mutex_unlock ( & aveDrmManagerMutex ) ; return idx ; }
@brief Get index of drm meta-data which is not yet configured
 @param[in] drmMetadataIdx   Indexed DRM meta-data
 @param[in] drmMetadataCount Count of meta-data present in the index
@brief Get index of drm meta - data which is not yet configured @param [ in ] drmMetadataIdx Indexed DRM meta - data @param [ in ] drmMetadataCount Count of meta - data present in the index