#include <rtmp_server.h>
Public Member Functions | |
RTMPServer () | |
~RTMPServer () | |
boost::shared_ptr < cygnal::Element > | processClientHandShake (int fd) |
bool | packetSend (cygnal::Buffer &buf) |
bool | packetRead (cygnal::Buffer &buf) |
boost::shared_ptr< cygnal::Buffer > | encodeResult (gnash::RTMPMsg::rtmp_status_e status) |
boost::shared_ptr< cygnal::Buffer > | encodeResult (gnash::RTMPMsg::rtmp_status_e status, const std::string &filename) |
boost::shared_ptr< cygnal::Buffer > | encodeResult (gnash::RTMPMsg::rtmp_status_e status, const std::string &filename, double &transid) |
boost::shared_ptr< cygnal::Buffer > | encodeResult (gnash::RTMPMsg::rtmp_status_e status, double &transid) |
boost::shared_ptr< cygnal::Buffer > | encodeResult (gnash::RTMPMsg::rtmp_status_e status, const std::string &filename, double &transid, double &clientid) |
boost::shared_ptr< cygnal::Buffer > | encodePing (rtmp_ping_e type, boost::uint32_t milliseconds) |
boost::shared_ptr< cygnal::Buffer > | encodePing (rtmp_ping_e type) |
boost::shared_ptr< cygnal::Buffer > | encodeAudio (boost::uint8_t *data, size_t size) |
boost::shared_ptr< cygnal::Buffer > | encodeVideo (boost::uint8_t *data, size_t size) |
boost::shared_ptr< cygnal::Buffer > | encodeBWDone (double id) |
std::vector< boost::shared_ptr < cygnal::Element > > | parseEchoRequest (cygnal::Buffer &buf) |
std::vector< boost::shared_ptr < cygnal::Element > > | parseEchoRequest (boost::uint8_t *buf, size_t size) |
boost::shared_ptr< cygnal::Buffer > | formatEchoResponse (double num, cygnal::Element &el) |
boost::shared_ptr< cygnal::Buffer > | formatEchoResponse (double num, cygnal::Buffer &data) |
boost::shared_ptr< cygnal::Buffer > | formatEchoResponse (double num, boost::uint8_t *data, size_t size) |
void | addReference (boost::uint16_t index, cygnal::Element &el) |
cygnal::Element & | getReference (boost::uint16_t index) |
bool | sendFile (int fd, const std::string &filespec) |
std::string | createClientID () |
double | createStreamID () |
void | setStreamID (double id) |
double | getStreamID () |
size_t | sendToClient (std::vector< int > &fds, boost::uint8_t *data, size_t size) |
size_t | sendToClient (std::vector< int > &fds, cygnal::Buffer &data) |
void | setNetConnection (gnash::RTMPMsg *msg) |
void | setNetConnection (boost::shared_ptr< gnash::RTMPMsg > msg) |
boost::shared_ptr< gnash::RTMPMsg > | getNetConnection () |
void | dump () |
cygnal::RTMPServer::RTMPServer | ( | ) |
cygnal::RTMPServer::~RTMPServer | ( | ) |
References gnash::RTMP::_properties.
void cygnal::RTMPServer::addReference | ( | boost::uint16_t | index, | |
cygnal::Element & | el | |||
) | [inline] |
std::string cygnal::RTMPServer::createClientID | ( | ) |
References gnash::key::i, and gnash::key::v.
Referenced by encodeResult().
double cygnal::RTMPServer::createStreamID | ( | ) |
Referenced by encodeResult().
void cygnal::RTMPServer::dump | ( | ) |
Reimplemented from gnash::RTMP.
Referenced by packetRead().
boost::shared_ptr< cygnal::Buffer > cygnal::RTMPServer::encodeAudio | ( | boost::uint8_t * | data, | |
size_t | size | |||
) |
boost::shared_ptr< cygnal::Buffer > cygnal::RTMPServer::encodeBWDone | ( | double | id | ) |
References cygnal::Element::encode(), cygnal::Element::makeNull(), cygnal::Element::makeNumber(), and cygnal::Element::makeString().
Referenced by processClientHandShake().
boost::shared_ptr< Buffer > cygnal::RTMPServer::encodePing | ( | rtmp_ping_e | type, | |
boost::uint32_t | milliseconds | |||
) |
References gnash::RTMP::PING_CLEAR, gnash::RTMP::PING_CLIENT, gnash::RTMP::PING_PLAY, gnash::RTMP::PING_RESET, gnash::RTMP::PING_TIME, gnash::RTMP::PONG_CLIENT, and cygnal::swapBytes().
Referenced by encodePing(), and processClientHandShake().
boost::shared_ptr< Buffer > cygnal::RTMPServer::encodePing | ( | rtmp_ping_e | type | ) |
References encodePing().
boost::shared_ptr< cygnal::Buffer > cygnal::RTMPServer::encodeResult | ( | gnash::RTMPMsg::rtmp_status_e | status, | |
const std::string & | filename | |||
) |
References encodeResult().
boost::shared_ptr< cygnal::Buffer > cygnal::RTMPServer::encodeResult | ( | gnash::RTMPMsg::rtmp_status_e | status, | |
const std::string & | filename, | |||
double & | transid, | |||
double & | clientid | |||
) |
boost::shared_ptr< Buffer > cygnal::RTMPServer::encodeResult | ( | gnash::RTMPMsg::rtmp_status_e | status | ) |
Referenced by encodeResult(), cygnal::oflaDemo_write_func(), and processClientHandShake().
boost::shared_ptr< cygnal::Buffer > cygnal::RTMPServer::encodeResult | ( | gnash::RTMPMsg::rtmp_status_e | status, | |
const std::string & | filename, | |||
double & | transid | |||
) |
References encodeResult().
boost::shared_ptr< cygnal::Buffer > cygnal::RTMPServer::encodeResult | ( | gnash::RTMPMsg::rtmp_status_e | status, | |
double & | transid | |||
) |
References encodeResult().
boost::shared_ptr< cygnal::Buffer > cygnal::RTMPServer::encodeVideo | ( | boost::uint8_t * | data, | |
size_t | size | |||
) |
boost::shared_ptr<cygnal::Buffer> cygnal::RTMPServer::formatEchoResponse | ( | double | num, | |
cygnal::Element & | el | |||
) |
Reimplemented in cygnal::EchoTest.
boost::shared_ptr<cygnal::Buffer> cygnal::RTMPServer::formatEchoResponse | ( | double | num, | |
cygnal::Buffer & | data | |||
) |
Reimplemented in cygnal::EchoTest.
boost::shared_ptr<cygnal::Buffer> cygnal::RTMPServer::formatEchoResponse | ( | double | num, | |
boost::uint8_t * | data, | |||
size_t | size | |||
) |
Reimplemented in cygnal::EchoTest.
boost::shared_ptr<gnash::RTMPMsg> cygnal::RTMPServer::getNetConnection | ( | ) | [inline] |
Reimplemented in cygnal::EchoTest, and cygnal::OflaDemoTest.
Referenced by connection_handler().
cygnal::Element& cygnal::RTMPServer::getReference | ( | boost::uint16_t | index | ) | [inline] |
double cygnal::RTMPServer::getStreamID | ( | ) | [inline] |
bool cygnal::RTMPServer::packetRead | ( | cygnal::Buffer & | buf | ) |
References _, gnash::RTMP::_header, gnash::RTMP::addProperty(), gnash::RTMP::AMF3_INVOKE, gnash::RTMP::AMF3_NOTIFY, gnash::RTMP::AMF3_SHARED_OBJ, gnash::RTMP::AUDIO_DATA, cygnal::Buffer::begin(), gnash::RTMP::rtmp_head_t::bodysize, gnash::RTMP::BYTES_READ, gnash::RTMP::CHUNK_SIZE, gnash::RTMP::decodeAudioData(), gnash::RTMP::decodeBytesRead(), gnash::RTMP::decodeChunkSize(), gnash::RTMP::decodeClient(), gnash::RTMP::decodeHeader(), gnash::RTMP::decodeInvoke(), gnash::RTMP::decodeNotify(), gnash::RTMP::decodePing(), gnash::RTMP::decodeServer(), gnash::RTMP::decodeSharedObj(), gnash::RTMP::decodeVideoData(), dump(), cygnal::Element::dump(), s2x::end, cygnal::AMF::extractProperty(), gnash::RTMP::FLV_DATA, gnash::RTMP::headerSize(), gnash::RTMP::INVOKE, gnash::RTMP::NOTIFY, gnash::RTMP::PING_CLEAR, gnash::RTMP::PING_CLIENT, gnash::RTMP::PING_PLAY, gnash::RTMP::PING_RESET, gnash::RTMP::PING_TIME, gnash::RTMP::PONG_CLIENT, cygnal::Buffer::reference(), gnash::RTMP::ROUTE, gnash::RTMP_INDEX_MASK, gnash::RTMP::SET_BANDWITH, gnash::RTMP::SHARED_OBJ, cygnal::Buffer::size(), gnash::RTMP::rtmp_head_t::type, gnash::RTMP::USER, gnash::RTMP::VIDEO_DATA, and gnash::RTMP::WINDOW_SIZE.
bool cygnal::RTMPServer::packetSend | ( | cygnal::Buffer & | buf | ) |
std::vector<boost::shared_ptr<cygnal::Element > > cygnal::RTMPServer::parseEchoRequest | ( | boost::uint8_t * | buf, | |
size_t | size | |||
) |
Reimplemented in cygnal::EchoTest.
std::vector<boost::shared_ptr<cygnal::Element > > cygnal::RTMPServer::parseEchoRequest | ( | cygnal::Buffer & | buf | ) | [inline] |
Reimplemented in cygnal::EchoTest.
References parseEchoRequest(), cygnal::Buffer::reference(), and cygnal::Buffer::size().
Referenced by parseEchoRequest().
boost::shared_ptr< cygnal::Element > cygnal::RTMPServer::processClientHandShake | ( | int | fd | ) |
This method is called after the initial network connection is established. It reads in the handshake from the client, responds appropriately, and then extracts the initial AMF object, which is always of type NetConnection, doing an INVOKE operation of connect(). serverFinish() is actually used to extract the AMF data from the packet, and handShakeResponse() is used to construct the response packet.
NetConnection object.
References _, CLOCK_REALTIME, gnash::RTMP::decodeHeader(), gnash::RTMP::decodeMsgBody(), encodeBWDone(), encodePing(), encodeResult(), gnash::RTMP::recvMsg(), gnash::RTMP_SYSTEM_CHANNEL, gnash::RTMP_VIDEO_PACKET_SIZE, gnash::Network::setTimeout(), and cygnal::swapBytes().
Referenced by connection_handler().
bool cygnal::RTMPServer::sendFile | ( | int | fd, | |
const std::string & | filespec | |||
) |
References CLOCK_REALTIME, gnash::RTMP::getChannel(), and gnash::RTMP::sendMsg().
size_t cygnal::RTMPServer::sendToClient | ( | std::vector< int > & | fds, | |
boost::uint8_t * | data, | |||
size_t | size | |||
) |
References gnash::Network::writeNet().
Referenced by sendToClient().
size_t cygnal::RTMPServer::sendToClient | ( | std::vector< int > & | fds, | |
cygnal::Buffer & | data | |||
) |
References cygnal::Buffer::allocated(), cygnal::Buffer::reference(), and sendToClient().
void cygnal::RTMPServer::setNetConnection | ( | boost::shared_ptr< gnash::RTMPMsg > | msg | ) | [inline] |
Reimplemented in cygnal::EchoTest, and cygnal::OflaDemoTest.
void cygnal::RTMPServer::setNetConnection | ( | gnash::RTMPMsg * | msg | ) | [inline] |
Reimplemented in cygnal::EchoTest, and cygnal::OflaDemoTest.
Referenced by connection_handler().
void cygnal::RTMPServer::setStreamID | ( | double | id | ) | [inline] |