|
1 /* |
|
2 * Copyright (c) 2006-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: Represents stream collection. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CNATFWSTREAMCOLLECTION_H |
|
22 #define CNATFWSTREAMCOLLECTION_H |
|
23 |
|
24 #include <e32base.h> |
|
25 #include "natfwinternaldefs.h" //UNIT_TEST |
|
26 |
|
27 /** |
|
28 * Streamcollection represents (SDP) media stream, which consists of |
|
29 * multiple media components (e.g. RTP & RTCP). |
|
30 * |
|
31 * @lib icecandidatehandler.lib |
|
32 * @since S60 v3.2 |
|
33 */ |
|
34 class CIceStreamCollection : public CBase |
|
35 { |
|
36 |
|
37 UNIT_TEST( UT_CIceStreamCollection ) |
|
38 |
|
39 public: |
|
40 |
|
41 /** |
|
42 * Two-phased constructor. |
|
43 * @param aCollectionId Identifier for the stream collection |
|
44 */ |
|
45 static CIceStreamCollection* NewL( TUint aCollectionId ); |
|
46 |
|
47 /** |
|
48 * Two-phased constructor. |
|
49 * @param aCollectionId Identifier for the stream collection |
|
50 */ |
|
51 static CIceStreamCollection* NewLC( TUint aCollectionId ); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 virtual ~CIceStreamCollection(); |
|
57 |
|
58 /** |
|
59 * Returns streamcollection identifier. |
|
60 * |
|
61 * @since S60 v3.2 |
|
62 * return Streamcollection identifier |
|
63 */ |
|
64 TUint StreamCollectionId() const; |
|
65 |
|
66 /** |
|
67 * Adds media component to the collection. |
|
68 * |
|
69 * @since S60 v3.2 |
|
70 * @param aStreamId The stream identifier |
|
71 * @param aComponentId The media component identifier |
|
72 */ |
|
73 void AddMediaComponentL( TUint aStreamId, TUint aComponentId ); |
|
74 |
|
75 /** |
|
76 * Removes media component from the collection. |
|
77 * |
|
78 * @since S60 v3.2 |
|
79 * @param aStreamId The stream identifier |
|
80 */ |
|
81 void RemoveMediaComponent( TUint aStreamId ); |
|
82 |
|
83 /** |
|
84 * Returns ETrue if collection has spcified media component. |
|
85 * |
|
86 * @since S60 v3.2 |
|
87 * @param aStreamId The stream identifier |
|
88 */ |
|
89 TBool HasMediaComponent( TUint aStreamId ) const; |
|
90 |
|
91 /** |
|
92 * Returns number of media components. |
|
93 * |
|
94 * @since S60 v3.2 |
|
95 * return Number of media components |
|
96 */ |
|
97 TInt NumOfMediaComponents() const; |
|
98 |
|
99 private: |
|
100 |
|
101 CIceStreamCollection( TUint aCollectionId ); |
|
102 |
|
103 private: // data |
|
104 |
|
105 class TIceMediaComponent |
|
106 { |
|
107 public: |
|
108 inline TIceMediaComponent( TUint aStreamId, TUint aComponentId ) |
|
109 : iStreamId( aStreamId ), iComponentId( aComponentId ) |
|
110 { |
|
111 |
|
112 } |
|
113 |
|
114 TUint inline StreamId() const { return iStreamId; } |
|
115 TUint inline ComponentId() const { return iComponentId; } |
|
116 |
|
117 private: |
|
118 TUint iStreamId; |
|
119 TUint iComponentId; |
|
120 }; |
|
121 |
|
122 /** |
|
123 * Stream collection identifier. |
|
124 */ |
|
125 TUint iCollectionId; |
|
126 |
|
127 /** |
|
128 * Media components owned by this collection. |
|
129 */ |
|
130 RArray<TIceMediaComponent> iMediaComponents; |
|
131 }; |
|
132 |
|
133 #endif // CNATFWSTREAMCOLLECTION_H |