當前位置: 首頁>>代碼示例>>PHP>>正文


PHP assetParamsPeer::retrieveMinimalBitrate方法代碼示例

本文整理匯總了PHP中assetParamsPeer::retrieveMinimalBitrate方法的典型用法代碼示例。如果您正苦於以下問題:PHP assetParamsPeer::retrieveMinimalBitrate方法的具體用法?PHP assetParamsPeer::retrieveMinimalBitrate怎麽用?PHP assetParamsPeer::retrieveMinimalBitrate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在assetParamsPeer的用法示例。


在下文中一共展示了assetParamsPeer::retrieveMinimalBitrate方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: calculateUrgency

 function calculateUrgency(BatchJob $batchJob)
 {
     $flavorParamsId = $this->getFlavorParamsOutput()->getFlavorParamsId();
     $isBulkupload = $batchJob->getBulkJobId() !== null;
     $readiness = null;
     if ($this->priority == 0) {
         self::calculatePriority($batchJob);
     }
     if ($this->priority == self::MIGRATION_FLAVOR_PRIORITY) {
         return BatchJobUrgencyType::MIGRATION_URGENCY;
     }
     // If you have no conversion profile, there is no poinr in this calculation
     if (is_null($this->conversionProfileId)) {
         return BatchJobUrgencyType::DEFAULT_URGENCY;
     }
     if ($batchJob->getObjectId() && $batchJob->getObjectType()) {
         $batchJobs = BatchJobPeer::retrieveByJobTypeAndObject($batchJob->getObjectId(), $batchJob->getObjectType(), $batchJob->getJobType(), $batchJob->getJobSubType());
         if (count($batchJobs)) {
             return $batchJobs[0]->getLockInfo()->getUrgency() + 1;
         }
     }
     // a conversion job will be considered as required in one of the following cases:
     // 1. The flavor is required
     // 2. There are no required flavors and this is the flavor is optional with the minimal bitrate
     // 3. all flavors are set as READY_BEHAVIOR_NO_IMPACT.
     $allFlavorParamsIds = array();
     $hasRequired = false;
     $allNoImpact = true;
     // Go over all flavors and decide on cases 1-3
     $fpcps = flavorParamsConversionProfilePeer::retrieveByConversionProfile($this->conversionProfileId);
     foreach ($fpcps as $fpcp) {
         $allFlavorParamsIds[] = $fpcp->getFlavorParamsId();
         if ($fpcp->getFlavorParamsId() == $flavorParamsId) {
             // Case 1
             $readiness = $fpcp->getReadyBehavior();
         }
         if ($fpcp->getReadyBehavior() == flavorParamsConversionProfile::READY_BEHAVIOR_REQUIRED) {
             // Case 2
             $hasRequired = true;
         }
         if ($fpcp->getReadyBehavior() != flavorParamsConversionProfile::READY_BEHAVIOR_NO_IMPACT) {
             // Case 3
             $allNoImpact = false;
         }
     }
     // Case 2
     if (!$hasRequired && $readiness == flavorParamsConversionProfile::READY_BEHAVIOR_OPTIONAL) {
         $flvParamsMinBitrate = assetParamsPeer::retrieveMinimalBitrate($allFlavorParamsIds);
         if (!is_null($flvParamsMinBitrate) && $flvParamsMinBitrate->getId() == $flavorParamsId) {
             $readiness = flavorParamsConversionProfile::READY_BEHAVIOR_REQUIRED;
         }
     }
     // Case 3
     if ($allNoImpact) {
         $readiness = flavorParamsConversionProfile::READY_BEHAVIOR_REQUIRED;
     }
     // Decide on the urgency by the readiness and the upload method
     if ($readiness == flavorParamsConversionProfile::READY_BEHAVIOR_REQUIRED) {
         return $isBulkupload ? BatchJobUrgencyType::REQUIRED_BULK_UPLOAD : BatchJobUrgencyType::REQUIRED_REGULAR_UPLOAD;
     } else {
         if ($readiness == flavorParamsConversionProfile::READY_BEHAVIOR_OPTIONAL) {
             return $isBulkupload ? BatchJobUrgencyType::OPTIONAL_BULK_UPLOAD : BatchJobUrgencyType::OPTIONAL_REGULAR_UPLOAD;
         } else {
             return BatchJobUrgencyType::DEFAULT_URGENCY;
         }
     }
 }
開發者ID:DBezemer,項目名稱:server,代碼行數:67,代碼來源:kConvertJobData.php


注:本文中的assetParamsPeer::retrieveMinimalBitrate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。