#include "RTMP.h"
#include <string>
#include "log.h"
#include "arg_parser.h"
#include "SimpleBuffer.h"
#include "AMF.h"
#include "GnashAlgorithm.h"
#include "GnashSleep.h"
#include "URL.h"
#include <boost/cstdint.hpp>
#include <iomanip>
#include <map>
#include <algorithm>
#include <iterator>
#include <fstream>
Functions | |
void | writeFLVHeader (std::ostream &o) |
bool | handleInvoke (rtmp::RTMP &r, FakeNC &nc, const boost::uint8_t *payload, const boost::uint8_t *end) |
void | sendConnectPacket (rtmp::RTMP &r, FakeNC &nc, const std::string &app, const std::string &ver, const std::string &swfurl, const std::string &tcurl, const std::string &pageurl) |
void | sendCheckBW (rtmp::RTMP &r, FakeNC &nc) |
void | replyBWCheck (rtmp::RTMP &r, FakeNC &, double txn) |
void | sendPausePacket (rtmp::RTMP &r, FakeNC &nc, bool flag, double time) |
void | sendPlayPacket (rtmp::RTMP &r, FakeNC &nc) |
void | sendCreateStream (rtmp::RTMP &r, FakeNC &nc) |
void | sendDeleteStream (rtmp::RTMP &r, FakeNC &nc, double id) |
void | sendFCSubscribe (rtmp::RTMP &r, FakeNC &nc, const std::string &subscribepath) |
int | main (int argc, char **argv) |
Some URLs to try are: |
bool handleInvoke | ( | rtmp::RTMP & | r, | |
FakeNC & | nc, | |||
const boost::uint8_t * | payload, | |||
const boost::uint8_t * | end | |||
) |
_result means it's the answer to a remote method call initiated by us.
Issue NetStream.play command.
Allows quick downloading.
These are remote function calls initiated by the server .
This must return a value. It can be anything.
If the server sends this, we reply (the call should contain a callback object!).
Don't know when it sends this.
Or this.
References __FUNCTION__, gnash::rtmp::RTMP::close(), gnash::key::e, EXIT_SUCCESS, gnash::hexify(), gnash::amf::NULL_AMF0, gnash::amf::NUMBER_AMF0, gnash::amf::OBJECT_AMF0, gnash::amf::OBJECT_END_AMF0, gnash::amf::readNumber(), gnash::amf::readString(), replyBWCheck(), sendCreateStream(), sendPlayPacket(), gnash::rtmp::RTMP::setBufferTime(), gnash::amf::STRING_AMF0, and test::v.
Referenced by main().
int main | ( | int | argc, | |
char ** | argv | |||
) |
Some URLs to try are:
-u rtmp://tagesschau.fcod.llnwd.net:1935/a3705/d1 with -p 2010/0216/TV-20100216-0911-2401.hi or -p 2010/0216/TV-20100216-0911-2401.lo -u rtmp://ndr.fc.llnwd.net:1935/ndr/_definst_ with -p ndr_fs_nds_hi_flv *and* -s -1 (live stream)
1. connect.
Retrieve messages.
Retrieve video packets.
References _, Arg_parser::argument(), Arg_parser::arguments(), gnash::key::b, Arg_parser::code(), gnash::rtmp::RTMP::connect(), gnash::rtmp::RTMP::connected(), gnash::key::e, gnash::rtmp::RTMP::error(), Arg_parser::error(), EXIT_SUCCESS, s2x::f, gnash::LogFile::getDefaultInstance(), gnash::rtmp::RTMP::getFLVFrame(), gnash::rtmp::RTMP::getMessage(), gnash::gnashSleep(), handleInvoke(), gnash::rtmp::RTMPHeader::headerSize, gnash::key::l, Arg_parser::no, gnash::URL::path(), sendConnectPacket(), gnash::LogFile::setVerbosity(), start, gnash::URL::str(), gnash::rtmp::RTMP::update(), url, Arg_parser::ArgParserException::what(), writeFLVHeader(), and Arg_parser::yes.
void replyBWCheck | ( | rtmp::RTMP & | r, | |
FakeNC & | , | |||
double | txn | |||
) |
References gnash::SimpleBuffer::appendByte(), gnash::rtmp::RTMP::call(), gnash::amf::NULL_AMF0, and gnash::amf::write().
Referenced by handleInvoke().
void sendCheckBW | ( | rtmp::RTMP & | r, | |
FakeNC & | nc | |||
) |
void sendConnectPacket | ( | rtmp::RTMP & | r, | |
FakeNC & | nc, | |||
const std::string & | app, | |||
const std::string & | ver, | |||
const std::string & | swfurl, | |||
const std::string & | tcurl, | |||
const std::string & | pageurl | |||
) |
These functions create an RTMP call buffer and send it. They mimic NetConnection.call() methods and replies to server calls. If a call is initiated by us, we send our own call number. If we are replying to a server call, we send the server's call number back.
Call number?
References gnash::SimpleBuffer::appendByte(), gnash::rtmp::RTMP::call(), gnash::amf::OBJECT_AMF0, gnash::amf::OBJECT_END_AMF0, gnash::amf::write(), and gnash::amf::writeProperty().
Referenced by main().
void sendCreateStream | ( | rtmp::RTMP & | r, | |
FakeNC & | nc | |||
) |
References gnash::SimpleBuffer::appendByte(), gnash::rtmp::RTMP::call(), gnash::amf::NULL_AMF0, and gnash::amf::write().
Referenced by handleInvoke().
void sendDeleteStream | ( | rtmp::RTMP & | r, | |
FakeNC & | nc, | |||
double | id | |||
) |
void sendFCSubscribe | ( | rtmp::RTMP & | r, | |
FakeNC & | nc, | |||
const std::string & | subscribepath | |||
) |
void sendPausePacket | ( | rtmp::RTMP & | r, | |
FakeNC & | nc, | |||
bool | flag, | |||
double | time | |||
) |
void sendPlayPacket | ( | rtmp::RTMP & | r, | |
FakeNC & | nc | |||
) |
References length, gnash::amf::NULL_AMF0, gnash::rtmp::RTMP::play(), and gnash::amf::write().
Referenced by handleInvoke().
void writeFLVHeader | ( | std::ostream & | o | ) |
References gnash::arraySize().
Referenced by main().