MistServer  2.5.3-Pro-19-gf5e75b1 ( Generic_64)
Public Member Functions | Data Fields
RTMPStream::Chunk Class Reference

Holds a single RTMP chunk, either send or receive direction. More...

#include <rtmpchunks.h>

Public Member Functions

 Chunk ()
 Default constructor, creates an empty chunk with all values initialized to zero. More...
 
 Chunk ()
 
std::string & Pack ()
 
std::string & Pack ()
 Packs up the chunk for sending over the network. More...
 
bool Parse (Socket::Buffer &data)
 Parses the argument Socket::Buffer into the current chunk. More...
 
bool Parse (Socket::Buffer &data)
 

Data Fields

unsigned int cs_id
 ContentStream ID. More...
 
std::string data
 Payload of chunk. More...
 
unsigned char headertype
 For input chunks, the type of header. This is calculated automatically for output chunks. More...
 
unsigned int len
 Length of the complete chunk. More...
 
unsigned int len_left
 Length not yet received, out of complete chunk. More...
 
unsigned int msg_stream_id
 Message Stream ID. More...
 
unsigned char msg_type_id
 Message Type ID. More...
 
unsigned int real_len
 Length of this particular part of it. More...
 
unsigned int timestamp
 Timestamp of this chunk. More...
 
unsigned int ts_delta
 Last timestamp delta. More...
 
unsigned int ts_header
 Last header timestamp without extensions or deltas. More...
 

Detailed Description

Holds a single RTMP chunk, either send or receive direction.

Constructor & Destructor Documentation

RTMPStream::Chunk::Chunk ( )

Default constructor, creates an empty chunk with all values initialized to zero.

RTMPStream::Chunk::Chunk ( )

Member Function Documentation

std::string & RTMPStream::Chunk::Pack ( )

Packs up the chunk for sending over the network.

Warning
Do not call if you are not actually sending the resulting data!
Returns
A std::string ready to be sent.
std::string& RTMPStream::Chunk::Pack ( )
bool RTMPStream::Chunk::Parse ( Socket::Buffer data)
bool RTMPStream::Chunk::Parse ( Socket::Buffer buffer)

Parses the argument Socket::Buffer into the current chunk.

Tries to read a whole chunk, removing data from the Buffer as it reads. If a single packet contains a partial chunk, it will remove the packet and call itself again. This has the effect of only causing a "true" reponse in the case a whole chunk is read, not just part of a chunk.

Parameters
bufferThe input to parse and update.
Warning
This function will destroy the current data in this chunk!
Returns
True if a whole chunk could be read, false otherwise.

Field Documentation

unsigned int RTMPStream::Chunk::cs_id

ContentStream ID.

std::string RTMPStream::Chunk::data

Payload of chunk.

unsigned char RTMPStream::Chunk::headertype

For input chunks, the type of header. This is calculated automatically for output chunks.

unsigned int RTMPStream::Chunk::len

Length of the complete chunk.

unsigned int RTMPStream::Chunk::len_left

Length not yet received, out of complete chunk.

unsigned int RTMPStream::Chunk::msg_stream_id

Message Stream ID.

unsigned char RTMPStream::Chunk::msg_type_id

Message Type ID.

unsigned int RTMPStream::Chunk::real_len

Length of this particular part of it.

unsigned int RTMPStream::Chunk::timestamp

Timestamp of this chunk.

unsigned int RTMPStream::Chunk::ts_delta

Last timestamp delta.

unsigned int RTMPStream::Chunk::ts_header

Last header timestamp without extensions or deltas.


The documentation for this class was generated from the following files: