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


PHP KalturaCriteria::setLimit方法代码示例

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


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

示例1: copyCuePointsFromLiveToVodEntry

 /**
  * @param string $vodEntryId
  */
 public static function copyCuePointsFromLiveToVodEntry($vodEntryId, $totalVODDuration, $lastSegmentDuration, $amfArray)
 {
     KalturaLog::debug("VOD entry ID: " . $vodEntryId . " totalVODDuration: " . $totalVODDuration . " lastSegmentDuration " . $lastSegmentDuration . " AMFs: " . print_r($amfArray, true));
     if (is_null($vodEntryId) || is_null($totalVODDuration) || is_null($lastSegmentDuration) || is_null($amfArray) || count($amfArray) == 0) {
         KalturaLog::warning('bad arguments passed to function. quiting');
         return;
     }
     $vodEntry = entryPeer::retrieveByPK($vodEntryId);
     if (!$vodEntry) {
         return;
     }
     $liveEntryId = $vodEntry->getRootEntryId();
     /** @var $liveEntry KalturaLiveEntry */
     $liveEntry = entryPeer::retrieveByPK($liveEntryId);
     if (!$liveEntry || !$liveEntry instanceof LiveEntry) {
         KalturaLog::err("Can't find live entry with id [{$liveEntryId}]");
         return;
     }
     $currentSegmentEndTime = self::getSegmentEndTime($amfArray, $lastSegmentDuration);
     $currentSegmentStartTime = self::getSegmentStartTime($amfArray);
     self::normalizeAMFTimes($amfArray, $totalVODDuration, $lastSegmentDuration);
     KalturaLog::log("Saving the live entry [{$liveEntry->getId()}] cue points into the associated VOD entry [{$vodEntry->getId()}]");
     // select up to MAX_CUE_POINTS_TO_COPY_TO_VOD to handle
     $c = new KalturaCriteria();
     $c->add(CuePointPeer::ENTRY_ID, $liveEntry->getId());
     $c->add(CuePointPeer::CREATED_AT, $currentSegmentEndTime, KalturaCriteria::LESS_EQUAL);
     // Don't copy future cuepoints
     $c->addAnd(CuePointPeer::CREATED_AT, $currentSegmentStartTime - self::CUE_POINT_TIME_EPSILON, KalturaCriteria::GREATER_EQUAL);
     // Don't copy cuepoints before segment begining
     $c->add(CuePointPeer::STATUS, CuePointStatus::READY);
     // READY, but not yet HANDLED
     $c->addAscendingOrderByColumn(CuePointPeer::CREATED_AT);
     $c->setLimit(self::MAX_CUE_POINTS_TO_COPY_TO_VOD);
     $liveCuePointsToCopy = CuePointPeer::doSelect($c);
     $numLiveCuePointsToCopy = count($liveCuePointsToCopy);
     KalturaLog::info("About to copy {$numLiveCuePointsToCopy} cuepoints from live entry [{$liveEntry->getId()}] to VOD entry [{$vodEntry->getId()}]");
     $processedCuePointIds = array();
     if ($numLiveCuePointsToCopy > 0) {
         foreach ($liveCuePointsToCopy as $liveCuePoint) {
             $processedCuePointIds[] = $liveCuePoint->getId();
             $cuePointCreationTime = $liveCuePoint->getCreatedAt(NULL) * 1000;
             $offsetForTS = self::getOffsetForTimestamp($cuePointCreationTime, $amfArray);
             $copyMsg = "cuepoint [{$liveCuePoint->getId()}] from live entry [{$liveEntry->getId()}] to VOD entry [{$vodEntry->getId()}] cuePointCreationTime= {$cuePointCreationTime} offsetForTS= {$offsetForTS}";
             KalturaLog::debug("Preparing to copy {$copyMsg}");
             if (!is_null($offsetForTS)) {
                 $liveCuePoint->copyFromLiveToVodEntry($vodEntry, $offsetForTS);
             } else {
                 KalturaLog::info("Not copying {$copyMsg}");
             }
         }
     }
     KalturaLog::info("Post processing cuePointIds for live entry [{$liveEntry->getId()}]: " . print_r($processedCuePointIds, true));
     if (count($processedCuePointIds)) {
         self::postProcessCuePoints($liveEntry, $processedCuePointIds);
     }
 }
