|
1 /* |
|
2 * Copyright (c) 2006 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: Definition of the DataBufferQueue Item |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CDATABUFFERQUEUEITEM_H |
|
20 #define C_CDATABUFFERQUEUEITEM_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 namespace multimedia |
|
26 { |
|
27 class MDataBuffer; |
|
28 class CDataBufferQueueItem; |
|
29 |
|
30 // Observer |
|
31 /** |
|
32 * Observer that monitors the BufferProcessed Event from the Source Side. |
|
33 * @lib EnhancedMediaClient.lib |
|
34 * @since S60 v3.2 |
|
35 */ |
|
36 class MBufferObserver |
|
37 { |
|
38 public: |
|
39 virtual void BufferProcessed( CDataBufferQueueItem* aItem ) = 0; |
|
40 virtual void HandleCancel( CDataBufferQueueItem& aItem ) = 0; |
|
41 }; |
|
42 |
|
43 /** |
|
44 * DataBufferQueueItem which encapsulates the Client Buffers. |
|
45 * @lib EnhancedMediaClient.lib |
|
46 * @since S60 v3.2 |
|
47 */ |
|
48 class CDataBufferQueueItem : public CActive |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 /** |
|
52 * Function to Create the Object. |
|
53 * @param aObserver Observer to callback the Event. |
|
54 */ |
|
55 static CDataBufferQueueItem* NewL( MBufferObserver& aObserver, |
|
56 MDataBuffer& aBuffer, |
|
57 TBool aLastBuffer, |
|
58 TUint aBufSeqNum ); |
|
59 |
|
60 /** |
|
61 * Destructor. |
|
62 */ |
|
63 virtual ~CDataBufferQueueItem(); |
|
64 |
|
65 /** |
|
66 * From CActive. |
|
67 * Indicates that this active object has issued a |
|
68 * request and that it is now outstanding |
|
69 * |
|
70 * @since S60 v3.2 |
|
71 */ |
|
72 void SetActive(); |
|
73 |
|
74 /** |
|
75 * From CDataBufferQueueItem. |
|
76 * Returns the DataBuffer Stored on in the Queue Item |
|
77 * |
|
78 * @since S60 v3.2 |
|
79 */ |
|
80 MDataBuffer& DataBuffer(); |
|
81 |
|
82 /** |
|
83 * From CDataBufferQueueItem. |
|
84 * Returns the Error Stored on Completion of the Request |
|
85 * |
|
86 * @since S60 v3.2 |
|
87 */ |
|
88 TInt Error(); |
|
89 |
|
90 /** |
|
91 * From CDataBufferQueueItem. |
|
92 * Returns the Last Buffer status of the Buffer |
|
93 * |
|
94 * @since S60 v3.2 |
|
95 */ |
|
96 TDesC8& GetDataBufferAttributesDesc(); |
|
97 |
|
98 /** |
|
99 * From CDataBufferQueueItem. |
|
100 * Returns the buffer sequence number |
|
101 * |
|
102 * @since S60 v5.0 |
|
103 */ |
|
104 TUint GetBufferSequenceNumber(); |
|
105 |
|
106 /** |
|
107 * |
|
108 */ |
|
109 void CompleteSelf( TInt aError ); |
|
110 |
|
111 protected: |
|
112 // From CActive |
|
113 void RunL(); |
|
114 void DoCancel(); |
|
115 TInt RunError( TInt aError ); |
|
116 |
|
117 private: |
|
118 CDataBufferQueueItem( MBufferObserver& aObserver, |
|
119 MDataBuffer& aBuffer, |
|
120 TBool aLastBuffer, |
|
121 TUint aBufSeqNum ); |
|
122 void ConstructL(); |
|
123 |
|
124 public: |
|
125 // next item |
|
126 TSglQueLink* iLink; |
|
127 |
|
128 private: |
|
129 /** |
|
130 * Observer stored to Callback |
|
131 */ |
|
132 MBufferObserver& iObserver; |
|
133 /** |
|
134 * Buffer Stored in the Queue item |
|
135 */ |
|
136 MDataBuffer& iBuffer; |
|
137 /** |
|
138 * Error Stored when the Request Completes |
|
139 */ |
|
140 TInt iError; |
|
141 |
|
142 struct DataBufferAttributesStruct |
|
143 { |
|
144 TBool iLastBuffer; // streaming data last buffer indicator |
|
145 TUint iBufferSeqNum; // buffer sequence number |
|
146 }; |
|
147 /** |
|
148 * |
|
149 */ |
|
150 TPckgBuf<DataBufferAttributesStruct> iDataBufferAttributesStructPckg; |
|
151 }; |
|
152 |
|
153 } // namespace multimedia |
|
154 |
|
155 #endif // C_CDATABUFFERQUEUEITEM_H |
|
156 |
|
157 // End of File |