Files
Testing/vidchat/m/RtmpOperation.class.php

65 lines
1.0 KiB
PHP
Raw Permalink Normal View History

2026-11-17 16:15:01 -05:00
<?php
class RtmpOperation
{
private $chunkStreamID;
private $call;
private $response;
private $handler;
public function __construct(RtmpMessage $call = null, $handler = null)
{
if($call)
{
$this->call = $call;
$call->encode();
$this->chunkStreamID = $call->getPacket()->chunkStreamId;
}
$this->handler = $handler;
}
public function getChunkStreamID()
{
return $this->chunkStreamID;
}
/**
* getCall
*
* @return RtmpMessage
*/
public function getCall()
{
return $this->call;
}
/**
* getResponse
*
* @return RtmpMessage
*/
public function getResponse()
{
return $this->response;
}
public function clearResponse()
{
$this->response = null;
}
/**
* CReate response from packet
*
* @param RtmpPacket $packet
*/
public function createResponse(RtmpPacket $packet)
{
$this->response = new RtmpMessage();
$this->response->setPacket($packet);
}
public function invokeHandler()
{
is_callable($this->handler) && call_user_func($this->handler,$this);
}
}