|
1 /* |
|
2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CMCERTPSINK_H |
|
22 #define CMCERTPSINK_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32std.h> |
|
26 #include <MceMediaSink.h> |
|
27 |
|
28 // CONSTANTS |
|
29 const TMceSinkType KMceRTPSink = 1; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Class representing outgoing RTP stream in MCE. |
|
35 * |
|
36 * CMceRtpSink can be used to send media data to network. |
|
37 * It can be configured not to use RTCP during play in order |
|
38 * to save bandwith. |
|
39 * |
|
40 * CMceRtpSink allows also explicitly sending of RTP RR and SR |
|
41 * messages. |
|
42 * |
|
43 * Enable and Disable operations to it are considered |
|
44 * to be local, so they are not signalled to remote terminal. |
|
45 * |
|
46 * @lib mceclient.lib |
|
47 */ |
|
48 class CMceRtpSink: public CMceMediaSink |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 */ |
|
55 IMPORT_C static CMceRtpSink* NewL(); |
|
56 |
|
57 /** |
|
58 * Two-phased constructor. |
|
59 */ |
|
60 IMPORT_C static CMceRtpSink* NewLC(); |
|
61 |
|
62 /** |
|
63 * Two-phased constructor. |
|
64 * @param aSuppressRTCP ETrue if RTCP not sent during play, |
|
65 * EFalse otherwise |
|
66 * @param aIdentity Identity of user placed in RTCP, ownership not transferred. |
|
67 */ |
|
68 IMPORT_C static CMceRtpSink* NewL( TBool aSuppressRTCP, HBufC8* aIdentity = 0 ); |
|
69 |
|
70 /** |
|
71 * Destructor. |
|
72 */ |
|
73 IMPORT_C ~CMceRtpSink(); |
|
74 |
|
75 public: // From base class |
|
76 |
|
77 /** |
|
78 * Locally resumes sending of RTP packets. |
|
79 */ |
|
80 IMPORT_C void EnableL(); |
|
81 |
|
82 /** |
|
83 * Locally pauses sending of RTP packets. |
|
84 */ |
|
85 IMPORT_C void DisableL(); |
|
86 |
|
87 public: // Functions |
|
88 |
|
89 /** |
|
90 * Sends RTCP sender report to recipient. |
|
91 */ |
|
92 IMPORT_C void SendSRL(); |
|
93 |
|
94 /** |
|
95 * Returns the sequence id of the last packet |
|
96 * sent to network. The value is updated only |
|
97 * when sink is disabled. |
|
98 * @pre IsEnabled() == EFalse |
|
99 * @return sequence number of last sent packet. |
|
100 */ |
|
101 IMPORT_C TUint32 LastPacket() const; |
|
102 |
|
103 /** |
|
104 * Returns the RTP stream source identifier |
|
105 * used in network (SSRC). |
|
106 * @pre CMceSession::State() == CMceSession::EEstablished |
|
107 * @return source identifier used in network (SSRC). |
|
108 */ |
|
109 IMPORT_C TUint32 Ssrc() const; |
|
110 |
|
111 /** |
|
112 * Updates settings of rtp sink. |
|
113 * @pre CMceSession::State() == CMceSession::EIncoming |
|
114 * @param aSuppressRTCP ETrue if RTCP not sent during play, |
|
115 * EFalse otherwise |
|
116 * @param aIdentity Identity of user placed in RTCP, ownership not transferred. |
|
117 */ |
|
118 IMPORT_C void UpdateL( TBool aSuppressRTCP, HBufC8* aIdentity = 0 ); |
|
119 |
|
120 public: //from CMceMediaSink |
|
121 |
|
122 /** |
|
123 * Traversal event handler |
|
124 * @param aEvent the event |
|
125 * @return status, if event was consumed or not or object needs update |
|
126 */ |
|
127 TInt EventReceivedL( TMceEvent& aEvent ); |
|
128 |
|
129 private: |
|
130 |
|
131 /** |
|
132 * C++ default constructor. |
|
133 */ |
|
134 CMceRtpSink(); |
|
135 |
|
136 /** |
|
137 * second-phase constructor |
|
138 * @param aSuppressRTCP ETrue if RTCP not sent during play, |
|
139 * EFalse otherwise |
|
140 * @param aIdentity Identity of user placed in RTCP, ownership not transferred. |
|
141 */ |
|
142 void ConstructL( TBool aSuppressRTCP, HBufC8* aIdentity ); |
|
143 |
|
144 /** |
|
145 * Handles event |
|
146 * @param aEvent the event |
|
147 * @return status, if event was consumed or not or object needs update |
|
148 */ |
|
149 TInt HandleEvent( TMceEvent& aEvent ); |
|
150 |
|
151 void DoITCSendL( TUint8 aITCFunction ); |
|
152 |
|
153 private: // Data |
|
154 |
|
155 //for testing |
|
156 |
|
157 MCE_UNIT_TEST_DEFS |
|
158 |
|
159 }; |
|
160 |
|
161 #endif |