|
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 #ifndef MUSHENGTWOWAYSESSION_H |
|
20 #define MUSHENGTWOWAYSESSION_H |
|
21 |
|
22 // USER |
|
23 #include "musenglivesession.h" |
|
24 #include "musunittesting.h" |
|
25 #include "mussettings.h" |
|
26 |
|
27 // SYSTEM |
|
28 #include <ecam.h> |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class MMusEngLiveSessionObserver; |
|
32 class CMceDisplaySink; |
|
33 class MMusEngTwoWaySessionObserver; |
|
34 class CMusEngRemoteVideoPlayer; |
|
35 |
|
36 |
|
37 class CMusEngTwoWaySession : public CMusEngLiveSession |
|
38 { |
|
39 MUS_UNITTEST( UT_CMusEngOutSession ) |
|
40 MUS_UNITTEST( UT_CMusEngTwoWaySession ) |
|
41 |
|
42 |
|
43 public: |
|
44 /** |
|
45 * Creates new MultimediaSharing Live session. |
|
46 * @return CMusEngTwoWaySession* New instanse of specified class |
|
47 */ |
|
48 static CMusEngTwoWaySession* NewL(); |
|
49 |
|
50 |
|
51 public: |
|
52 |
|
53 /** |
|
54 * Destructor |
|
55 */ |
|
56 ~CMusEngTwoWaySession(); |
|
57 |
|
58 public: |
|
59 |
|
60 void EnableDisplayL( TBool aEnable ); |
|
61 |
|
62 void SetOrientationL( TDisplayOrientation aOrientation ); |
|
63 |
|
64 public: |
|
65 |
|
66 /** |
|
67 * Sets both remote (receiving video) and local (viewfinder) rects. |
|
68 * |
|
69 */ |
|
70 void SetRectsL( const TRect& aRemoteRect, |
|
71 const TRect& aLocalRect ); |
|
72 |
|
73 public: // From MLcSession |
|
74 |
|
75 MLcVideoPlayer* RemoteVideoPlayer(); |
|
76 |
|
77 public: // from MLcFileControl |
|
78 |
|
79 void EnableLcFileL( TBool aEnable ); |
|
80 |
|
81 protected: // inherited from CMusEngMceOutSession |
|
82 |
|
83 /** |
|
84 * Sets local rect (viewfinder). |
|
85 * |
|
86 */ |
|
87 void SetSecondaryRectL( const TRect& aSecondaryRect ); |
|
88 |
|
89 /** |
|
90 * Gets local rect (viewfinder). |
|
91 * |
|
92 */ |
|
93 TRect SecondaryRect() const; |
|
94 |
|
95 /** |
|
96 * |
|
97 */ |
|
98 TBool IsDisplayEnabled(); |
|
99 |
|
100 /** |
|
101 * Checks if displaying remote video. |
|
102 * |
|
103 */ |
|
104 TBool IsDisplayActive(); |
|
105 |
|
106 void RectChangedL(); |
|
107 |
|
108 /** |
|
109 * @param aLocalBundle All local streams are supposed to be added to |
|
110 * this bundle |
|
111 */ |
|
112 void CompleteSessionStructureL( CMceStreamBundle& aLocalBundle ); |
|
113 |
|
114 void AddDisplayL( CMceMediaStream& aStream ); |
|
115 |
|
116 void CreateMceSessionStructureL( TBool aForceSdpBandwidth = |
|
117 EFalse ); |
|
118 |
|
119 |
|
120 protected: // overrides ancestor class versions |
|
121 |
|
122 /** |
|
123 * The state of the session has changed |
|
124 * @param aSession, the session that has changed. |
|
125 */ |
|
126 virtual void HandleSessionStateChanged( CMceSession& aSession, |
|
127 TInt aStatusCode, |
|
128 const TDesC8& aReasonPhrase ); |
|
129 |
|
130 /** |
|
131 * Sets Multimediasharing specific video codec settings like video |
|
132 * bitrate maxbitrate. This functions gets called for every video codec |
|
133 * in session. This function overrides function in ancestor classes. |
|
134 * Function calls also overridden version. |
|
135 */ |
|
136 virtual void AdjustVideoCodecL( CMceVideoCodec& aVideoCodec, |
|
137 TMceSourceType aSourceType ); |
|
138 |
|
139 private: // from MMceStreamObserver, |
|
140 // overrides the function in CMusEngMceSession |
|
141 |
|
142 void StreamStateChanged( CMceMediaStream& aStream ); |
|
143 |
|
144 void InactivityTimeout( CMceMediaStream& aStream, |
|
145 CMceRtpSource& aSource ); |
|
146 |
|
147 private: |
|
148 |
|
149 /** |
|
150 * Constructor |
|
151 */ |
|
152 CMusEngTwoWaySession(); |
|
153 |
|
154 /** |
|
155 * Second-phase constructor |
|
156 */ |
|
157 void ConstructL(); |
|
158 |
|
159 private: |
|
160 |
|
161 void ReceivingStarted(); |
|
162 |
|
163 private: // Data |
|
164 |
|
165 TRect iLocalRect; |
|
166 |
|
167 TBool iReceiving; |
|
168 |
|
169 TBool iBuffered; |
|
170 |
|
171 /// The remote video player implementing MLcVideoPlayer |
|
172 CMusEngRemoteVideoPlayer* iRemoteVideoPlayer; |
|
173 |
|
174 TRect iSetRemoteRect; |
|
175 TRect iSetLocalRect; |
|
176 }; |
|
177 |
|
178 #endif |
|
179 |