Gnash  0.8.10
Functions
rtmpget.cpp File Reference
#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>
#include <iostream>

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:

Function Documentation

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 assert, __FUNCTION__, gnash::amf::readString(), gnash::amf::NUMBER_AMF0, gnash::amf::readNumber(), sendCreateStream(), gnash::amf::NULL_AMF0, sendPlayPacket(), gnash::rtmp::RTMP::setBufferTime(), replyBWCheck(), gnash::rtmp::RTMP::close(), gnash::amf::OBJECT_AMF0, gnash::amf::OBJECT_END_AMF0, gnash::amf::STRING_AMF0, test::v, and gnash::key::e.

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::error(), gnash::key::l, gnash::LogFile::getDefaultInstance(), url, Arg_parser::arguments(), gnash::key::i, Arg_parser::code(), Arg_parser::argument(), gnash::LogFile::setVerbosity(), gnash::key::e, _, Arg_parser::ArgParserException::what(), writeFLVHeader(), gnash::URL::str(), gnash::URL::path(), gnash::key::r, gnash::rtmp::RTMP::connect(), gnash::rtmp::RTMP::update(), gnash::gnashSleep(), gnash::rtmp::RTMP::connected(), gnash::rtmp::RTMP::error(), sendConnectPacket(), gnash::key::b, gnash::rtmp::RTMP::getMessage(), handleInvoke(), gnash::key::f, gnash::rtmp::RTMP::getFLVFrame(), and start.

void replyBWCheck ( rtmp::RTMP r,
FakeNC &  ,
double  txn 
)
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::amf::write(), gnash::SimpleBuffer::appendByte(), gnash::amf::OBJECT_AMF0, gnash::amf::writeProperty(), gnash::amf::OBJECT_END_AMF0, and gnash::rtmp::RTMP::call().

Referenced by main().

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 
)
void sendPausePacket ( rtmp::RTMP r,
FakeNC &  nc,
bool  flag,
double  time 
)
void sendPlayPacket ( rtmp::RTMP r,
FakeNC &  nc 
)
void writeFLVHeader ( std::ostream &  o)

References gnash::arraySize().

Referenced by main().