|
1 /* |
|
2 * Copyright (c) 2007 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 __MCCSESSION_H__ |
|
22 #define __MCCSESSION_H__ |
|
23 |
|
24 #include <mmccctrlobserver.h> |
|
25 #include <mmccnetworksettings.h> |
|
26 #include "mnatfwsocketmediaconnwrapper.h" |
|
27 #include "mccmediastream.h" |
|
28 |
|
29 class CNATFWConnectivityApi; |
|
30 class CMccCodecInformation; |
|
31 class CMccInterface; |
|
32 class CMccLink; |
|
33 |
|
34 class CMccSession : public MMccCtrlObserver |
|
35 { |
|
36 public: |
|
37 |
|
38 static CMccSession* NewL( TUint aIapId ); |
|
39 |
|
40 void CreateLinkL( TInt32& aLinkId, TInt aLinkType, TInetAddr& aDestAddr, |
|
41 TRequestStatus& aStatus ); |
|
42 |
|
43 void CreateLinkL( TInt32& aLinkId, TInt aLinkType, TInetAddr& aDestAddr, |
|
44 TUint aRtcpPort, TRequestStatus& aStatus ); |
|
45 |
|
46 void CreateMediaStreamL( TInt32& aStreamId, TInt32 aLinkId, TStreamDirection aStreamDirection, |
|
47 TRequestStatus& aStatus ); |
|
48 |
|
49 void StartStreamL( TInt32 aStreamId, TRequestStatus& aStatus ); |
|
50 |
|
51 void SetRemoteAddressL( TInt32 aLinkId, TInetAddr& aDestAddr ); |
|
52 |
|
53 void SetRemoteAddressL( TInt32 aLinkId, TInetAddr& aDestAddr, TUint aRtcpPort ); |
|
54 |
|
55 void CloseLinkL( TInt32 aLinkId ); |
|
56 |
|
57 void CloseMediaStreamL( TInt32 aStreamId ); |
|
58 |
|
59 CMccInterface* MccInterface(); |
|
60 |
|
61 TUint32 MccSessionId(); |
|
62 |
|
63 TMccNetSettings& NetSettings(); |
|
64 |
|
65 virtual ~CMccSession(); |
|
66 |
|
67 protected: |
|
68 void ConstructL(); |
|
69 |
|
70 CMccSession( TUint aIapId ); |
|
71 |
|
72 CMccMediaStream* StreamByIdL( TInt32 aStreamId ); |
|
73 |
|
74 CMccLink* LinkByIdL( TInt32 aLinkId ); |
|
75 |
|
76 // MCC controller observer |
|
77 void MccEventReceived( const TMccEvent& aEvent ); |
|
78 |
|
79 void MccMediaStarted( TUint32 aSessionId, TUint32 aLinkId, |
|
80 TUint32 aStreamId, TUint32 aSinkSourceId ); |
|
81 |
|
82 void MccMediaStopped( TUint32 aSessionId, TUint32 aLinkId, |
|
83 TUint32 aStreamId, TUint32 aSinkSourceId ); |
|
84 |
|
85 void MccMediaPaused( TUint32 aSessionId, TUint32 aLinkId, |
|
86 TUint32 aStreamId, TUint32 aSinkSourceId ); |
|
87 |
|
88 void MccMediaResumed( TUint32 aSessionId, TUint32 aLinkId, |
|
89 TUint32 aStreamId, TUint32 aSinkSourceId ); |
|
90 |
|
91 void MccMediaPrepared( TUint32 aSessionId, TUint32 aLinkId, |
|
92 TUint32 aStreamId, TUint32 aSinkSourceId ); |
|
93 |
|
94 void MccMediaInactive( TUint32 aSessionId, TUint32 aLinkId, |
|
95 TUint32 aStreamId, TUint32 aSinkSourceId ); |
|
96 |
|
97 void MccMediaActive( TUint32 aSessionId, TUint32 aLinkId, |
|
98 TUint32 aStreamId, TUint32 aSinkSourceId ); |
|
99 |
|
100 void MccCtrlError( TInt aError, TUint32 aSessionId, |
|
101 TUint32 aLinkId, TUint32 aStreamId, TUint32 aSinkSourceId ); |
|
102 |
|
103 void UnknownMediaReceived( TUint32 aSessionId, TUint32 aLinkId, |
|
104 TUint32 aStreamId, TUint32 aSinkSourceId, TUint8 aPayloadType ); |
|
105 |
|
106 private: // data |
|
107 TUint iIapId; |
|
108 TRequestStatus* iObserverStatus; |
|
109 TUint32 iMccSessionId; |
|
110 RPointerArray< CMccLink > iMccLinks; |
|
111 RPointerArray< CMccMediaStream > iMccStreams; |
|
112 CMccInterface* iMccInterface; |
|
113 TMccNetSettings iNetSettings; |
|
114 }; |
|
115 |
|
116 #endif //__MEDIASTREAM_H__ |