RTPSocket Class Reference

[ARTS Index] [ARTS Heirarchy]


Abstract base class for UDP RTP protocol service. More...

#include <rtp.h>

Inherits: UDPSocket

Public Members

Protected Members


Detailed Description

This abstract class implements the basic support needed for a UDP RTP socket. The RTP Socket with dual service threads are now known as RTPTransiever.


unsigned getHostHeader(unsigned short *seq = NULL, unsigned long *timestamp = NULL)

Retrieve payload format and header info for host socket.

Parameters:
seq number of last sent packet.
timestamp of last sent packet.
Returns:
RTP payload format.

unsigned getPeerHeader(unsigned short *seq = NULL, unsigned long *timestamp = NULL)

Retrieve payload format and header info from peer socket.

Parameters:
seq number of last received packet.
timestamp of last received packet.
Returns:
RTP payload format.

virtual void addConference(unsigned long source)

Add a conference id to the RTP send message.

Parameters:
source for added conference id.

inline void setSource(unsigned long source)

Set this server's stream source id.

Parameters:
source id to use for my stream.

int Write(void *buf, size_t len)

Write data to the UDP socket. This implements the send service thread writer.

Parameters:
address buffer to write.
len of bytes to write in addition to the header.
Returns:
number of bytes written on success, -1 on failure.

int Read(void *buf, size_t len)

read data from the UDP socket. This implements the receive service thread reader.

Parameters:
address buffer to read.
len of bytes to read from buffer.
Returns:
number of bytes read on success, -1 on failure.

int Wait(timeout_t timer)

wait for data to appear in the socket, and if it does, fill the header.

Parameters:
timeout in milliseconds.
Returns:
0 on success, -1 if timed out.

void Skip(int count = 1)

Update the time stamp for the next sent packet.

Parameters:
count of frames to skip.

long getFrameSampleSize(void)

Get default frame sample size currently in effect.

Returns:
number of samples in the current frame.

RTPSocket(InetAddress &bind, short port)

Create and bind an RTP socket to an internet interface address and known port number. The sending thread timeout can be adjusted with setTimeout() before calling Start() for the sending service thread. One might also call setPayload, etc.

Parameters:
port address to bind the service under.
bind address to bind this socket to.

virtual void setPayload(unsigned payload, timeout_t frame_timeout = 0)

Sets the payload id for sending RTP packets. This is virtualized so that RTPAudio can also specify sampling rates based on the returned value.

Parameters:
payload message type (0-127) for sending.
optional frame timeout for sample size.

  • Author: David Sugar <dyfet@ostel.com>.
  • Documentation generated by dyfet@home.tycho.com on Fri Jul 2 11:43:56 EDT 1999
Kdoc