Symbian3/SDK/Source/GUID-0ACAFB87-0D45-5BAA-B40A-9A7DC1646B01.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 0 89d6a7a84779
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-0ACAFB87-0D45-5BAA-B40A-9A7DC1646B01" xml:lang="en"><title>Managing
the RTCP packets and reports</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>This section describes how to send various types of RTCP packets, set the
stream parameters, get stream statistics and close the session. </p>
<section id="GUID-663C6781-3137-5D48-A836-6ADDD4474805"><title>Sending various
RTCP packets</title><p>To automatically send SR, RR, or SDES packets, call <xref href="GUID-97FC8566-E4AD-3881-8669-134798A88779.dita#GUID-97FC8566-E4AD-3881-8669-134798A88779/GUID-B32E14CD-DE13-3E89-96B4-5713CB7217A7"><apiname>RRtpSession::SetRTCPAutoSend()</apiname></xref> with
its paramter set to ETrue. For more information about these packets, see Managing
send and receive reports.</p><codeblock xml:space="preserve">session.SetRTCPAutoSend(ETrue);
</codeblock><p>Set the RTCP auto-send time interval in microseconds by calling <xref href="GUID-97FC8566-E4AD-3881-8669-134798A88779.dita#GUID-97FC8566-E4AD-3881-8669-134798A88779/GUID-506A9D47-03DE-36D0-8466-D7BFB725FBB1"><apiname>RRtpSession::SetRtcpInterval()</apiname></xref>.</p><codeblock xml:space="preserve">session.SetRtcpInterval(1000);
</codeblock><p>If auto-sending is set to EFalse, call <xref href="GUID-97FC8566-E4AD-3881-8669-134798A88779.dita#GUID-97FC8566-E4AD-3881-8669-134798A88779/GUID-7AF454C8-6943-3986-BC82-CF6BFB27AF7A"><apiname>RRtpSession::SendRTCPPacketL()</apiname></xref> to
send a packet.</p><codeblock xml:space="preserve">//aPacket is a valid RTCP packet session.SendRTCPPacketL(aPacket);
</codeblock><p>For more information, see the definition of TRtpSendPacketType.
 </p><codeblock xml:space="preserve">Call RRtpSession::SendAppL() to send an APP packet.</codeblock><p>For
an SDES RTP packet, call <xref href="GUID-97FC8566-E4AD-3881-8669-134798A88779.dita#GUID-97FC8566-E4AD-3881-8669-134798A88779/GUID-1D4254AC-043A-3BA7-ABF7-B008DC9F4D01"><apiname>RRtpSession::SetSDESL()</apiname></xref> to set
the SDES details such as CNAME, NAME, PHONE, EMAIL and so on. You must set
these details before the packet is sent. The CNAME must be unique for an RTP
session.   <xref href="GUID-97FC8566-E4AD-3881-8669-134798A88779.dita#GUID-97FC8566-E4AD-3881-8669-134798A88779/GUID-0B04130D-585C-31D9-A1F0-B4166BC26A92"><apiname>RRtpSession::GetSDES()</apiname></xref> enables you to fetch
the data associated with the specified SDES item.  </p><p> You can set the
data associated with a PRIV (Private Extensions) SDES item by calling <xref href="GUID-97FC8566-E4AD-3881-8669-134798A88779.dita#GUID-97FC8566-E4AD-3881-8669-134798A88779/GUID-D7E02919-E39A-3CA0-A8C7-BE77504C0948"><apiname>RRtpSession::SetPRIVL()</apiname></xref>.
 PRIV (Private Extensions) SDES is not supported.   Call <xref href="GUID-97FC8566-E4AD-3881-8669-134798A88779.dita#GUID-97FC8566-E4AD-3881-8669-134798A88779/GUID-00D4DBEA-3EDB-3F88-90B8-374D2CECB383"><apiname>RRtpSession::ByeL()</apiname></xref> to
send an RTCP Bye packet.  </p> </section>
<section><title>Setting the stream parameters </title> <p>The <xref href="GUID-8420B7F8-7BE3-30C0-BFC4-05F7A13361B6.dita"><apiname>SetRtpStreamParameters()</apiname></xref> method
sets the following stream parameters: </p> <ul>
<li id="GUID-60CD5E08-6829-5675-AC64-6CAA3C6D53D9"><p>maximum number of sequential
packets that must be received for a good stream. </p> </li>
<li id="GUID-8ED20A24-B6D0-5CE4-A115-459FED0E885C"><p>maximum number of dropped
packets to be considered a dropout. </p> </li>
<li id="GUID-688E9BB0-96E9-5090-B80F-1E75D27D2FCD"><p>maximum number of packets
by which a packet can be delayed to be considered as dropped. </p> </li>
</ul> <codeblock id="GUID-601FA412-12EA-571F-913C-7F4E383EE8BD" xml:space="preserve">SetRtpStreamParameters(1,100,3000);// set MinSequential, MaxMisorder &amp; MaxDropout </codeblock> </section>
<section><title>Getting the stream statistics</title> <p>The <xref href="GUID-97FC8566-E4AD-3881-8669-134798A88779.dita#GUID-97FC8566-E4AD-3881-8669-134798A88779/GUID-63B8D608-D078-3F8E-9ABD-2CD29F1396F5"><apiname>RRtpSession::RtcpStatistics()</apiname></xref> method
provides sending and receiving statistics about the current active RTP session.
The statistics depend on the contents of the latest Sender Report (SR) packets
and Receiver Report (RR) packets. The returned <xref href="GUID-53671562-A0BB-379D-AC1A-0006F70A4513.dita"><apiname>TRtcpStatistics</apiname></xref> structure
contains the following statistics: </p> <table id="GUID-82B41FFA-00C1-5477-9727-2C3DBCA754D5">
<tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/>
<thead>
<row>
<entry>Direction </entry>
<entry>Statistic </entry>
</row>
</thead>
<tbody>
<row>
<entry><p>Sending </p> </entry>
<entry><p>Total number of packets sent from the beginning of the RTP session
to the latest SR. </p> </entry>
</row>
<row>
<entry><p>Total number of payload octets sent from the beginning of the RTP
session to the latest SR. </p> </entry>
</row>
<row>
<entry><p>Receiving </p> </entry>
<entry><p>Inter-arrival jitter. </p> </entry>
</row>
<row>
<entry><p>Total number of packets lost since the beginning of the RTP session. </p> </entry>
</row>
<row>
<entry><p>Fraction of packets lost since the previous SR or RR. </p> </entry>
</row>
</tbody>
</tgroup>
</table> <p>For more information about these statistics, see the RTP standard
in <xref href="http://www.ietf.org/rfc/rfc3550.txt" scope="external">RFC 3550</xref>. </p> </section>
<section><title>Closing a session</title> <p> <codeph>Close()</codeph> closes
the RTP session. All the send and receive streams are disconnected after this
call. </p> <codeblock id="GUID-6723F7F1-DDBE-5912-BF72-8B0902CDE681" xml:space="preserve">session.Close(); 
delete session;</codeblock> </section>
<section><title>See also</title> <p><xref href="GUID-FBA52F3B-0A7A-5FE3-82CD-72F88788D432.dita#GUID-FBA52F3B-0A7A-5FE3-82CD-72F88788D432/GUID-352B33B6-D02B-5ECB-B154-6CB06C21A377">Types
of RTCP packets</xref>  </p> <p><xref href="GUID-5287A403-1094-5682-A443-A6C2A04A1F23.dita">Creating
and Managing an RTP session</xref>  </p> </section>
</conbody></concept>