当前位置: 首页>>代码示例>>PHP>>正文


PHP kJobsManager::addConvertIsmCollectionJob方法代码示例

本文整理汇总了PHP中kJobsManager::addConvertIsmCollectionJob方法的典型用法代码示例。如果您正苦于以下问题:PHP kJobsManager::addConvertIsmCollectionJob方法的具体用法?PHP kJobsManager::addConvertIsmCollectionJob怎么用?PHP kJobsManager::addConvertIsmCollectionJob使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kJobsManager的用法示例。


在下文中一共展示了kJobsManager::addConvertIsmCollectionJob方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: decideProfileFlavorsConvert

 public static function decideProfileFlavorsConvert(BatchJob $parentJob, BatchJob $convertProfileJob, array $flavors, array $conversionProfileFlavorParams, mediaInfo $mediaInfo = null)
 {
     $entryId = $convertProfileJob->getEntryId();
     $originalFlavorAsset = flavorAssetPeer::retrieveOriginalByEntryId($entryId);
     if (is_null($originalFlavorAsset)) {
         $errDescription = 'Original flavor asset not found';
         KalturaLog::err($errDescription);
         $convertProfileJob = kJobsManager::failBatchJob($convertProfileJob, $errDescription, BatchJobType::CONVERT_PROFILE);
         kBatchManager::updateEntry($convertProfileJob, entryStatus::ERROR_CONVERTING);
         return false;
     }
     $errDescription = null;
     $finalFlavors = self::validateConversionProfile($convertProfileJob->getPartnerId(), $entryId, $mediaInfo, $flavors, $conversionProfileFlavorParams, $errDescription);
     KalturaLog::log(count($finalFlavors) . " flavors returned from the decision layer");
     if (is_null($finalFlavors)) {
         $convertProfileJob = kJobsManager::failBatchJob($convertProfileJob, $errDescription);
         KalturaLog::log("No flavors created");
         throw new Exception($errDescription);
     }
     if (strlen($errDescription)) {
         $err = $convertProfileJob->getDescription() . $errDescription;
         $convertProfileJob->setDescription($err);
         $convertProfileJob->save();
     }
     $srcSyncKey = $originalFlavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
     $conversionsCreated = 0;
     $entry = $convertProfileJob->getEntry();
     if (!$entry) {
         throw new APIException(APIErrors::INVALID_ENTRY, $convertProfileJob, $entryId);
     }
     $flavorsCollections = array();
     // create a convert job per each flavor
     foreach ($finalFlavors as $flavor) {
         $flavorAsset = kBatchManager::createFlavorAsset($flavor, $entry->getPartnerId(), $entry->getId());
         if (!$flavorAsset) {
             KalturaLog::log("Flavor asset could not be created, flavor conversion won't be created");
             continue;
         }
         $collectionTag = $flavor->getCollectionTag();
         if ($collectionTag) {
             $flavorsCollections[$collectionTag][] = $flavor;
             continue;
         }
         KalturaLog::log("Adding flavor conversion with flavor params output id [" . $flavor->getId() . "] and flavor params asset id [" . $flavorAsset->getId() . "]");
         $madiaInfoId = $mediaInfo ? $mediaInfo->getId() : null;
         $createdJob = kJobsManager::addFlavorConvertJob($srcSyncKey, $flavor, $flavorAsset->getId(), $madiaInfoId, $parentJob);
         if ($createdJob) {
             $conversionsCreated++;
         }
     }
     foreach ($flavorsCollections as $tag => $flavors) {
         switch ($tag) {
             case flavorParams::TAG_ISM:
                 $createdJob = kJobsManager::addConvertIsmCollectionJob($tag, $srcSyncKey, $entry, $parentJob, $flavors);
                 if ($createdJob) {
                     $conversionsCreated++;
                 }
                 break;
             default:
                 KalturaLog::log("Error: Invalid collection tag [{$tag}]");
                 break;
         }
     }
     if (!$conversionsCreated) {
         $convertProfileJob = kJobsManager::failBatchJob($convertProfileJob, $errDescription);
         KalturaLog::log("No flavors created: {$errDescription}");
         return false;
     }
     return true;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:70,代码来源:kBusinessPreConvertDL.php

示例2: decideCollectionConvert

 private static function decideCollectionConvert($collectionTag, flavorAsset $originalFlavorAsset, entry $entry, BatchJob $parentJob = null, array $flavors)
 {
     //TODO: add support for source other than original
     $srcSyncKey = $originalFlavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
     switch ($collectionTag) {
         case flavorParams::TAG_ISM:
             KalturaLog::log("Calling addConvertIsmCollectionJob with [" . count($flavors) . "] flavor params");
             return kJobsManager::addConvertIsmCollectionJob($collectionTag, $srcSyncKey, $entry, $parentJob, $flavors, false);
         default:
             KalturaLog::log("Error: Invalid collection tag [{$collectionTag}]");
             return null;
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:13,代码来源:kBusinessPreConvertDL.php


注:本文中的kJobsManager::addConvertIsmCollectionJob方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。