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 |
|
35 class CMusEngTwoWaySession : public CMusEngLiveSession |
|
36 { |
|
37 MUS_UNITTEST( UT_CMusEngOutSession ) |
|
38 MUS_UNITTEST( UT_CMusEngTwoWaySession ) |
|
39 |
|
40 |
|
41 public: |
|
42 /** |
|
43 * Creates new MultimediaSharing Live session. |
|
44 * |
|
45 * @param aRect UI drawing area. It is allowed handle from engine |
|
46 * @param aSessionObserver Interface for session specific callbacks |
|
47 * @param aOutSessionObserver Interface for outsession specific callbacks |
|
48 * @param aLiveSessionObserver interface for live session specific |
|
49 * callbacks |
|
50 * @return CMusEngTwoWaySession* New instanse of specified class |
|
51 */ |
|
52 IMPORT_C static CMusEngTwoWaySession* NewL( |
|
53 const TRect& aRemoteRect, |
|
54 const TRect& aLocalRect, |
|
55 MMusEngSessionObserver& aSessionObserver, |
|
56 MMusEngOutSessionObserver& aOutSessionObserver, |
|
57 MMusEngLiveSessionObserver& aLiveSessionObserver, |
|
58 MMusEngTwoWaySessionObserver& aTwoWayObserver ); |
|
59 |
|
60 |
|
61 public: |
|
62 |
|
63 /** |
|
64 * Destructor |
|
65 */ |
|
66 ~CMusEngTwoWaySession(); |
|
67 |
|
68 public: |
|
69 |
|
70 void EnableDisplayL( TBool aEnable ); |
|
71 |
|
72 void SetOrientationL( TDisplayOrientation aOrientation ); |
|
73 |
|
74 public: |
|
75 |
|
76 /** |
|
77 * Starts or pauses recording |
|
78 */ |
|
79 void RecordL( TBool aRecord ); |
|
80 |
|
81 /** |
|
82 * Tells whether recording is paused or not |
|
83 */ |
|
84 TBool IsRecording(); |
|
85 |
|
86 /** |
|
87 * Sets both remote (receiving video) and local (viewfinder) rects. |
|
88 * |
|
89 */ |
|
90 IMPORT_C void SetRectsL( const TRect& aRemoteRect, |
|
91 const TRect& aLocalRect ); |
|
92 |
|
93 /** |
|
94 * Sets local rect (viewfinder). |
|
95 * |
|
96 */ |
|
97 IMPORT_C void SetLocalRectL( const TRect& aLocalRect ); |
|
98 |
|
99 /** |
|
100 * Gets local rect (viewfinder). |
|
101 * |
|
102 */ |
|
103 IMPORT_C TRect LocalRect() const; |
|
104 |
|
105 protected: // inherited from CMusEngMceOutSession |
|
106 |
|
107 void RectChangedL(); |
|
108 |
|
109 /** |
|
110 * @param aLocalBundle All local streams are supposed to be added to |
|
111 * this bundle |
|
112 */ |
|
113 void CompleteSessionStructureL( CMceStreamBundle& aLocalBundle ); |
|
114 |
|
115 void AddDisplayL( CMceMediaStream& aStream ); |
|
116 |
|
117 |
|
118 protected: // overrides ancestor class versions |
|
119 |
|
120 /** |
|
121 * The state of the session has changed |
|
122 * @param aSession, the session that has changed. |
|
123 */ |
|
124 virtual void HandleSessionStateChanged( CMceSession& aSession, |
|
125 TInt aStatusCode, |
|
126 const TDesC8& aReasonPhrase ); |
|
127 |
|
128 private: // from MMceStreamObserver, |
|
129 // overrides the function in CMusEngMceSession |
|
130 |
|
131 void StreamStateChanged( CMceMediaStream& aStream ); |
|
132 |
|
133 void InactivityTimeout( CMceMediaStream& aStream, |
|
134 CMceRtpSource& aSource ); |
|
135 |
|
136 private: |
|
137 |
|
138 /** |
|
139 * Constructor |
|
140 */ |
|
141 CMusEngTwoWaySession( MMusEngSessionObserver& aSessionObserver, |
|
142 MMusEngOutSessionObserver& aOutSessionObserver, |
|
143 MMusEngLiveSessionObserver& aLiveSessionObserver, |
|
144 MMusEngTwoWaySessionObserver& aTwoWayObserver, |
|
145 const TRect& aRemoteRect, |
|
146 const TRect& aLocalRect ); |
|
147 |
|
148 /** |
|
149 * Second-phase constructor |
|
150 */ |
|
151 void ConstructL(); |
|
152 |
|
153 private: |
|
154 |
|
155 void ReceivingStarted(); |
|
156 |
|
157 void ReceivingStopped(); |
|
158 |
|
159 private: |
|
160 |
|
161 MMusEngTwoWaySessionObserver& iTwoWayObserver; |
|
162 |
|
163 TRect iLocalRect; |
|
164 |
|
165 TBool iReceiving; |
|
166 |
|
167 TBool iBuffered; |
|
168 |
|
169 }; |
|
170 |
|
171 #endif |
|
172 |
|