00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __MMFDES_H_
00018 #define __MMFDES_H_
00019
00020
00021 #include <mmf/server/mmfclip.h>
00022 #include <mmf/common/mmfutilities.h>
00023
00024
00025 enum TMMFExDescriptorPanicCode
00026 {
00027 EMMFDescriptorPanicBufferEmptiedLNotSupported = 1,
00028 EMMFDescriptorPanicBufferFilledLNotSupported
00029 };
00030
00031 class TMMFExDescriptorParams
00032 {
00033 public:
00034 TAny* iDes ;
00035 TThreadId iDesThreadId ;
00036 } ;
00037
00038 typedef TPckgBuf<TMMFExDescriptorParams> TMMFDescriptorConfig ;
00039
00040
00041
00042
00043 class CMMFExDescriptor : public CMMFClip
00044 {
00045 public:
00046
00047 static MDataSource* NewSourceL() ;
00048
00049 static MDataSink* NewSinkL() ;
00050 ~CMMFExDescriptor() ;
00051
00052 private:
00053
00054 TFourCC SourceDataTypeCode( TMediaId ) ;
00055 void FillBufferL(CMMFBuffer* aBuffer, MDataSink* aConsumer,TMediaId ) ;
00056 void BufferEmptiedL( CMMFBuffer* aBuffer ) ;
00057 TBool CanCreateSourceBuffer() ;
00058 CMMFBuffer* CreateSourceBufferL(TMediaId , TBool &aReference) ;
00059 void ConstructSourceL( const TDesC8& aInitData ) ;
00060
00061
00062 TFourCC SinkDataTypeCode(TMediaId ) ;
00063 void EmptyBufferL( CMMFBuffer* aBuffer, MDataSource* aSupplier, TMediaId ) ;
00064 void BufferFilledL( CMMFBuffer* aBuffer ) ;
00065 TBool CanCreateSinkBuffer() ;
00066 CMMFBuffer* CreateSinkBufferL( TMediaId , TBool &aReference) ;
00067 void ConstructSinkL( const TDesC8& aInitData ) ;
00068
00069
00070 void ReadBufferL( TInt aLength, CMMFBuffer* aBuffer, TInt aPosition, MDataSink* aConsumer);
00071 void WriteBufferL( TInt aLength, CMMFBuffer* aBuffer, TInt aPosition, MDataSource* aSupplier);
00072 void ReadBufferL( CMMFBuffer* aBuffer, TInt aPosition, MDataSink* aConsumer) ;
00073 void WriteBufferL( CMMFBuffer* aBuffer, TInt aPosition, MDataSource* aSupplier) ;
00074 void ReadBufferL( CMMFBuffer* aBuffer, TInt aPosition) ;
00075 void WriteBufferL( CMMFBuffer* aBuffer, TInt aPosition) ;
00076 TInt64 BytesFree() ;
00077 TInt Size() ;
00078
00079
00080 void ConstructL( const TDesC8& aInitData ) ;
00081 CMMFExDescriptor();
00082
00083 void Reset() { iOffset = 0 ; };
00084
00085 private:
00086
00087 RThread iDesThread;
00088 TDes8* iDes ;
00089 TInt iOffset;
00090 TFourCC iSinkFourCC;
00091 TFourCC iSourceFourCC;
00092 TBool iUseTransferBuffer;
00093 } ;
00094
00095
00096 #endif