|
1 /* |
|
2 * Copyright (c) 2004 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 * Interface : |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 #ifndef MCCSINKITEM_H |
|
23 #define MCCSINKITEM_H |
|
24 |
|
25 // INCLUDES |
|
26 #include <e32base.h> |
|
27 #include "mmccevents.h" |
|
28 #include "mccmultiplexer.h" |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CMMFBuffer; |
|
32 class MDataSink; |
|
33 class TMMFEvent; |
|
34 class CPayloadFormatRead; |
|
35 class TRtpRecvHeader; |
|
36 class MAsyncEventHandler; |
|
37 class CMMFDataBuffer; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * |
|
43 */ |
|
44 class CMccSinkItem : public CBase |
|
45 { |
|
46 public: // Constructors and destructor |
|
47 |
|
48 static CMccSinkItem* NewLC( MDataSink* aSink, |
|
49 TBool aSinkIsDecoder, |
|
50 TUid aMediaType, |
|
51 TBool aPassAllBuffersSink ); |
|
52 |
|
53 virtual ~CMccSinkItem(); |
|
54 |
|
55 public: // New functions |
|
56 |
|
57 void BufferFilledL( CMMFBuffer* aBuffer, |
|
58 const TRtpRecvHeader* aHeaderInfo, |
|
59 TBool aPrimary, |
|
60 TUid aMediaType ); |
|
61 |
|
62 void FillBufferRequestL( CMMFBuffer* aBuffer ); |
|
63 |
|
64 TBool Match( MDataSink* aSink ); |
|
65 |
|
66 TInt SourceThreadLogon( MAsyncEventHandler& aEventHandler ); |
|
67 |
|
68 TInt SendEventToClient( const TMMFEvent& aEvent ); |
|
69 |
|
70 TUid MediaType() const; |
|
71 |
|
72 void SetSourceMode( TBool aPassAllRequestsSource ); |
|
73 |
|
74 TBool PassAllRequestsToSource() const; |
|
75 |
|
76 TUid ResolveMediaType( CMMFBuffer* aBuffer ) const; |
|
77 |
|
78 void RegisterPayloadTypesL( const RArray<TUint>& aPayloadTypes ); |
|
79 |
|
80 const RArray<TUint>& RegisteredPayloadTypes() const; |
|
81 |
|
82 CMMFBuffer* RequestedBuffer(); |
|
83 |
|
84 MAsyncEventHandler* EventHandler(); |
|
85 |
|
86 void SetMultiplexerState( CMccMultiplexer::TMccMultiplexerState aState ); |
|
87 |
|
88 CMccMultiplexer::TMccMultiplexerState MultiplexerState() const; |
|
89 |
|
90 private: // Private construction |
|
91 |
|
92 CMccSinkItem( TUid aMediaType, TBool aPassAllBuffersSink ); |
|
93 |
|
94 void ConstructL( MDataSink* aSink, TBool aSinkIsDecoder ); |
|
95 |
|
96 private: |
|
97 |
|
98 MDataSink* Sink(); |
|
99 |
|
100 void CopyBufferL( CMMFBuffer* aDesBuffer, CMMFBuffer* aOrigBuffer ); |
|
101 |
|
102 TBool IsInternalDecoder( TUid aDecoderUid ) const; |
|
103 |
|
104 void StoreBufferL( CMMFBuffer* aBuffer ); |
|
105 |
|
106 CMMFBuffer* GetStoredBuffer(); |
|
107 |
|
108 TBool HandleBadDataL( CMMFDataBuffer* aBuffer ); |
|
109 |
|
110 TBool HandleStreamStateChangeEvent( TMccEvent& aEvent ); |
|
111 |
|
112 private: |
|
113 |
|
114 MDataSink* iSink; |
|
115 |
|
116 CPayloadFormatRead* iDecoder; |
|
117 |
|
118 CMMFBuffer* iRequestedBuffer; |
|
119 |
|
120 RPointerArray<CMMFBuffer> iStoredBuffers; |
|
121 |
|
122 MAsyncEventHandler* iEventHandler; |
|
123 |
|
124 TUid iMediaType; |
|
125 |
|
126 TBool iPassAllBuffersSink; |
|
127 |
|
128 TBool iPassAllRequestsSource; |
|
129 |
|
130 TMccEventType iReportedEvent; |
|
131 |
|
132 RArray<TUint> iPayloadsToAccept; |
|
133 |
|
134 TInt iBadDataCount; |
|
135 |
|
136 CMccMultiplexer::TMccMultiplexerState iState; |
|
137 |
|
138 private: |
|
139 #ifdef EUNIT_TEST |
|
140 friend class UT_CMccSinkItem; |
|
141 friend class UT_CMccMultiplexer; |
|
142 #endif |
|
143 }; |
|
144 |
|
145 #endif // MCCSINKITEM_H |
|
146 |
|
147 // End of File |