The mmstream.protocols.ProtocolCoDec
interface defines the access to the coding and transmission
services of a ProtocolCoDec object:
startReceiving()
and startSending()
. These methods start up the threads that
send and receive data.
transmitChunk()
. The transmitChunk()
method takes a Chunk
object as
argument. It encodes the Chunk
's payload data and timestamp in protocol data units of
the protocol that a particular ProtocolCoDec
object implements.
getRemoteSouce()
. The getRemoteSouce()
method is intended to block its
caller until the ProtocolCoDec
receives a new multimedia data stream by means of the
ProtocolCoDec
's data Connection
object. On reception of a new stream, the method
creates and returns a new RemoteSource
object, which represents the remote sender.
createLocalSource()
. On invocation of this method, the
ProtocolCoDec
returns a new LocalSource
object, which will use the
transmission service of the creating ProtocolCoDec.
Connection
objects.
The mmstream.protocols.rtp.RTP_CoDec
class conforms to the ProtocolCoDec
interface and implements the
Real-Time Transport Protocol (RTP) described in Section .
The mmstream.protocols.rtp
package contains additional classes that support the
RTP_CoDec
class:
RTProtocol
and RTCProtocol
classes. These classes contain protocol
constants as well as static
methods that generate and check RTP and RTCP packet headers.
RTP_LocalSource
and RTP_RemoteSource
classes. These classes are
instantiatable subclasses of the abstract RemoteSource
and LocalSource
classes
described in Section StreamExporter
objects in the local
data flow.
RTP_RemoteSource
objects represent remote RTP data senders, and are used to export the
contents of the RTP packets received by the associated RTP_CoDec
to local Stream
objects.
RTP_LocalSource
objects on the other hand do not only export their chunks to
local Stream
objects, but also trigger the RTP encoding and subsequent network
transmission of Chunk
objects by calling the
transmitChunk()
method
of their associated RTP_CoDec
object.
In addition, both RTP source classes produce general and RTP-specific transmission statistics
objects, which summarise information
about the sent packets of RTP_LocalSource
objects or about the received packets of
RTP_RemoteSource
objects, respectively. The calculations and estimations are implemented
according to the algorithms presented in [RFC1889, S. 6.3.1, A.3,].
In particular, an RTP_ReceptionStatistics
object contains
the number of received chunks and octets, the chunk rate and bandwidth of the received packet
stream, the highest received extended sequence, an estimation of the fraction and absolute
number of lost packets, a calculation of the reception jitter, and time information about the
latest received RTCP sender report from the remote source.
An RTP_SenderStatistics
object conveys the number of sent chunks and octets, the
sending bandwidth and chunk rate, the latest sent extended sequence number, and time
information about the most recently sent RTCP sender report.
RTP_SeqNum_Registration
class. RTP_RemoteSource
objects check the sequence
number of incoming RTP packets with the help of RTP_SeqNum_Registration
objects . The
check guarantees that the sequence numbers are monotonously increasing. In addition, the check
declares remote sources as invalid if the packet loss or the misordering exceeds
certain limits. The implementation follows the algorithm described in [RFC1889, A.1,].
RTP_SourceTable
class. RTP_SourceTable
objects, one per RTP_CoDec
object, create and keep track of the RTP_RemoteSource
and LocalSource
objects
that use the codec.
The information stored in the table is used to identify the sender of a packet by means of the
SSRC identifier carried in each RTP and RTCP packet.
An instance of each of the following three thread classes runs on behalf of each RTP_CoDec
object:
RTP_Receiver_Thread
class. The RTP_Receiver_Thread
thread repeats the
following steps in an endless loop:
receive()
method of the codec's data
Connection
object.
RTProtocol.checkHeader()
method.
RTP_RemoteSouce
object that corresponds to the SSRC identifier carried in the packet by means of the RTP_CoDec
's RTP_SourceTable
.
Chunk
object to the selected RTP_RemoteSource
object for
the sequence number check and a potential feed into the local data flow.
RTCP_Receiver_Thread
class. The RTCP_Receiver_Thread
thread receives RTCP
packets through the codec's control Connection
object. A header check is performed and
the sender is determined. The packet is then passed to the appropriate source object for
further RTCP packet type specific processing.
RTCP_Sender_Thread
class. The RTCP_Sender_Thread
thread generates RTCP
SDES, SR, and RR packets, and forwards them by means of the codec's control Connection
object. The thread computes its RTCP transmission interval according to the algorithm given in
[RFC1889, A.7,].