开发者ID:dozernz,项目名称:server,代码行数:59,代码来源:kCuePointManager.php

示例2: copyCuePointsFromLiveToVodEntry

 /**
  * @param entry $vodEntry
  */
 public static function copyCuePointsFromLiveToVodEntry($mediaInfo)
 {
     $vodEntry = self::getVodEntryBasedOnMediaInfoFlavorAsset($mediaInfo);
     if (!$vodEntry) {
         return;
     }
     $liveEntryId = $vodEntry->getRootEntryId();
     /** @var $liveEntry KalturaLiveEntry */
     $liveEntry = entryPeer::retrieveByPK($liveEntryId);
     if (!$liveEntry || !$liveEntry instanceof LiveEntry) {
         KalturaLog::err("Can't find live entry with id [{$liveEntryId}]");
         return;
     }
     KalturaLog::log("Saving the live entry [{$liveEntry->getId()}] cue points into the associated VOD entry [{$vodEntry->getId()}]");
     // select up to MAX_CUE_POINTS_TO_COPY_TO_VOD to handle
     $c = new KalturaCriteria();
     $c->add(CuePointPeer::ENTRY_ID, $liveEntry->getId());
     $c->add(CuePointPeer::START_TIME, $liveEntry->getLengthInMsecs(), KalturaCriteria::LESS_EQUAL);
     // Don't copy future cuepoints
     $c->add(CuePointPeer::STATUS, CuePointStatus::READY);
     // READY, but not yet HANDLED
     $c->addAscendingOrderByColumn(CuePointPeer::START_TIME);
     $c->setLimit(self::MAX_CUE_POINTS_TO_COPY_TO_VOD);
     $liveCuePointsToCopy = CuePointPeer::doSelect($c);
     $numLiveCuePointsToCopy = count($liveCuePointsToCopy);
     KalturaLog::info("About to copy {$numLiveCuePointsToCopy} cuepoints from live entry [{$liveEntry->getId()}] to VOD entry [{$vodEntry->getId()}]");
     $processedCuePointIds = array();
     if ($numLiveCuePointsToCopy > 0) {
         $recordedSegmentsInfo = $liveEntry->getRecordedSegmentsInfo();
         foreach ($liveCuePointsToCopy as $liveCuePoint) {
             $processedCuePointIds[] = $liveCuePoint->getId();
             $startTime = $liveCuePoint->getStartTime();
             $copyMsg = "cuepoint [{$liveCuePoint->getId()}] from live entry [{$liveEntry->getId()}] to VOD entry [{$vodEntry->getId()}] with startTime [{$startTime}]";
             KalturaLog::info("Preparing to copy {$copyMsg}");
             $totalVodOffsetTime = $recordedSegmentsInfo->getTotalVodTimeOffset($startTime);
             if (!is_null($totalVodOffsetTime)) {
                 $adjustedStartTime = $startTime - $totalVodOffsetTime;
                 KalturaLog::info("Copying {$copyMsg} and adjustedStartTime [{$adjustedStartTime}] (totalVodOffsetTime [{$totalVodOffsetTime}])");
                 $liveCuePoint->copyFromLiveToVodEntry($vodEntry, $adjustedStartTime);
             } else {
                 KalturaLog::info("Not copying {$copyMsg}");
             }
         }
     }
     KalturaLog::info("Post processing cuePointIds for live entry [{$liveEntry->getId()}]: " . print_r($processedCuePointIds, true));
     if (count($processedCuePointIds)) {
         self::postProcessCuePoints($liveEntry, $processedCuePointIds);
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:52,代码来源:kCuePointManager.php


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