Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MNRTPbase Class Reference

#include <MNRTPbase.h>

Inheritance diagram for MNRTPbase:

Inheritance graph
[legend]
Collaboration diagram for MNRTPbase:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MNRTPbase (MNSelector &sel, int port, int remote_port, int recv_buf_size, u_int32 ssrc, OS::GCPtr< MNShared_RTP_RTCP > shared_data)
 MNRTPbase (MNSelector &sel, MNSocket &sock, int remote_port, int recv_buf_size, u_int32 ssrc, OS::GCPtr< MNShared_RTP_RTCP > shared_data)
virtual ~MNRTPbase ()
RTP_RC rt_start (bool sender=false)
RTP_RC rt_connect ()
 joins a mc , called by rtp_start() and rtp_run()
RTP_RC rt_bind ()
 binds to rtp and rtcp ports ,called by rtp_connect()
const char * rtp_str_err (int err)
 returns a string containing an errormsg
virtual int reader (MNRope *&rope, struct sockaddr_in *&dest)
 minimum handling and calls the specific function process_data()
virtual void writer ()
 Called by socket to notify that data can be written to the socket.
virtual RTP_RC process_data (MNRope *rope, struct sockaddr_in *dest)=0
virtual void notify_write_enabled ()=0
virtual void set_mc_ttl (int val)
int get_mc_ttl ()
const char * rt_get_targetaddr () const
 get the targetaddr
u_int32 rt_get_octet_count ()
 get the number of octets sent
u_int64 rt_get_packets_received ()
u_int64 rt_get_bytes_received ()
MNRTPbasert_get_MNRTPbasep ()
 retun the pointer to ourself
virtual MNRTCPrt_get_rtcp_ptr ()
int get_remote_port ()
 get the send port
int rt_get_payload_type ()
void rt_change_pt (int payload_t)
virtual void rt_set_ssrc (u_int32)
 set ssrc to a defined value
u_int32 rt_get_ssrc ()
 returns the current ssrc
void disable_headercheck ()
 header validity check is disabled
void enable_headercheck ()
 header validity check is enabled
bool is_header_check_active ()
 is the header check active ?
virtual void enable_rtcp ()
 enables rtcp
virtual void disable_rtcp ()
 disables rtcp
virtual u_int64 GetBytesSent ()
virtual u_int64 GetBytesRecv ()
timeval GetSentTime ()
timeval GetRecvTime ()
u_int64 GetSendBandwidth ()
u_int64 GetRecvBandwidth ()
timeval GetRecvMaxDelta ()
timeval GetRecvMinDelta ()
timeval GetRecvAverDelta ()
bool is_running () const
MNRTPcallbackcb ()

Protected Member Functions

void lock ()
void unlock ()
bool is_multicast () const
bool is_rtcp_allowed () const

Protected Attributes

OS::GCPtr< MNShared_RTP_RTCP_shared
MNRTPcallback _cb
AlloverStats allover
RTPSendStats sstats
RTPRecvStats rstats
ProtectedU_int32 rt_ssrc
MNDebugMutex var_mutex
MNDebugMutex initialized
bool _running
bool _connected
ProtectedBool _shutting_down
ProtectedBool _force_no_header_check
RTP_RC _use_mc
u_int32 _recv_port
u_int32 _remote_port

Constructor & Destructor Documentation

MNRTPbase::MNRTPbase MNSelector sel,
int  port,
int  remote_port,
int  recv_buf_size,
u_int32  ssrc,
OS::GCPtr< MNShared_RTP_RTCP shared_data
 

Constructor.
Initializes the shared part of RTP and RTCP classes. Assign initial values to the member variables and calls initialization functions.

Parameters:
port Try to bind the receiving local socket to this port.
remote_port Only used in case of multicast. For multicast, the sending port should be identical to the receiving port of all other participants, as well as to our own receiving port.
recv_buf_size The size of the locally allocated buffer that is allocated at instantiation time. Hopefully deprecated with the introduction of the Rope buffering.
ssrc The synchronization source.
shared_data Optional pointer to an object that contains information that is shared, resp. commonly manipulated by an RTP and its corresponding RTCP object.
classname A string for debugging purposes only.

