本文整理汇总了PHP中Api::transcodeSearch方法的典型用法代码示例。如果您正苦于以下问题:PHP Api::transcodeSearch方法的具体用法?PHP Api::transcodeSearch怎么用?PHP Api::transcodeSearch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Api
的用法示例。
在下文中一共展示了Api::transcodeSearch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switch
$ok = false;
switch ($task["task"]) {
case TASK_SEND_METADATA:
$url .= "&action=transcoder_send_metadata";
$url .= "&id=" . $media["remoteid"];
$url .= "&metadata=" . urlencode(json_encode(unserialize($media["metadata"])));
$ok = true;
break;
case TASK_SEND_METADATAERROR:
$url .= "&action=transcoder_send_alert";
$url .= "&id=" . $media["remoteid"];
$url .= "&status=1&message=" . urlencode("No track found while reading metadata");
$ok = true;
break;
case TASK_SEND_TRANSCODE:
$transcode = $api->transcodeSearch(array("id" => $task["params"]["transcode"]));
if (!$transcode) {
$api->log(LOG_CRIT, "Got task '" . $task["id"] . "' but transcode '" . $task["transcodeid"] . "' not found!!");
$api->setTaskFailedUnlock($task["id"]);
continue;
}
$transcode = $transcode[0];
$metadata = unserialize($transcode["metadata"]);
$url .= "&action=transcoder_send_format";
$url .= "&id=" . $media["remoteid"];
$url .= "&settings_id=" . $transcode["setting"];
$url .= "&cardinality=" . intval($metadata["cardinality"]);
$url .= "&adapter=" . $media["adapter"];
$url .= "&metadata=" . urlencode(json_encode($metadata));
$ok = true;
break;
示例2: sleep
// we sleep for a little while, thanks to that, we can launch that process as soon as we want:
// it will still do *nothing* for a little while when there is nothing to do ;)
$api->log(LOG_DEBUG, "Nothing to do, sleeping...");
sleep(60);
continue;
}
// Get the task's parameters */
$params = $task["params"];
$media = $api->mediaSearch(array("id" => $task["mediaid"]));
if (!$media) {
$api->log(LOG_CRIT, "Got task '" . $task["id"] . "' but media '" . $task["mediaid"] . "' not found!!");
$api->setTaskFailedUnlock($task["id"]);
continue;
}
$media = $media[0];
$transcode = $api->transcodeSearch(array("id" => $params["transcode"]));
$api->log(LOG_DEBUG, "Transcode search '" . $params["transcode"] . "' returns '" . print_r($transcode, 1) . "'");
if (!$transcode) {
$api->log(LOG_CRIT, "Got task '" . $task["id"] . "' but transcode '" . $params["transcode"] . "' not found!!");
$api->setTaskFailedUnlock($task["id"]);
continue;
}
$transcode = $transcode[0];
$api->me = Users::get($task["user"]);
$adapterObject = $api->getAdapter($media["adapter"]);
if (!$adapterObject) {
$api->log(LOG_CRIT, "Got task '" . $task["id"] . "' but adapter '" . $task["adapter"] . "' not found!!");
$api->setTaskFailedUnlock($task["id"]);
continue;
}
list($source, $destination) = $adapterObject->filePathTranscode($media, $all_settings[$params["setting"]]);