examples/Multimedia/MmfExSinkSource/mmfexdes.h

00001 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
00002 // All rights reserved.
00003 // This component and the accompanying materials are made available
00004 // under the terms of "Eclipse Public License v1.0"
00005 // which accompanies this distribution, and is available
00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00007 //
00008 // Initial Contributors:
00009 // Nokia Corporation - initial contribution.
00010 //
00011 // Contributors:
00012 //
00013 // Description:
00014 // MMFDes.h
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 //Panic codes for MMFDescriptor
00025 enum TMMFExDescriptorPanicCode
00026         {
00027         EMMFDescriptorPanicBufferEmptiedLNotSupported = 1,
00028         EMMFDescriptorPanicBufferFilledLNotSupported
00029         };
00030         
00031 class TMMFExDescriptorParams
00032         {
00033 public:
00034         TAny* iDes ; // Address of TPtr8 describing source Descriptor
00035         TThreadId iDesThreadId ;
00036         } ;
00037 
00038 typedef TPckgBuf<TMMFExDescriptorParams>  TMMFDescriptorConfig ;
00039 
00040 // Defines a MMF sink and source plug-in that can write and read media data
00041 // to a descriptor
00042 // Implements CMMFClip, which itself derives from MDataSource and MDataSink
00043 class CMMFExDescriptor : public CMMFClip
00044         {
00045 public:
00046         // Data source factory
00047         static MDataSource* NewSourceL() ; 
00048         // Data sink factory
00049         static MDataSink* NewSinkL() ; 
00050         ~CMMFExDescriptor() ;
00051         
00052 private:
00053         // From MDataSource
00054         TFourCC SourceDataTypeCode( TMediaId /*aMediaId*/) ;
00055         void FillBufferL(CMMFBuffer* aBuffer, MDataSink* aConsumer,TMediaId /*aMediaId*/) ;//called by a MDataSink to request buffer fill
00056         void BufferEmptiedL( CMMFBuffer* aBuffer ) ;
00057         TBool CanCreateSourceBuffer() ;
00058         CMMFBuffer* CreateSourceBufferL(TMediaId /*aMediaId*/, TBool &aReference) ;
00059         void ConstructSourceL(  const TDesC8& aInitData ) ;
00060 
00061         // From MDataSink
00062         TFourCC SinkDataTypeCode(TMediaId /*aMediaId*/) ; //used by data path MDataSource/Sink for codec matching
00063         void EmptyBufferL( CMMFBuffer* aBuffer, MDataSource* aSupplier, TMediaId /*aMediaId*/ ) ; 
00064         void BufferFilledL( CMMFBuffer* aBuffer ) ;
00065         TBool CanCreateSinkBuffer() ;
00066         CMMFBuffer* CreateSinkBufferL( TMediaId /*aMediaId*/ , TBool &aReference) ;
00067         void ConstructSinkL( const TDesC8& aInitData ) ;
00068 
00069         // From CMMFClip
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() ;  // amount of space available for the clip
00077         TInt Size() ;  // length of clip
00078 
00079         // Construction
00080         void ConstructL( const TDesC8& aInitData ) ;
00081         CMMFExDescriptor();
00082         // Helpers
00083         void Reset() { iOffset = 0 ; };
00084 
00085 private:
00086         // Need to know about the thread that the descriptor is in
00087         RThread iDesThread;
00088         TDes8* iDes ;
00089         TInt iOffset;
00090         TFourCC iSinkFourCC;
00091         TFourCC iSourceFourCC;
00092         TBool iUseTransferBuffer;
00093         } ;
00094 
00095 
00096 #endif

Generated by  doxygen 1.6.2