MNRTPbase::MNRTPbase MNSelector sel,
MNSocket sock,
int  remote_port,
int  recv_buf_size,
u_int32  ssrc,
OS::GCPtr< MNShared_RTP_RTCP shared_data
 

virtual MNRTPbase::~MNRTPbase  )  [virtual]
 


Member Function Documentation

MNRTPcallback& MNRTPbase::cb  )  [inline]
 

Returns a reference to the RTP/RTCP callback registration object.

void MNRTPbase::disable_headercheck  ) 
 

header validity check is disabled

virtual void MNRTPbase::disable_rtcp  )  [inline, virtual]
 

disables rtcp

Reimplemented in MNRTP.

void MNRTPbase::enable_headercheck  ) 
 

header validity check is enabled

virtual void MNRTPbase::enable_rtcp  )  [inline, virtual]
 

enables rtcp

Reimplemented in MNRTP.

int MNRTPbase::get_mc_ttl  ) 
 

int MNRTPbase::get_remote_port  ) 
 

get the send port

virtual u_int64 MNRTPbase::GetBytesRecv  )  [virtual]
 

Reimplemented in MNRTP.

virtual u_int64 MNRTPbase::GetBytesSent  )  [virtual]
 

Reimplemented in MNRTP.

struct timeval MNRTPbase::GetRecvAverDelta  ) 
 

u_int64 MNRTPbase::GetRecvBandwidth  ) 
 

struct timeval MNRTPbase::GetRecvMaxDelta  ) 
 

struct timeval MNRTPbase::GetRecvMinDelta  ) 
 

struct timeval MNRTPbase::GetRecvTime  ) 
 

u_int64 MNRTPbase::GetSendBandwidth  ) 
 

struct timeval MNRTPbase::GetSentTime  ) 
 

bool MNRTPbase::is_header_check_active  ) 
 

is the header check active ?

bool MNRTPbase::is_multicast  )  const [protected]
 

True if use_mc indicates that a multicast address is used.
Called only by the MNRTP child class.

Returns:
True if use_mc==RTP_IS_MC

bool MNRTPbase::is_rtcp_allowed  )  const [protected]
 

True if RTCP processing is allowed.
This is indicated by the _shared block. Called only by the MNRTP child class.

Returns:
True if rtcp_allowed==true.

bool MNRTPbase::is_running  )  const
 

True if the RTPbase object is currently running. The boolean state is shared by RTPbase masters and slaves but not by RTP and RTCP objects.

Returns:
True if start() or run() has been called.

void MNRTPbase::lock  )  [protected]
 

virtual void MNRTPbase::notify_write_enabled  )  [pure virtual]
 

Implemented in MNRTCP.

virtual RTP_RC MNRTPbase::process_data MNRope rope,
struct sockaddr_in *  dest
[pure virtual]
 

Dummy implementation of the future replacement for the iovec approach.

Implemented in MNRTCP.

virtual int MNRTPbase::reader MNRope *&  rope,
struct sockaddr_in *&  dest
[virtual]
 

minimum handling and calls the specific function process_data()

Implements RefCountingSocket.

RTP_RC MNRTPbase::rt_bind  ) 
 

binds to rtp and rtcp ports ,called by rtp_connect()

void MNRTPbase::rt_change_pt int  payload_t  ) 
 

Set a new payload type.
This is necessary if the payload is changed temporarily, and even if it is changed frequently. However, the latter approach will confuse the timing and statistics functions. Appropriate values are defined in enum RTPPayloadTypes.

Parameters:
The new payload type.
See also:
RTPPayloadTypes

RTP_RC MNRTPbase::rt_connect  ) 
 

joins a mc , called by rtp_start() and rtp_run()

u_int64 MNRTPbase::rt_get_bytes_received  ) 
 

get the number of Bytes received (for all ssrc together and for all time)

MNRTPbase* MNRTPbase::rt_get_MNRTPbasep  ) 
 

