Next: Sending Data, Up: RTP Sessions
Initiating RTP sessions with ccRTP involves the construction
of an object of the class RTPSession
and calling some optional
initialization methods. RTPSession
constructors take two
mandatory arguments: local network address and local transport port
(where incoming packets are expected). There are two constructors, one
of them takes a host address as first parameter, while the other takes
a multicast address. In the latter case, the application will join to
a multicast group.
General purpose RTP stacks of ccRTP, such as
RTPSession
objects, must be signaled to start execution. This
is done calling the startRunning()
method. Note there is also a
enableStack()
method, this only activates the stack but does not
start the execution of the stack thread.
After the steps above, the application can receive data, but will not transmit to any destination. This and other session parameters can be set as follows:
addDestination
.
setPayloadFormat
. By default, the static payload type 0 is assumed (PCMU format at 8Khz).
setSDESItem
and setPRIVPrefix
methods over the object returned by the defaultApplication
global function.
setSessionBandwidth
method of the session object. If not called, a default bandwidth of 64Kbps is assumed, and 5% of this bandwidth is used for RTCP. This percentage can be changed through the setControlBandwidth method.