31 #define RTMP_DEFAULT_CHUNKSIZE 128 155 static const size_t headerSize = 18;
270 inline const std::uint8_t*
283 inline const std::uint8_t*
343 bool connect(
const URL&
url);
368 void setBufferTime(
size_t time,
int streamID);
416 if (_messageQueue.empty())
return std::shared_ptr<SimpleBuffer>();
417 std::shared_ptr<SimpleBuffer>
b = _messageQueue.front();
418 _messageQueue.pop_front();
428 if (_flvQueue.empty())
return std::shared_ptr<SimpleBuffer>();
429 std::shared_ptr<SimpleBuffer>
b = _flvQueue.front();
430 _flvQueue.pop_front();
438 int readSocket(std::uint8_t* dst,
int num);
447 _serverBandwidth = bw;
452 return _serverBandwidth;
484 bool hasPacket(ChannelType
t,
size_t channel)
const;
490 RTMPPacket& getPacket(ChannelType t,
size_t channel);
505 typedef std::map<size_t, RTMPPacket> ChannelSet;
510 ChannelSet _inChannels;
513 ChannelSet _outChannels;
515 std::deque<std::shared_ptr<SimpleBuffer> > _messageQueue;
516 std::deque<std::shared_ptr<SimpleBuffer> > _flvQueue;
519 std::uint32_t _serverBandwidth;
522 std::uint32_t _bandwidth;
525 size_t _outChunkSize;
527 std::unique_ptr<HandShaker> _handShaker;
537 std::unique_ptr<RTMPPacket> _incompletePacket;
An RTMPPacket class contains a full description of an RTMP packet.
Definition: RTMP.h:194
bool isReady(const RTMPPacket &p)
Check if a packet is ready for processing.
Definition: RTMP.h:297
std::uint8_t m_nClientBW2
Definition: RTMP.h:467
const std::uint8_t * payloadEnd(const RTMPPacket &p)
Get the end of the allocated payload data section of the buffer.
Definition: RTMP.h:284
size_t payloadSize(const RTMPPacket &p)
The current size of the space allocated for the message payload.
Definition: RTMP.h:252
std::uint32_t serverBandwidth() const
Get the stored server bandwidth.
Definition: RTMP.h:451
void setServerBandwidth(std::uint32_t bw)
Store the server bandwidth.
Definition: RTMP.h:446
int m_mediaChannel
Definition: RTMP.h:466
~RTMPPacket()
Definition: RTMP.h:211
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
PacketSize
The PacketSize specifies the number of fields contained in the header.
Definition: RTMP.h:144
bool sendServerBW(RTMP &r)
Send the server bandwidth.
Definition: RTMP.cpp:402
size_t _bytesIn
Definition: RTMP.h:468
std::shared_ptr< SimpleBuffer > buffer
A buffer with enough storage to write the entire message.
Definition: RTMP.h:219
size_t size() const
Return size of the buffer.
Definition: SimpleBuffer.h:75
Definition: GnashKey.h:161
ControlType
Known control / ping codes.
Definition: RTMP.h:69
A simple IOChannel subclass for reading and writing sockets.
Definition: Socket.h:41
RTMPHeader header
Definition: RTMP.h:213
Definition: klash_part.cpp:330
Definition: GnashKey.h:164
Definition: GnashKey.h:166
std::uint8_t * data()
Get a pointer to start of data. May be NULL if size==0.
Definition: SimpleBuffer.h:81
std::shared_ptr< SimpleBuffer > getMessage()
Get an AMF message received from the server.
Definition: RTMP.h:415
Channels
The known channels.
Definition: RTMP.h:102
bool connected() const
Whether we have a basic connection to a server.
Definition: RTMP.h:378
void setBandwidth(std::uint32_t bw)
Store our bandwidth.
Definition: RTMP.h:456
std::uint32_t bandwidth() const
Get our bandwidth.
Definition: RTMP.h:461
Definition: GnashKey.h:148
#define DSOEXPORT
Definition: dsodefs.h:55
This class is for handling the RTMP protocol.
Definition: RTMP.h:326
bool error() const
Whether the RTMP connection is in error condition.
Definition: RTMP.h:385
void clearPayload(RTMPPacket &p)
Clear the message body and the bytes read of an RTMPPacket.
Definition: RTMP.h:241
Definition: GnashKey.h:162
std::string url
Definition: gnash.cpp:59
PacketType
The known packet types.
Definition: RTMP.h:110
A simple buffer of bytes.
Definition: SimpleBuffer.h:38
size_t bytesRead
Definition: RTMP.h:221
std::ostream & operator<<(std::ostream &o, PacketType p)
Logging assistance for PacketType.
Definition: RTMP.cpp:1180
bool hasPayload(const RTMPPacket &p)
Check whether an RTMPPacket has a payload.
Definition: RTMP.h:230
bool sendCtrl(RTMP &r, ControlType t, unsigned int nObject, unsigned int nTime)
Send a control packet.
Definition: RTMP.cpp:964
std::shared_ptr< SimpleBuffer > getFLVFrame()
Get an FLV packet received from the server.
Definition: RTMP.h:427
std::uint8_t * payloadData(RTMPPacket &p)
Access the payload data section of the buffer.
Definition: RTMP.h:262
size_t _bytesInSent
Definition: RTMP.h:469
Uniform Resource Locator.
Definition: URL.h:34
int _inChunkSize
Definition: RTMP.h:465