williamr@2
|
1 |
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@2
|
4 |
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
// source\server\mmfdatapath.h
|
williamr@2
|
15 |
//
|
williamr@2
|
16 |
//
|
williamr@2
|
17 |
|
williamr@2
|
18 |
#ifndef MMFDATAPATH_H
|
williamr@2
|
19 |
#define MMFDATAPATH_H
|
williamr@2
|
20 |
|
williamr@2
|
21 |
#include <mmf/common/mmfcontroller.h>
|
williamr@2
|
22 |
#include <mmf/server/mmfdatasource.h>
|
williamr@2
|
23 |
#include <mmf/server/mmfdatasink.h>
|
williamr@2
|
24 |
#include <mmf/server/mmfcodec.h>
|
williamr@2
|
25 |
#include <mmf/server/mmfnullcodec.h>
|
williamr@2
|
26 |
#include <mmf/server/mmfbuffer.h>
|
williamr@2
|
27 |
#include <mmf/common/mmfutilities.h>
|
williamr@2
|
28 |
#include <mmf/server/mmfformat.h>
|
williamr@2
|
29 |
#include "mmfsubthreadbase.h"
|
williamr@2
|
30 |
|
williamr@2
|
31 |
/**
|
williamr@2
|
32 |
* @publishedAll
|
williamr@2
|
33 |
* @deprecated
|
williamr@2
|
34 |
*
|
williamr@2
|
35 |
* Datapath general error code used when sending events to clients
|
williamr@2
|
36 |
*/
|
williamr@2
|
37 |
const TUid KMMFErrorCategoryDataPathGeneralError = {0x101F76DC};
|
williamr@2
|
38 |
|
williamr@2
|
39 |
|
williamr@2
|
40 |
|
williamr@2
|
41 |
/**
|
williamr@2
|
42 |
@publishedAll
|
williamr@2
|
43 |
@deprecated
|
williamr@2
|
44 |
|
williamr@2
|
45 |
Abstract utility class that moves data from a single data source to a single data sink, via a codec if required.
|
williamr@2
|
46 |
|
williamr@2
|
47 |
All functions are exported form the DLL and are virtual to allow plugins to define their own data paths.
|
williamr@2
|
48 |
*/
|
williamr@2
|
49 |
class CMMFDataPath : public CActive,
|
williamr@2
|
50 |
public MDataSink,
|
williamr@2
|
51 |
public MDataSource,
|
williamr@2
|
52 |
public MAsyncEventHandler
|
williamr@2
|
53 |
{
|
williamr@2
|
54 |
public:
|
williamr@2
|
55 |
|
williamr@2
|
56 |
//CMMFDataPath constructor if codec Uid is not already known by CMMFController
|
williamr@2
|
57 |
//and there is no data path ambiguity - ie only one data path is possible
|
williamr@2
|
58 |
IMPORT_C static CMMFDataPath* NewL(MAsyncEventHandler& aEventHandler);
|
williamr@2
|
59 |
|
williamr@2
|
60 |
//CMMFDataPath constructor if codec Uid is not already known by CMMFController
|
williamr@2
|
61 |
//and there is ambiguity ie more than one possible data path TMediaId used to select path
|
williamr@2
|
62 |
IMPORT_C static CMMFDataPath* NewL(TMediaId aMediaId, MAsyncEventHandler& aEventHandler);
|
williamr@2
|
63 |
|
williamr@2
|
64 |
//CMMFDataPath constructor if codec Uid is already known by CMMFController
|
williamr@2
|
65 |
//and there is no data path ambiguity - ie only one data path is possible
|
williamr@2
|
66 |
IMPORT_C static CMMFDataPath* NewL(TUid aCodecUid, MAsyncEventHandler& aEventHandler);
|
williamr@2
|
67 |
|
williamr@2
|
68 |
//CMMFDataPath constructor if codec Uid is already known by CMMFController
|
williamr@2
|
69 |
//and there is ambiguity ie more than one possible data path TMediaId used to select path
|
williamr@2
|
70 |
IMPORT_C static CMMFDataPath* NewL(TUid aCodecUid, TMediaId aMediaId, MAsyncEventHandler& aEventHandler);
|
williamr@2
|
71 |
|
williamr@2
|
72 |
IMPORT_C virtual ~CMMFDataPath();
|
williamr@2
|
73 |
|
williamr@2
|
74 |
// Called when source and sink needs to be de-referenced
|
williamr@2
|
75 |
IMPORT_C virtual void ResetL();
|
williamr@2
|
76 |
|
williamr@2
|
77 |
//from MDataSink - CMMFData path is a sink to its MDataSource
|
williamr@2
|
78 |
IMPORT_C virtual void EmptyBufferL(CMMFBuffer* aBuffer, MDataSource* aSupplier, TMediaId aMediaId); //only required for an active push MDataSource requesting a buffer empty - not implemented
|
williamr@2
|
79 |
IMPORT_C virtual void BufferFilledL(CMMFBuffer* aBuffer); //called by the CMMFDataPath's MDataSource when it has filled the buffer
|
williamr@2
|
80 |
IMPORT_C virtual TBool CanCreateSinkBuffer(); //from both MDataSource & MDataSink?
|
williamr@2
|
81 |
IMPORT_C virtual CMMFBuffer* CreateSinkBufferL(TMediaId aMediaId); //CMMFDataPath can't create buffers
|
williamr@2
|
82 |
IMPORT_C virtual CMMFBuffer* CreateSinkBufferL(TMediaId aMediaId, TBool &aReference); //CMMFDataPath can't create buffers
|
williamr@2
|
83 |
|
williamr@2
|
84 |
IMPORT_C virtual TFourCC SinkDataTypeCode(TMediaId aMediaId);
|
williamr@2
|
85 |
|
williamr@2
|
86 |
//from MDataSource
|
williamr@2
|
87 |
IMPORT_C virtual void FillBufferL(CMMFBuffer* aBuffer, MDataSink* aConsumer, TMediaId aMediaId); //only required for an active pull MDataSink requesting buffer fill - not implementated
|
williamr@2
|
88 |
IMPORT_C virtual void BufferEmptiedL(CMMFBuffer* aBuffer);//called by the CMMFDataPath's MDataSink when it has emptied the buffer
|
williamr@2
|
89 |
IMPORT_C virtual TBool CanCreateSourceBuffer(); //from both MDataSource & MDataSink?
|
williamr@2
|
90 |
IMPORT_C virtual CMMFBuffer* CreateSourceBufferL(TMediaId aMediaId); //CMMFDataPath can't create buffers
|
williamr@2
|
91 |
IMPORT_C virtual CMMFBuffer* CreateSourceBufferL(TMediaId aMediaId, TBool &aReference); //CMMFDataPath can't create buffers
|
williamr@2
|
92 |
IMPORT_C virtual TFourCC SourceDataTypeCode(TMediaId aMediaId);
|
williamr@2
|
93 |
|
williamr@2
|
94 |
IMPORT_C virtual void AddDataSourceL(MDataSource* aSource);
|
williamr@2
|
95 |
IMPORT_C virtual void AddDataSinkL(MDataSink* aSink);
|
williamr@2
|
96 |
|
williamr@2
|
97 |
//could derive these from a mixin eg MMMFControle later for active MDataSource/Sinks
|
williamr@2
|
98 |
IMPORT_C virtual void PrimeL();
|
williamr@2
|
99 |
IMPORT_C virtual void PlayL();
|
williamr@2
|
100 |
IMPORT_C virtual void Pause();
|
williamr@2
|
101 |
IMPORT_C virtual void Stop();
|
williamr@2
|
102 |
|
williamr@2
|
103 |
IMPORT_C virtual TTimeIntervalMicroSeconds Position() const;
|
williamr@2
|
104 |
IMPORT_C virtual void SetPositionL(const TTimeIntervalMicroSeconds& aPosition);
|
williamr@2
|
105 |
|
williamr@2
|
106 |
// Play Window.
|
williamr@2
|
107 |
IMPORT_C virtual void SetPlayWindowL( const TTimeIntervalMicroSeconds& aStart, const TTimeIntervalMicroSeconds& aEnd ) ;
|
williamr@2
|
108 |
IMPORT_C virtual void ClearPlayWindowL() ;
|
williamr@2
|
109 |
|
williamr@2
|
110 |
//State
|
williamr@2
|
111 |
IMPORT_C virtual TInt State();
|
williamr@2
|
112 |
|
williamr@2
|
113 |
//CActive implementations
|
williamr@2
|
114 |
IMPORT_C void RunL();
|
williamr@2
|
115 |
IMPORT_C void DoCancel();
|
williamr@2
|
116 |
IMPORT_C TInt RunError(TInt aError);
|
williamr@2
|
117 |
|
williamr@2
|
118 |
//error handling
|
williamr@2
|
119 |
IMPORT_C TInt DoSendEventToClient(TUid aEventType, TInt aErrorCode);
|
williamr@2
|
120 |
|
williamr@2
|
121 |
IMPORT_C TInt SetBlockLength(TUint aBlockLength);
|
williamr@2
|
122 |
/**
|
williamr@2
|
123 |
|
williamr@2
|
124 |
Indicates the state of the data path.
|
williamr@2
|
125 |
|
williamr@2
|
126 |
Mimics typical MultiMedia behaviour of stopped, primed and playing
|
williamr@2
|
127 |
*/
|
williamr@2
|
128 |
enum TDataPathState
|
williamr@2
|
129 |
{
|
williamr@2
|
130 |
/** Stopped.
|
williamr@2
|
131 |
*/
|
williamr@2
|
132 |
EStopped,
|
williamr@2
|
133 |
/** Primed.
|
williamr@2
|
134 |
*/
|
williamr@2
|
135 |
EPrimed,
|
williamr@2
|
136 |
/** Playing.
|
williamr@2
|
137 |
*/
|
williamr@2
|
138 |
EPlaying,
|
williamr@2
|
139 |
/** Recording.
|
williamr@2
|
140 |
*/
|
williamr@2
|
141 |
ERecording,
|
williamr@2
|
142 |
/** Converting.
|
williamr@2
|
143 |
*/
|
williamr@2
|
144 |
EConverting
|
williamr@2
|
145 |
};
|
williamr@2
|
146 |
|
williamr@2
|
147 |
/**
|
williamr@2
|
148 |
@internalComponent
|
williamr@2
|
149 |
*/
|
williamr@2
|
150 |
class CCompleteCallback : public CActive
|
williamr@2
|
151 |
{
|
williamr@2
|
152 |
public:
|
williamr@2
|
153 |
CCompleteCallback(CMMFDataPath& aDataPath, TBool aWaitForSink);
|
williamr@2
|
154 |
~CCompleteCallback();
|
williamr@2
|
155 |
|
williamr@2
|
156 |
void SignalDataPathComplete(TInt aDataPathError);
|
williamr@2
|
157 |
void SignalSinkComplete(TInt aSinkError);
|
williamr@2
|
158 |
TRequestStatus& ActiveStatus();
|
williamr@2
|
159 |
|
williamr@2
|
160 |
void DoCancel();
|
williamr@2
|
161 |
private:
|
williamr@2
|
162 |
void RunL();
|
williamr@2
|
163 |
CMMFDataPath& iDataPath;
|
williamr@2
|
164 |
TBool iDataPathComplete;
|
williamr@2
|
165 |
TBool iSinkComplete;
|
williamr@2
|
166 |
TBool iWaitForSink;
|
williamr@2
|
167 |
|
williamr@2
|
168 |
TInt iSinkError;
|
williamr@2
|
169 |
TInt iDataPathError;
|
williamr@2
|
170 |
};
|
williamr@2
|
171 |
friend class CCompleteCallback;
|
williamr@2
|
172 |
friend class CMMFDataPath2;
|
williamr@2
|
173 |
protected:
|
williamr@2
|
174 |
|
williamr@2
|
175 |
/**
|
williamr@2
|
176 |
Indicates the transfer state.
|
williamr@2
|
177 |
|
williamr@2
|
178 |
Buffers maybe be filled, emptied, or have "one" shot initialisatings performed upon them.
|
williamr@2
|
179 |
|
williamr@2
|
180 |
TTransferState is used within the datapath RunL which drives databuffer exchange.
|
williamr@2
|
181 |
*/
|
williamr@2
|
182 |
enum TTransferState
|
williamr@2
|
183 |
{
|
williamr@2
|
184 |
/** Waiting on a BufferEmptied callback from sink
|
williamr@2
|
185 |
*/
|
williamr@2
|
186 |
EWaitSink,
|
williamr@2
|
187 |
/** Waiting on a BufferFilled callback from source
|
williamr@2
|
188 |
*/
|
williamr@2
|
189 |
EWaitSource,
|
williamr@2
|
190 |
/** Initialize the sink.
|
williamr@2
|
191 |
*/
|
williamr@2
|
192 |
EInitializeSink,
|
williamr@2
|
193 |
/** Initialize the source.
|
williamr@2
|
194 |
*/
|
williamr@2
|
195 |
EInitializeSource,
|
williamr@2
|
196 |
/** Source buffer does not contain data.
|
williamr@2
|
197 |
*/
|
williamr@2
|
198 |
ENeedSourceData,
|
williamr@2
|
199 |
/** Sink buffer does not contain data.
|
williamr@2
|
200 |
*/
|
williamr@2
|
201 |
ENeedSinkData,
|
williamr@2
|
202 |
/** There is more source data to send to the sink and need to match sink and source.
|
williamr@2
|
203 |
*/
|
williamr@2
|
204 |
ENeedToMatchSourceToSink,
|
williamr@2
|
205 |
/** Outstanding data to send to sink.
|
williamr@2
|
206 |
*/
|
williamr@2
|
207 |
ESendDataToSink,
|
williamr@2
|
208 |
/** End of data.
|
williamr@2
|
209 |
*/
|
williamr@2
|
210 |
EEndOfData //indicates that the datapath has transferred all the data to the sink
|
williamr@2
|
211 |
};
|
williamr@2
|
212 |
|
williamr@2
|
213 |
|
williamr@2
|
214 |
|
williamr@2
|
215 |
|
williamr@2
|
216 |
protected:
|
williamr@2
|
217 |
CMMFDataPath(TMediaId aMediaId, MAsyncEventHandler& aEventHandler) :
|
williamr@2
|
218 |
CActive(EPriorityStandard), MDataSink(KUidMmfDataPath), MDataSource(KUidMmfDataPath),
|
williamr@2
|
219 |
iEventHandler(aEventHandler), iMediaId(aMediaId), iState(EStopped)
|
williamr@2
|
220 |
{CActiveScheduler::Add(this);};
|
williamr@2
|
221 |
|
williamr@2
|
222 |
IMPORT_C void ConstructL(TUid aCodecUid = KNullUid);
|
williamr@2
|
223 |
IMPORT_C virtual void ConstructSourceL( const TDesC8& aInitData ) ;
|
williamr@2
|
224 |
IMPORT_C virtual void ConstructSinkL( const TDesC8& aInitData ) ;
|
williamr@2
|
225 |
IMPORT_C virtual void EndOfData();
|
williamr@2
|
226 |
|
williamr@2
|
227 |
//These methods use API on DevSound to determine how many samples have been played/recorded
|
williamr@2
|
228 |
//and thereby determine the real position.
|
williamr@2
|
229 |
TTimeIntervalMicroSeconds CalculateAudioOutputPosition() const;
|
williamr@2
|
230 |
TTimeIntervalMicroSeconds CalculateAudioInputPosition() const;
|
williamr@2
|
231 |
|
williamr@2
|
232 |
//These methods determine the position of either the input or the output.
|
williamr@2
|
233 |
//The position may come from a format or from an audio input/output depending on
|
williamr@2
|
234 |
//the operation the datapath is doing (Playing (output), Recording & Converting (input))
|
williamr@2
|
235 |
TTimeIntervalMicroSeconds OutputPosition() const;
|
williamr@2
|
236 |
TTimeIntervalMicroSeconds InputPosition() const;
|
williamr@2
|
237 |
|
williamr@2
|
238 |
|
williamr@2
|
239 |
//Determines what buffers are required (see TNeedBuffer)
|
williamr@2
|
240 |
//May leave KErrNotSupported if source/sinks can't supply the necessary buffers
|
williamr@2
|
241 |
TInt DetermineBuffersToUseL(void) const;
|
williamr@2
|
242 |
|
williamr@2
|
243 |
//Determines how many samples have been played by DevSound
|
williamr@2
|
244 |
TInt AudioSamplesPlayed() const;
|
williamr@2
|
245 |
|
williamr@2
|
246 |
//Determines how many samples have been recorded by DevSound
|
williamr@2
|
247 |
TInt AudioSamplesRecorded() const;
|
williamr@2
|
248 |
|
williamr@2
|
249 |
|
williamr@2
|
250 |
private:
|
williamr@2
|
251 |
void ChangeDataPathTransferState(TTransferState aNewDataPathTransferState);
|
williamr@2
|
252 |
void CreateDataPathL(MDataSource* aSource, MDataSink* aSink);
|
williamr@2
|
253 |
|
williamr@2
|
254 |
void InitializeSinkL();
|
williamr@2
|
255 |
void InitializeSourceL();
|
williamr@2
|
256 |
void FillSourceBufferL();
|
williamr@2
|
257 |
void FillSinkBufferL();
|
williamr@2
|
258 |
void EmptySinkBufferL();
|
williamr@2
|
259 |
void DoCleanupBuffers();
|
williamr@2
|
260 |
void ObtainSyncBuffersL(); //tries to obtain synchronous data buffers from src/snk
|
williamr@2
|
261 |
|
williamr@2
|
262 |
TTimeIntervalMicroSeconds Duration() const;
|
williamr@2
|
263 |
|
williamr@2
|
264 |
void DoStopL();
|
williamr@2
|
265 |
void DoPauseL();
|
williamr@2
|
266 |
void DoEndOfDataL();
|
williamr@2
|
267 |
|
williamr@2
|
268 |
IMPORT_C TInt SendEventToClient(const TMMFEvent& aEvent);
|
williamr@2
|
269 |
|
williamr@2
|
270 |
void SetBuffersAvailable();
|
williamr@2
|
271 |
void ResetRefBuffers();
|
williamr@2
|
272 |
|
williamr@2
|
273 |
|
williamr@2
|
274 |
|
williamr@2
|
275 |
protected:
|
williamr@2
|
276 |
/**
|
williamr@2
|
277 |
Event handler.
|
williamr@2
|
278 |
*/
|
williamr@2
|
279 |
MAsyncEventHandler& iEventHandler;
|
williamr@2
|
280 |
|
williamr@2
|
281 |
/**
|
williamr@2
|
282 |
The source of data to which the CMMFDataPath is a MDataSink for.
|
williamr@2
|
283 |
*/
|
williamr@2
|
284 |
MDataSource* iDataSource;
|
williamr@2
|
285 |
/**
|
williamr@2
|
286 |
The sink of data for which the CMMFDataPath is a MDataSource for
|
williamr@2
|
287 |
*/
|
williamr@2
|
288 |
MDataSink* iDataSink;
|
williamr@2
|
289 |
/**
|
williamr@2
|
290 |
Set to true when the sink is able to accept data. EFalse otherwise.
|
williamr@2
|
291 |
*/
|
williamr@2
|
292 |
TBool iSinkCanReceive;
|
williamr@2
|
293 |
/**
|
williamr@2
|
294 |
The sink's data type. Same as the codec input data type.
|
williamr@2
|
295 |
*/
|
williamr@2
|
296 |
TFourCC iSinkFourCC;
|
williamr@2
|
297 |
/**
|
williamr@2
|
298 |
The source's data type. Same as the codec output data type.
|
williamr@2
|
299 |
*/
|
williamr@2
|
300 |
TFourCC iSourceFourCC;
|
williamr@2
|
301 |
/**
|
williamr@2
|
302 |
Identifies which media type and stream within MDataSource.
|
williamr@2
|
303 |
*/
|
williamr@2
|
304 |
TMediaId iMediaId;
|
williamr@2
|
305 |
/**
|
williamr@2
|
306 |
Codec in use. Null Codec is signified by == NULL
|
williamr@2
|
307 |
*/
|
williamr@2
|
308 |
CMMFCodec* iCodec;
|
williamr@2
|
309 |
|
williamr@2
|
310 |
/**
|
williamr@2
|
311 |
Result of processing the codec.
|
williamr@2
|
312 |
*/
|
williamr@2
|
313 |
TCodecProcessResult iCodecProcessResult;
|
williamr@2
|
314 |
|
williamr@2
|
315 |
/**
|
williamr@2
|
316 |
Set to ETrue when the data path has a source and a sink and can send data from the source to the sink.
|
williamr@2
|
317 |
*/
|
williamr@2
|
318 |
TBool iDataPathCreated;
|
williamr@2
|
319 |
|
williamr@2
|
320 |
/**
|
williamr@2
|
321 |
Current data path state.
|
williamr@2
|
322 |
@see TDataPathState
|
williamr@2
|
323 |
*/
|
williamr@2
|
324 |
TDataPathState iState;
|
williamr@2
|
325 |
|
williamr@2
|
326 |
/**
|
williamr@2
|
327 |
Current transfer state.
|
williamr@2
|
328 |
@see TTransferState
|
williamr@2
|
329 |
*/
|
williamr@2
|
330 |
TTransferState iTransferState;
|
williamr@2
|
331 |
|
williamr@2
|
332 |
/**
|
williamr@2
|
333 |
Set to true if data path has to use a supplied codec in its construction.
|
williamr@2
|
334 |
*/
|
williamr@2
|
335 |
TBool iUseSuppliedCodecUid;
|
williamr@2
|
336 |
|
williamr@2
|
337 |
/**
|
williamr@2
|
338 |
This is set to point to whichever sink buffer is in use.
|
williamr@2
|
339 |
*/
|
williamr@2
|
340 |
CMMFBuffer* iSinkBuffer;
|
williamr@2
|
341 |
|
williamr@2
|
342 |
/**
|
williamr@2
|
343 |
This is the pointer to whichever source buffer is in use
|
williamr@2
|
344 |
*/
|
williamr@2
|
345 |
CMMFBuffer* iSourceBuffer;
|
williamr@2
|
346 |
|
williamr@2
|
347 |
/**
|
williamr@2
|
348 |
The source's position in terms of frames or some other time fixed parameter.
|
williamr@2
|
349 |
*/
|
williamr@2
|
350 |
TUint iCurrentSourceFrameNumber;
|
williamr@2
|
351 |
|
williamr@2
|
352 |
/**
|
williamr@2
|
353 |
The sink's position in terms of frames or some other time fixed parameter.
|
williamr@2
|
354 |
*/
|
williamr@2
|
355 |
TUint iCurrentSinkFrameNumber;
|
williamr@2
|
356 |
|
williamr@2
|
357 |
/**
|
williamr@2
|
358 |
Indicates that all data has been obtained from the source (ETrue if there is no more source data).
|
williamr@2
|
359 |
*/
|
williamr@2
|
360 |
TBool iNoMoreSourceData;
|
williamr@2
|
361 |
|
williamr@2
|
362 |
/**
|
williamr@2
|
363 |
Indicates that all data has been sent to the sink.
|
williamr@2
|
364 |
*/
|
williamr@2
|
365 |
TBool iAllDataSentToSink;
|
williamr@2
|
366 |
|
williamr@2
|
367 |
/**
|
williamr@2
|
368 |
Datapath completed because of an error; usually KErrNone.
|
williamr@2
|
369 |
*/
|
williamr@2
|
370 |
TUint iDataPathCompletedErrorCode;
|
williamr@2
|
371 |
|
williamr@2
|
372 |
/**
|
williamr@2
|
373 |
Start position of the play window.
|
williamr@2
|
374 |
*/
|
williamr@2
|
375 |
TTimeIntervalMicroSeconds iPlayWindowStartPosition ;
|
williamr@2
|
376 |
|
williamr@2
|
377 |
/**
|
williamr@2
|
378 |
End position of the play window.
|
williamr@2
|
379 |
*/
|
williamr@2
|
380 |
TTimeIntervalMicroSeconds iPlayWindowEndPosition ;
|
williamr@2
|
381 |
|
williamr@2
|
382 |
/**
|
williamr@2
|
383 |
The position audio will start playing from.
|
williamr@2
|
384 |
When stopping, this is set to iPlayWindowStartPosition.
|
williamr@2
|
385 |
When pausing, this is set to the current position.
|
williamr@2
|
386 |
*/
|
williamr@2
|
387 |
TTimeIntervalMicroSeconds iStartPosition;
|
williamr@2
|
388 |
|
williamr@2
|
389 |
/**
|
williamr@2
|
390 |
This value can be used to obtain the duration of the source when playing or converting.
|
williamr@2
|
391 |
This is an optimisation as this value will not change if we are playing or converting.
|
williamr@2
|
392 |
*/
|
williamr@2
|
393 |
TTimeIntervalMicroSeconds iCachedSourceDuration;
|
williamr@2
|
394 |
|
williamr@2
|
395 |
|
williamr@2
|
396 |
/**
|
williamr@2
|
397 |
ETrue if the source buffer is reference to object owned by someone else.
|
williamr@2
|
398 |
*/
|
williamr@2
|
399 |
TBool iSrcBufRef;
|
williamr@2
|
400 |
|
williamr@2
|
401 |
/**
|
williamr@2
|
402 |
ETrue if sink buffer is reference to object owned by someone else
|
williamr@2
|
403 |
*/
|
williamr@2
|
404 |
TBool iSnkBufRef;
|
williamr@2
|
405 |
|
williamr@2
|
406 |
/**
|
williamr@2
|
407 |
Indicates asynchrous buffers from AudioInput.
|
williamr@2
|
408 |
*/
|
williamr@2
|
409 |
TBool iObtainingAsyncSourceBuffer;
|
williamr@2
|
410 |
|
williamr@2
|
411 |
/**
|
williamr@2
|
412 |
Indicates asynchrous buffers from AudioOutput.
|
williamr@2
|
413 |
*/
|
williamr@2
|
414 |
TBool iObtainingAsyncSinkBuffer;
|
williamr@2
|
415 |
|
williamr@2
|
416 |
/**
|
williamr@2
|
417 |
Indicates DoPauseL() has been called.
|
williamr@2
|
418 |
*/
|
williamr@2
|
419 |
TBool iPauseCalled;
|
williamr@2
|
420 |
|
williamr@2
|
421 |
/**
|
williamr@2
|
422 |
Flag to indicate that a buffer is with the source.
|
williamr@2
|
423 |
|
williamr@2
|
424 |
This is necessary as it is imperrative that when a buffer is with the source, it must
|
williamr@2
|
425 |
not be referenced in any way. The reason for this is that it is not mandated that sources
|
williamr@2
|
426 |
maintain buffer references. For example, it is valid for DevSound to return recorded data in a
|
williamr@2
|
427 |
different buffer to the one supplied to it.
|
williamr@2
|
428 |
*/
|
williamr@2
|
429 |
TBool iSourceBufferWithSource;
|
williamr@2
|
430 |
|
williamr@2
|
431 |
/**
|
williamr@2
|
432 |
Flag to indicate that a buffer is with the sink.
|
williamr@2
|
433 |
|
williamr@2
|
434 |
This are necessary as it is imperrative that when a buffer is with the sink, it must
|
williamr@2
|
435 |
not be referenced in any way. The reason for this is that it is not mandated that sinks
|
williamr@2
|
436 |
maintain buffer references. For example, it is valid for DevSound to request more audio data in a
|
williamr@2
|
437 |
different buffer to the one supplied to it.
|
williamr@2
|
438 |
*/
|
williamr@2
|
439 |
TBool iSinkBufferWithSink;
|
williamr@2
|
440 |
|
williamr@2
|
441 |
|
williamr@2
|
442 |
/**
|
williamr@2
|
443 |
Holds the number of samples played on audio output at a point where we
|
williamr@2
|
444 |
want to reference play duration from.
|
williamr@2
|
445 |
*/
|
williamr@2
|
446 |
TInt iReferenceAudioSamplesPlayed;
|
williamr@2
|
447 |
|
williamr@2
|
448 |
/**
|
williamr@2
|
449 |
Holds the number of samples recorded from audio input at a point where we
|
williamr@2
|
450 |
want to reference record duration from.
|
williamr@2
|
451 |
*/
|
williamr@2
|
452 |
TInt iReferenceAudioSamplesRecorded;
|
williamr@2
|
453 |
|
williamr@2
|
454 |
/**
|
williamr@2
|
455 |
Pointer to internal callback completion class
|
williamr@2
|
456 |
*/
|
williamr@2
|
457 |
CCompleteCallback * iCompleteCallback;
|
williamr@2
|
458 |
|
williamr@2
|
459 |
/**
|
williamr@2
|
460 |
This indicates what buffers are required in order to operate.
|
williamr@2
|
461 |
If a real Codec is in use, buffers are required from both source and sink,
|
williamr@2
|
462 |
else only one is required and source is preferred.
|
williamr@2
|
463 |
*/
|
williamr@2
|
464 |
enum TNeedBuffer
|
williamr@2
|
465 |
{
|
williamr@2
|
466 |
/** No buffers needed.
|
williamr@2
|
467 |
*/
|
williamr@2
|
468 |
ENoBuffers = 0x0,
|
williamr@2
|
469 |
/** Sink buffer needed.
|
williamr@2
|
470 |
*/
|
williamr@2
|
471 |
ENeedSinkBuffer = 0x01,
|
williamr@2
|
472 |
/** Source buffer needed.
|
williamr@2
|
473 |
*/
|
williamr@2
|
474 |
ENeedSourceBuffer = 0x10
|
williamr@2
|
475 |
};
|
williamr@2
|
476 |
|
williamr@2
|
477 |
/** Holds the outcome of the call to DetermineBuffersToUseL
|
williamr@2
|
478 |
*/
|
williamr@2
|
479 |
TInt iBuffersToUse;
|
williamr@2
|
480 |
};
|
williamr@2
|
481 |
|
williamr@2
|
482 |
#endif
|