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