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

MNRTP Class Reference

#include <MNRTP.h>

Inheritance diagram for MNRTP:

Inheritance graph
[legend]
Collaboration diagram for MNRTP:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MNRTP (MNSelector &sel, MNSocket *rtpsock, MNSocket *rtcpsock, int remote_port, const char *targetaddr_, int payload_t, u_int32 bw, RTSP::TransportTypes requested_transport=RTSP::RTP_AVP_UDP, int dpt_ts_rate=-1)
virtual ~MNRTP ()
RTP_RC rtp_start (bool sender=false)
int rtp_send (MNRope *buf, int marker, int ts_in_value, rtp_math tstamp)
int rtp_send_ext (MNRope *buf, char *ext_buf, int ext_len, u_int16 ext_type, int marker, int ts_inc_value, rtp_math tstamp)
u_int32 get_collision_counter ()
virtual void set_mc_ttl (int val)
SendCsrcListrtp_csrcs ()
virtual void rt_set_ssrc (u_int32 ssrc)
 set ssrc to a defined value
void disable_collision_detection ()
void enable_collision_detection ()
void rt_set_bandwidth (u_int32 bw)
u_int32 rt_get_bandwidth ()
virtual MNRTCPrt_get_rtcp_ptr ()
void rtcp_stop (bool bye, const char *reason)
bool rtcp_start (MNSocket *rtcpsock)
void enable_rtcp ()
void disable_rtcp ()
int rtcp_send_app (char *app, int len, int subtype)
void rtcp_set_app_name (const char *name)
void stopRTPUdpServer ()
void rtcp_register_RTCPreader_cb (MNRTP_RTCPreader_callback *p)
void rtcp_set_sdes (rtcp_sdes_type_t type, char *text, int prio)
const sdes_list_itemrtcp_get_sdes_text (rtcp_sdes_type_t type)
u_int32 rtcp_get_first_ssrc ()
u_int32 rtcp_get_next_ssrc (u_int32 ssrc)
SSRCEntry rtcp_get_ssrc_info (u_int32 ssrc)
virtual u_int64 GetBytesSent ()
virtual u_int64 GetBytesRecv ()

Protected Attributes

SendCsrcList _send_csrcs
SsrcCollisionList ssrc_coll_list
sockaddr_in * _target_save
 Remember target IP to avoid DNS requests.
ProtectedU_int32 ssrc_collission_counter
 counts the number of ssrc collissions
ProtectedInt32 rtcp_port
sockaddr_in rtp_my_addr
 own IP address, needed for collission detection
ProtectedU_int16 rtp_seq
 sequence number
MNMutex rtp_initialized
MNMutex send_mutex

Constructor & Destructor Documentation

MNRTP::MNRTP MNSelector sel,
MNSocket rtpsock,
MNSocket rtcpsock,
int  remote_port,
const char *  targetaddr_,
int  payload_t,
u_int32  bw,
RTSP::TransportTypes  requested_transport = RTSP::RTP_AVP_UDP,
int  dpt_ts_rate = -1
 

An MNRTP constructor that re-uses open RTP and RTCP sockets. It assign initial values to the member variables and calls initialization routines.

Parameters:
rtpsock An open UDP/TCP socket that is bound to an even address.
rtcpsock Either NULL or an open UDP socket that is bound to the port just above the rtpsock port
remote_port 
targetaddr The host IP address of the remote host in dotted decimal still (for multicast)
payload_t The predefined payload format.
bw The default bandwidth to use.
requested_transport An enum matching the RTSP transport specification, usually RTP/AVP/UDP
dpt_ts_rate Timestamp frequency of dynamic payload types. May be set in the corresponding SH and will be given to the shared RTP-RTCP data.

virtual MNRTP::~MNRTP  )  [virtual]
 


Member Function Documentation

void MNRTP::disable_collision_detection  ) 
 

Disables the ssrc collision detection.

void MNRTP::disable_rtcp  )  [virtual]
 

Disable RTCP processing. Clear the rtcp_allowed flag in the shared data structure.

Reimplemented from MNRTPbase.

void MNRTP::enable_collision_detection  ) 
 

Enables the ssrc collision detection.

void MNRTP::enable_rtcp  )  [virtual]
 

Enable RTCP processing (default). Set the rtcp_allowed flag in the shared data structure.

Reimplemented from MNRTPbase.

u_int32 MNRTP::get_collision_counter  ) 
 

virtual u_int64 MNRTP::GetBytesRecv  )  [virtual]
 

Reimplemented from MNRTPbase.

virtual u_int64 MNRTP::GetBytesSent  )  [virtual]
 

Reimplemented from MNRTPbase.

u_int32 MNRTP::rt_get_bandwidth  ) 
 

Retrieve the current bandwidth value.

Returns:
The current bandwidth value.

virtual MNRTCP* MNRTP::rt_get_rtcp_ptr  )  [virtual]
 

Reimplemented from MNRTPbase.