retun the pointer to ourself

u_int32 MNRTPbase::rt_get_octet_count  ) 
 

get the number of octets sent

u_int64 MNRTPbase::rt_get_packets_received  ) 
 

get the number of packets received (for all ssrc together and for all time)

int MNRTPbase::rt_get_payload_type  ) 
 

Get the current payload type.

Returns:
The payload type value according to the RFC.

virtual MNRTCP* MNRTPbase::rt_get_rtcp_ptr  )  [inline, virtual]
 

Reimplemented in MNRTCP, and MNRTP.

u_int32 MNRTPbase::rt_get_ssrc  ) 
 

returns the current ssrc

const char* MNRTPbase::rt_get_targetaddr  )  const
 

get the targetaddr

virtual void MNRTPbase::rt_set_ssrc u_int32   )  [inline, virtual]
 

set ssrc to a defined value

Reimplemented in MNRTCP, and MNRTP.

RTP_RC MNRTPbase::rt_start bool  sender = false  ) 
 

Start the RTPbase processing in a new thread. Does nothing if this object is a slave object. If it is a master object and it is not running yet, call the method rt_connect() and then start a new thread via UDPServerSocket/TCPServerSocket::start(). UDPServerSocket/TCPServerSocket::run() will call select() and wait for data.

Returns:
RTP_OK in case of success. An error code otherwise.

const char* MNRTPbase::rtp_str_err int  err  ) 
 

returns a string containing an errormsg

virtual void MNRTPbase::set_mc_ttl int  val  )  [virtual]
 

Reimplemented in MNRTP.

void MNRTPbase::unlock  )  [protected]
 

virtual void MNRTPbase::writer  )  [virtual]
 

Called by socket to notify that data can be written to the socket.

Implements RefCountingSocket.


Member Data Documentation

MNRTPcallback MNRTPbase::_cb [protected]
 

A place to register callback functions for RTP/RTCP events. RTP callback were registered at the class itself previously. I have to find out where this actually is required.

bool MNRTPbase::_connected [protected]
 

True is a connection was "established". A connection is considered estabished when the address and port are correct and the bind was successful.

ProtectedBool MNRTPbase::_force_no_header_check [protected]
 

Indicate whether RTP and RTCP headers should be checked. Default is false, ie. headers should be checked.

u_int32 MNRTPbase::_recv_port [protected]
 

The local port to which this RTP receiver tries to bind respectively is bound.

u_int32 MNRTPbase::_remote_port [protected]
 

The remote port to which the data is sent.

bool MNRTPbase::_running [protected]
 

Indicate whether the RTPbase thread is running. (either start or run was called).

OS::GCPtr<MNShared_RTP_RTCP> MNRTPbase::_shared [protected]
 

Pointer to a data structure that is shared between RTP and RTCP objects.
Each MNRTP object creates a shared object in its constructors. Each MNRTCP object attaches to a given shared object. MNRTPbase is only responsible for setting the variable, and for checking that it is non-NULL.

ProtectedBool MNRTPbase::_shutting_down [protected]
 

A DEBUG variable that indicates that the destructor is currently executed.

RTP_RC MNRTPbase::_use_mc [protected]
 

Indicates whether multicast is used or not.
The variable may take more values than just a boolean indication of multicast. The variable is initialized by calling is_mc(). The variable was thread-safe.

AlloverStats MNRTPbase::allover [protected]
 

Holds data for custom statistics collection.

MNDebugMutex MNRTPbase::initialized [protected]
 

RTPRecvStats MNRTPbase::rstats [protected]
 

Holds data for mandatory RTP receive statistics collection.

ProtectedU_int32 MNRTPbase::rt_ssrc [protected]
 

RTPSendStats MNRTPbase::sstats [protected]
 

Holds data for mandatory RTP send statistics collection.

MNDebugMutex MNRTPbase::var_mutex [protected]
 


The documentation for this class was generated from the following file:
Generated on Sun Mar 6 13:36:00 2005 for Komssys by doxygen 1.3.8