7 Nokia Corporation - initial contribution. |
7 Nokia Corporation - initial contribution. |
8 Contributors: |
8 Contributors: |
9 --> |
9 --> |
10 <!DOCTYPE concept |
10 <!DOCTYPE concept |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
12 <concept id="GUID-59230503-7E2E-505D-9BC9-C2D2DB96B3E9" xml:lang="en"><title>RTPExample: |
12 <concept id="GUID-59230503-7E2E-505D-9BC9-C2D2DB96B3E9" xml:lang="en"><title>RTPExample: RTP Packet Streaming Example</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
13 RTP Packet Streaming Example</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
13 <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 |
14 <section id="GUID-50EDE46C-719B-4D77-8C61-666A5125C07C"><title>Description</title> <p>This example code demonstrates RTP |
14 pre-connected socket and initialises new send and receive sources |
15 packet streaming. It uses <codeph>CRtpFileSender</codeph> to send RTP packets |
15 on the RTP session. It registers the callback functions when an RTP |
16 and <codeph>CRtpFileStreamer</codeph> to receive RTP packets. The example |
16 packet is successfully sent by a send source or received by a receive |
17 opens an RTP session using the pre-connected socket and initialises new send |
17 source, to receive notifications whenever an RTP packet is sent or |
18 and receive sources on the RTP session. It registers the callback functions |
18 received. </p> <p>The <filepath>RTPExample</filepath> example code |
19 when an RTP packet is successfully sent by a send source or received by a |
19 provides the following functionality: </p> </section> |
20 receive source, to receive notifications whenever an RTP packet is sent or |
20 <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> |
21 received. </p> <p>The <filepath>RTPExample</filepath> example code provides |
21 <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 |
22 the following functionality: </p> </section> |
22 new send sources on the RTP session. </p> </section> |
23 <section id="GUID-1A5135CC-CAF2-58D8-B37D-5C04B0454D59"><title>Download</title> <p>Click |
23 <section id="GUID-3F6D2D79-9639-4EAC-9EE6-BA32DC688B6F"><title>Sending |
24 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> |
24 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> |
25 <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 |
25 <li id="GUID-C279418B-B804-53F1-B18F-1FB030BC6007"><p>gets a new RTP |
26 sources on the RTP session. </p> </section> |
26 packet to send from the send source </p> </li> |
27 <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> |
27 <li id="GUID-35269B55-BD88-5CEA-A9E1-5423BB0E3AF9"><p>sets the RTP |
28 <li id="GUID-C279418B-B804-53F1-B18F-1FB030BC6007"><p>gets a new RTP packet |
28 timestamp of the RTP packet </p> </li> |
29 to send from the send source </p> </li> |
29 <li id="GUID-E38F83C8-5D08-51D2-9E6A-DA81FEBF6512"><p>reads a block |
30 <li id="GUID-35269B55-BD88-5CEA-A9E1-5423BB0E3AF9"><p>sets the RTP timestamp |
30 of data from the source file </p> </li> |
31 of the RTP packet </p> </li> |
31 <li id="GUID-42F2FE2D-D3B5-583E-B05C-CC693D3E14C9"><p>creates an RTP |
32 <li id="GUID-E38F83C8-5D08-51D2-9E6A-DA81FEBF6512"><p>reads a block of data |
32 packet using the block of data </p> </li> |
33 from the source file </p> </li> |
33 <li id="GUID-B6ED7AF9-F395-589E-B511-3EBEAEF2E359"><p>sends the RTP |
34 <li id="GUID-42F2FE2D-D3B5-583E-B05C-CC693D3E14C9"><p>creates an RTP packet |
34 packet </p> </li> |
35 using the block of data </p> </li> |
35 <li id="GUID-84488760-F28D-584A-A5F1-9E5D44C8C2D4"><p>closes the source |
36 <li id="GUID-B6ED7AF9-F395-589E-B511-3EBEAEF2E359"><p>sends the RTP packet </p> </li> |
36 file. </p> </li> |
37 <li id="GUID-84488760-F28D-584A-A5F1-9E5D44C8C2D4"><p>closes the source file. </p> </li> |
37 </ul> <p> <codeph>CRtpFileSender::PacketSent()</codeph> is called |
38 </ul> <p> <codeph>CRtpFileSender::PacketSent()</codeph> is called to notify |
38 to notify that the RTP packet has been successfully sent. </p> </section> |
39 that the RTP packet has been successfully sent. </p> </section> |
39 <section id="GUID-72251E64-B5EF-4994-8ECF-89872AE23D2F"><title>Receiving |
40 <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 |
40 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 |
41 is called, which registers the packet. This can be used for different types |
41 function is called, which registers the packet. This can be used for |
42 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 |
42 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. |
43 function retrieves the payload from the packet received and writes it to the |
43 The function retrieves the payload from the packet received and writes |
44 target file. </p> </section> |
44 it to the target file. </p> </section> |
45 <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> |
45 <section id="GUID-2291AD95-0A59-4FE0-A52E-12FA0876E097"><title>Class |
46 <section id="GUID-8FE5D0CA-57F6-4CF2-A5AA-44C6A7534AA3"><title>Usage</title> <p>The <xref href="GUID-3100800B-B2F7-50EF-BD4C-3C345ECCB2A5.dita">Symbian |
46 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> |
47 build process</xref> describes how to build an application. </p> <p>This |
47 <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 |
48 is a console application, so does not have a GUI. It builds an executable |
48 a GUI. It builds an executable called <filepath>RTPExample.exe</filepath> in the standard location (<filepath>\epoc32\release\winscw\</filepath> <i><build_variant></i> for CodeWarrior). After launching the |
49 called <filepath>RTPExample.exe</filepath> in the standard location (<filepath>\epoc32\release\winscw\</filepath> <i><build_variant></i> for |
49 executable, depending on the emulator you are using, you may need |
50 CodeWarrior). After launching the executable, depending on the emulator you |
50 to task away from the app launcher/shell screen to view the console. </p> </section> |
51 are using, you may need to task away from the app launcher/shell screen to |
51 <section id="GUID-467EE2A3-9D85-4909-9CB1-98C9CBCAA41D"><title>See |
52 view the console. </p> </section> |
52 also</title> <p> <xref href="GUID-993629CB-17B4-5E87-8DE1-06A4AC473FDD.dita">RTP overview</xref> </p> </section> |
53 <section id="GUID-467EE2A3-9D85-4909-9CB1-98C9CBCAA41D"><title>See also</title> <p> <xref href="GUID-993629CB-17B4-5E87-8DE1-06A4AC473FDD.dita">RTP |
|
54 overview</xref> </p> </section> |
|
55 </conbody></concept> |
53 </conbody></concept> |