AmRtpStream Class Reference

RTP implementation. More...

#include <AmRtpStream.h>

Inheritance diagram for AmRtpStream:

AmRtpAudio

Public Member Functions

int send (unsigned int ts, unsigned char *buffer, unsigned int size)
int receive (unsigned char *buffer, unsigned int size, unsigned int &ts, unsigned int audio_buffer_ts)
 AmRtpStream (AmSession *_s=0)
virtual ~AmRtpStream ()
void setLocalIP (const string &ip)
int getLocalPort ()
int getRPort ()
string getRHost ()
void setRAddr (const string &addr, unsigned short port)
void setPassiveMode (bool p)
void setTelephoneEventPT (const SdpPayload *pt)
int getTelephoneEventRate ()
virtual void init (const SdpPayload *sdp_payload)
void pause ()
void resume ()
void icmpError ()
void bufferPacket (const AmRtpPacket *p)

Data Fields

bool mute
bool begin_talk

Protected Member Functions

void setLocalPort ()
int nextPacket (AmRtpPacket &p)

Static Protected Member Functions

static int getNextPort ()

Protected Attributes

AmSharedVar< bool > runcond
AmMutex runmutex
int int_payload
int payload
int last_payload
string format_parameters
string r_host
unsigned short r_port
sockaddr_in r_saddr
sockaddr_in l_saddr
unsigned short l_port
int l_sd
timeval last_recv_time
unsigned int recv_offset
bool recv_offset_i
unsigned int sequence
unsigned int l_ssrc
unsigned int r_ssrc
bool r_ssrc_i
unsigned int jitter_delay
unsigned int max_delay
bool passive
AmSharedVar< bool > first_recved
auto_ptr< const SdpPayloadtelephone_event_pt
JitterBuffer jitter_buf
AmMutex jitter_mut
AmSessionsession

Static Protected Attributes

static int next_port = -1
static AmMutex port_mut

Detailed Description

RTP implementation.

Rtp stream high level interface.


Constructor & Destructor Documentation

AmRtpStream::AmRtpStream ( AmSession _s = 0  ) 

Allocates resources for future use of RTP.

AmRtpStream::~AmRtpStream (  )  [virtual]

Stops the stream and frees all resources.


Member Function Documentation

void AmRtpStream::bufferPacket ( const AmRtpPacket p  ) 

Insert an RTP packet to the buffer. Note: memory is owned by this instance.

int AmRtpStream::getLocalPort (  ) 

Gets RTP port number. If no RTP port in assigned, assigns a new one.

Returns:
local RTP port.

string AmRtpStream::getRHost (  ) 

Gets remote host IP.

Returns:
remote host IP.

int AmRtpStream::getRPort (  ) 

Gets remote RTP port.

Returns:
remote RTP port.

void AmRtpStream::icmpError (  ) 

Report an ICMP error.

void AmRtpStream::init ( const SdpPayload sdp_payload  )  [virtual]

Enables RTP stream.

Parameters:
sdp_payload payload from the SDP message.
Warning:
start() must have been called so that play and record work.

It should be called only if the stream has been completly initialized,

and only once per session. Use resume() then.

Reimplemented in AmRtpAudio.

void AmRtpStream::pause (  ) 

Stops RTP stream.

void AmRtpStream::resume (  ) 

Resume a paused RTP stream.

void AmRtpStream::setLocalIP ( const string &  ip  ) 

This function must be called before setLocalPort, because setLocalPort will bind the socket and it will be not possible to change the IP later

void AmRtpStream::setLocalPort (  )  [protected]

Initializes a new random local port, and sets own attributes properly.

void AmRtpStream::setPassiveMode ( bool  p  )  [inline]

Symmetric RTP: passive mode ?

void AmRtpStream::setRAddr ( const string &  addr,
unsigned short  port 
)

Set remote IP & port.

void AmRtpStream::setTelephoneEventPT ( const SdpPayload pt  )  [inline]

Set remote telephone event payload type


Field Documentation

int AmRtpStream::int_payload [protected]

Internal payload (only different from payload if using dynamic payloads).

int AmRtpStream::last_payload [protected]

Payload of last received packet. Usefull to detect talk spurt, looking for comfort noise packets.

Mute

bool AmRtpStream::passive [protected]

symmetric RTP

int AmRtpStream::payload [protected]

Remote payload (only different from int_payload if using dynamic payloads)

unsigned int AmRtpStream::recv_offset [protected]

the offset RTP receive TS <-> audio_buffer TS

bool AmRtpStream::recv_offset_i [protected]

the recv_offset initialized ?

auto_ptr<const SdpPayload> AmRtpStream::telephone_event_pt [protected]

Payload type for telephone event


The documentation for this class was generated from the following files:
Generated on Thu Mar 8 00:12:46 2007 for Sems by  doxygen 1.4.7
Home |  Recent changes |  Search |  Glossary |  Sitemap |  Login