void MNRTP::rt_set_bandwidth u_int32  bw  ) 
 

Set a new bandwidth value.

Parameters:
bw The new bandwidth value that is used for calculations
Returns:
void

virtual void MNRTP::rt_set_ssrc u_int32  ssrc  )  [virtual]
 

set ssrc to a defined value

Reimplemented from MNRTPbase.

u_int32 MNRTP::rtcp_get_first_ssrc  ) 
 

u_int32 MNRTP::rtcp_get_next_ssrc u_int32  ssrc  ) 
 

const sdes_list_item* MNRTP::rtcp_get_sdes_text rtcp_sdes_type_t  type  ) 
 

SSRCEntry MNRTP::rtcp_get_ssrc_info u_int32  ssrc  ) 
 

void MNRTP::rtcp_register_RTCPreader_cb MNRTP_RTCPreader_callback p  ) 
 

int MNRTP::rtcp_send_app char *  app,
int  len,
int  subtype
 

void MNRTP::rtcp_set_app_name const char *  name  ) 
 

See also:
MNRTCP::rtcp_set_app_name

void MNRTP::rtcp_set_sdes rtcp_sdes_type_t  type,
char *  text,
int  prio
 

bool MNRTP::rtcp_start MNSocket rtcpsock  ) 
 

void MNRTP::rtcp_stop bool  bye,
const char *  reason
 

Deletes the RTCPServer, has no rtcp functionality. The difference to disable_rtcp is that, in this case, the ports are released again. In the disable_rtcp the RTCPServer is just put to sleep.

Parameters:
bye If true, a BYE packet is sent to the peer with the message given in reason
reason The reason string. Ignored if bye is false.

SendCsrcList& MNRTP::rtp_csrcs  )  [inline]
 

CSRC handling is provided by this subclass.
The previous handling functions for adding, deleting, checking, counting, clearing are provided publically by that object. Iteration could be provided easily but is hopefully unnecessary.

int MNRTP::rtp_send MNRope buf,
int  marker,
int  ts_in_value,
rtp_math  tstamp
 

Sends a block of RTP data and adds RTP-specific parameters.

Parameters:
buf the block intended for transfer
marker The rtp->marker is set to 0 or 1, depending on the payload and explained in the RFCs that explain packaging. Identifying markers is a codec issue.
ts_in_value Increase the RTP timestamp bye this value. It must be a value increase, not an absolute timestamp because the initial timestamp should be randomly selected; a feature that can not be used with arbitrary clients.
tstamp Defines whether the timestamp should be increased absolutely or incrementally.
Returns:
The number of bytes that were sent (if positive), or an error code (if negative).

int MNRTP::rtp_send_ext MNRope buf,
char *  ext_buf,
int  ext_len,
u_int16  ext_type,
int  marker,
int  ts_inc_value,
rtp_math  tstamp
 

Sends a block of data with an RTP header extension. This implies that the X-bit is set according to rfc1889.

Parameters:
buf 
See also:
rtp_send
Parameters:
ext_buf Pointer to the payload of the header extension. All data that is sent using this function must be in network byte order before calling this function because it is not interpreted by this function. Its size must be a multiple of sizeof(u_int32), ie. a multiple of 4.
ext_len The number of u_int32 words in the buffer. The value 0 is permitted in this place.
ext_type A u_int16 which indicates the type of the extension. The meaning of this value is application dependent.
marker 
See also:
rtp_send
Parameters:
ts_inc_value 
See also:
rtp_send
Parameters:
tstamp 
See also:
rtp_send
Returns:
The number of bytes that were actually sent, including all headers, or -1 in case of an error.

RTP_RC MNRTP::rtp_start bool  sender = false  ) 
 

Starts an RTCPServer if that is allowed. If it is created, the RTCPServer's rtcp_start function is called. In all cases, the rt_start function is called and it's error code is returned.

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

Reimplemented from MNRTPbase.

void MNRTP::stopRTPUdpServer  ) 
 


Member Data Documentation

SendCsrcList MNRTP::_send_csrcs [protected]
 

The list of contributing sources is currently unused. To implement a cache, a filter or a mixer, it is mandatory, so I try to leave this in working order.

struct sockaddr_in* MNRTP::_target_save [protected]
 

Remember target IP to avoid DNS requests.

ProtectedInt32 MNRTP::rtcp_port [protected]
 

MNMutex MNRTP::rtp_initialized [protected]
 

struct sockaddr_in MNRTP::rtp_my_addr [protected]
 

own IP address, needed for collission detection

ProtectedU_int16 MNRTP::rtp_seq [protected]
 

sequence number

MNMutex MNRTP::send_mutex [protected]
 

SsrcCollisionList MNRTP::ssrc_coll_list [protected]
 

The list of SSRC collisions maintains a list of other IP addresses that have generated packets with SSRC values identical to the one that was chosen for this object's packets.

ProtectedU_int32 MNRTP::ssrc_collission_counter [protected]
 

counts the number of ssrc collissions


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