Symbian3/SDK/Source/GUID-59230503-7E2E-505D-9BC9-C2D2DB96B3E9.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 7 51a74ef9ed63
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-59230503-7E2E-505D-9BC9-C2D2DB96B3E9" xml:lang="en"><title>RTPExample: RTP Packet Streaming Example</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<section id="GUID-50EDE46C-719B-4D77-8C61-666A5125C07C"><title>Description</title> <p>This example code demonstrates RTP packet streaming. It uses <codeph>CRtpFileSender</codeph> to send RTP packets and <codeph>CRtpFileStreamer</codeph> to receive RTP packets. The example opens an RTP session using the
pre-connected socket and initialises new send and receive sources
on the RTP session. It registers the callback functions when an RTP
packet is successfully sent by a send source or received by a receive
source, to receive notifications whenever an RTP packet is sent or
received. </p> <p>The <filepath>RTPExample</filepath> example code
provides the following functionality: </p> </section>
<section id="GUID-1A5135CC-CAF2-58D8-B37D-5C04B0454D59"><title>Download</title> <p>Click on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-a4ef24ea-0ffa-410a-a19c-e1085f64c0e2.zip" scope="external">RTPExample.zip</xref></p><p>Click <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-a4ef24ea-0ffa-410a-a19c-e1085f64c0e2.html" scope="peer">browse</xref> to view the example code. </p> </section>
<section id="GUID-6CB87F84-BDBB-4606-917D-3FE79FDA16C5"><title>Initialising</title> <codeblock id="GUID-DD0E36D0-2CC4-52FF-8C58-2D0061A453CA" xml:space="preserve">void CRtpFileStreamer::ConstructL();</codeblock> <p>Opens an RTP session using the pre-connected socket and initialises
new send sources on the RTP session. </p> </section>
<section id="GUID-3F6D2D79-9639-4EAC-9EE6-BA32DC688B6F"><title>Sending
an RTP packet</title> <codeblock id="GUID-53DAAACD-46A9-5DAA-8B2D-A4108DA6DFA7" xml:space="preserve">void CRtpFileSender::RunL();</codeblock> <p>Sends the RTP packet. This does the following: </p> <ul>
<li id="GUID-C279418B-B804-53F1-B18F-1FB030BC6007"><p>gets a new RTP
packet to send from the send source </p> </li>
<li id="GUID-35269B55-BD88-5CEA-A9E1-5423BB0E3AF9"><p>sets the RTP
timestamp of the RTP packet </p> </li>
<li id="GUID-E38F83C8-5D08-51D2-9E6A-DA81FEBF6512"><p>reads a block
of data from the source file </p> </li>
<li id="GUID-42F2FE2D-D3B5-583E-B05C-CC693D3E14C9"><p>creates an RTP
packet using the block of data </p> </li>
<li id="GUID-B6ED7AF9-F395-589E-B511-3EBEAEF2E359"><p>sends the RTP
packet </p> </li>
<li id="GUID-84488760-F28D-584A-A5F1-9E5D44C8C2D4"><p>closes the source
file. </p> </li>
</ul> <p> <codeph>CRtpFileSender::PacketSent()</codeph> is called
to notify that the RTP packet has been successfully sent. </p> </section>
<section id="GUID-72251E64-B5EF-4994-8ECF-89872AE23D2F"><title>Receiving
an RTP packet</title> <codeblock id="GUID-0C30C58E-70B9-5E2A-946F-F349E8026454" xml:space="preserve">void CRtpFileStreamer::NewSource();</codeblock> <p>When an RTP packet with a new receive source arrives, this callback
function is called, which registers the packet. This can be used for
different types of RTP packets such as APP, BYE, SDES, SR and RR. </p> <codeblock id="GUID-22A41C41-613E-5DB5-BA35-1F92FEE214AF" xml:space="preserve">void CRtpFileStreamer::PacketArrived();</codeblock> <p>Whenever an RTP packet arrives, this callback function is called.
The function retrieves the payload from the packet received and writes
it to the target file. </p> </section>
<section id="GUID-2291AD95-0A59-4FE0-A52E-12FA0876E097"><title>Class
summary</title><p> <xref href="GUID-D4F08503-F1EF-3531-9C3C-4AF24A6255F0.dita"><apiname>RSocket </apiname></xref>  <xref href="GUID-EF29C1D7-B1E5-370F-AE37-66231A6BE449.dita"><apiname>RSocketServ </apiname></xref>  <xref href="GUID-BED8A733-2ED7-31AD-A911-C1F4707C67FD.dita"><apiname>RConnection </apiname></xref> <xref href="GUID-97FC8566-E4AD-3881-8669-134798A88779.dita"><apiname> RRtpSession </apiname></xref>  <xref href="GUID-EF30A0A3-612A-362D-9AC5-07FD314E5CDC.dita"><apiname>RRtpSendSource </apiname></xref>  <xref href="GUID-3690BFA1-A4EA-34EA-AD63-5FCC14CB67A2.dita"><apiname>RRtpReceiveSource </apiname></xref>  <xref href="GUID-0720D1BD-7F73-3EF6-80A6-17127EF17C91.dita"><apiname>RRtpSendPacket </apiname></xref>  <xref href="GUID-3E4F47A8-0432-307A-B871-A2F7F3A7505F.dita"><apiname>RRtpReceivePacket </apiname></xref>  <xref href="GUID-E263C747-946F-35AA-9F1D-41833BD350FC.dita"><apiname>RFs </apiname></xref> <xref href="GUID-BE0804F6-4375-3C8A-8C83-968F510466E0.dita"><apiname>RFile </apiname></xref>  </p></section>
<section id="GUID-8FE5D0CA-57F6-4CF2-A5AA-44C6A7534AA3"><title>Usage</title> <p>The Symbian build process describes how to build an application. </p> <p>This is a console application, so does not have
a GUI. It builds an executable called <filepath>RTPExample.exe</filepath> in the standard location (<filepath>\epoc32\release\winscw\</filepath> <i>&lt;build_variant&gt;</i> for CodeWarrior). After launching the
executable, depending on the emulator you are using, you may need
to task away from the app launcher/shell screen to view the console. </p> </section>
<section id="GUID-467EE2A3-9D85-4909-9CB1-98C9CBCAA41D"><title>See
also</title> <p> <xref href="GUID-993629CB-17B4-5E87-8DE1-06A4AC473FDD.dita">RTP overview</xref>  </p> </section>
</conbody></concept>