sl@0: // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef __MMFDES_H_ sl@0: #define __MMFDES_H_ sl@0: sl@0: sl@0: #include sl@0: #include sl@0: sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Descriptor parameters. sl@0: sl@0: Used by CMMFDescriptor::ConstructL(). sl@0: */ sl@0: class TMMFDescriptorParams sl@0: { sl@0: public: sl@0: /** sl@0: Address of TPr8 describing source descriptor. sl@0: */ sl@0: TAny* iDes ; // Address of TPr8 describing source Descriptor sl@0: /** sl@0: Descriptor thread. sl@0: */ sl@0: TThreadId iDesThreadId ; sl@0: private: sl@0: /** sl@0: This member is internal and not intended for use. sl@0: */ sl@0: TInt iReserved1; sl@0: } ; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: typedef TPckgBuf TMMFDescriptorConfig ; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: MultiMedia framework class. Represents a client side descriptor. sl@0: May be source descriptor from which data is read or destination to which data is written sl@0: */ sl@0: class CMMFDescriptor : public CMMFClip sl@0: { sl@0: public : sl@0: sl@0: // From MDataSource sl@0: virtual TFourCC SourceDataTypeCode( TMediaId aMediaId) ; sl@0: virtual void FillBufferL(CMMFBuffer* aBuffer, MDataSink* aConsumer,TMediaId aMediaId) ;//called by a MDataSink to request buffer fill sl@0: virtual void BufferEmptiedL( CMMFBuffer* aBuffer ) ; sl@0: virtual TBool CanCreateSourceBuffer() ; sl@0: virtual CMMFBuffer* CreateSourceBufferL(TMediaId aMediaId, TBool &aReference) ; sl@0: sl@0: // From MDataSink sl@0: virtual TFourCC SinkDataTypeCode(TMediaId aMediaId) ; //used by data path MDataSource/Sink for codec matching sl@0: virtual void EmptyBufferL( CMMFBuffer* aBuffer, MDataSource* aSupplier, TMediaId aMediaId ) ; sl@0: virtual void BufferFilledL( CMMFBuffer* aBuffer ) ; sl@0: virtual TBool CanCreateSinkBuffer() ; sl@0: virtual CMMFBuffer* CreateSinkBufferL( TMediaId aMediaId , TBool &aReference) ; sl@0: sl@0: // From CMMFClip sl@0: virtual void ReadBufferL( TInt aLength, CMMFBuffer* aBuffer, TInt aPosition, MDataSink* aConsumer); sl@0: virtual void WriteBufferL( TInt aLength, CMMFBuffer* aBuffer, TInt aPosition, MDataSource* aSupplier); sl@0: virtual void ReadBufferL( CMMFBuffer* aBuffer, TInt aPosition, MDataSink* aConsumer) ; sl@0: virtual void WriteBufferL( CMMFBuffer* aBuffer, TInt aPosition, MDataSource* aSupplier) ; sl@0: virtual void ReadBufferL( CMMFBuffer* aBuffer, TInt aPosition) ; sl@0: virtual void WriteBufferL( CMMFBuffer* aBuffer, TInt aPosition) ; sl@0: virtual TInt64 BytesFree() ; // amount of space available for the clip sl@0: virtual TInt Size() ; // length of clip sl@0: virtual TInt SetSize( TInt aSize ); // sets the size of the clip (used mainly by crop) sl@0: sl@0: // CMMFDescriptor sl@0: virtual ~CMMFDescriptor() ; sl@0: static MDataSource* NewSourceL() ; sl@0: static MDataSink* NewSinkL() ; sl@0: sl@0: void SetTransferBuffer (TBool aTBuffer) ; sl@0: TBool CanUseTransferBuffer () ; sl@0: sl@0: protected : sl@0: virtual void ConstructSinkL( const TDesC8& aInitData ) ; sl@0: virtual void ConstructSourceL( const TDesC8& aInitData ) ; sl@0: void ConstructL( const TDesC8& aInitData ) ; sl@0: CMMFDescriptor( ) ; sl@0: sl@0: private : sl@0: // returns the Maximum length of the descriptor sl@0: inline TInt MaxLength() { ASSERT( iDes ); return iDes->MaxLength(); } sl@0: sl@0: // Need to know about the thread that the descriptor is in. sl@0: RThread iDesThread ; sl@0: sl@0: TDes8* iDes ; sl@0: TInt iOffset ; sl@0: sl@0: TFourCC iSinkFourCC ; sl@0: TFourCC iSourceFourCC ; sl@0: sl@0: TBool iUseTransferBuffer ; sl@0: sl@0: sl@0: } ; sl@0: sl@0: sl@0: #endif