epoc32/include/mmf/server/mmfdes.h
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/mmf/server/mmfdes.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,125 @@
     1.4 +// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// 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
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef __MMFDES_H_
    1.20 +#define __MMFDES_H_
    1.21 +
    1.22 +
    1.23 +#include <mmf/server/mmfclip.h>
    1.24 +#include <mmf/common/mmfutilities.h>
    1.25 +
    1.26 +
    1.27 +/**
    1.28 +@publishedAll
    1.29 +@released
    1.30 +
    1.31 +Descriptor parameters.
    1.32 +
    1.33 +Used by CMMFDescriptor::ConstructL().
    1.34 +*/
    1.35 +class TMMFDescriptorParams
    1.36 +	{
    1.37 +public:
    1.38 +	/**
    1.39 +    Address of TPr8 describing source descriptor.
    1.40 +	*/
    1.41 +	TAny* iDes ; // Address of TPr8 describing source Descriptor
    1.42 +	/**
    1.43 +	Descriptor thread.
    1.44 +	*/
    1.45 +	TThreadId iDesThreadId ;
    1.46 +private:
    1.47 +	/**
    1.48 +	This member is internal and not intended for use.
    1.49 +	*/
    1.50 +	TInt iReserved1;
    1.51 +	} ;
    1.52 +
    1.53 +/**
    1.54 +@publishedAll
    1.55 +@released
    1.56 +*/
    1.57 +typedef TPckgBuf<TMMFDescriptorParams>  TMMFDescriptorConfig ;
    1.58 +
    1.59 +/**
    1.60 +@publishedAll
    1.61 +@released
    1.62 +
    1.63 +MultiMedia framework class.  Represents a client side descriptor.
    1.64 +May be source descriptor from which data is read or destination to which data is written
    1.65 +*/
    1.66 +class CMMFDescriptor : public CMMFClip
    1.67 +	{
    1.68 +public :
    1.69 +
    1.70 +	// From MDataSource
    1.71 +	virtual TFourCC SourceDataTypeCode( TMediaId aMediaId) ;
    1.72 +	virtual void FillBufferL(CMMFBuffer* aBuffer, MDataSink* aConsumer,TMediaId aMediaId) ;//called by a MDataSink to request buffer fill
    1.73 +	virtual void BufferEmptiedL( CMMFBuffer* aBuffer ) ;
    1.74 +	virtual TBool CanCreateSourceBuffer() ;
    1.75 +	virtual CMMFBuffer* CreateSourceBufferL(TMediaId aMediaId, TBool &aReference) ;
    1.76 +	
    1.77 +	// From MDataSink
    1.78 +	virtual TFourCC SinkDataTypeCode(TMediaId aMediaId) ; //used by data path MDataSource/Sink for codec matching
    1.79 +	virtual void EmptyBufferL( CMMFBuffer* aBuffer, MDataSource* aSupplier, TMediaId aMediaId ) ;
    1.80 +	virtual void BufferFilledL( CMMFBuffer* aBuffer ) ;
    1.81 +	virtual TBool CanCreateSinkBuffer() ;
    1.82 +	virtual CMMFBuffer* CreateSinkBufferL( TMediaId aMediaId , TBool &aReference) ;
    1.83 +
    1.84 +	// From CMMFClip
    1.85 +	virtual void ReadBufferL( TInt aLength, CMMFBuffer* aBuffer, TInt aPosition, MDataSink* aConsumer);
    1.86 +	virtual void WriteBufferL( TInt aLength, CMMFBuffer* aBuffer, TInt aPosition, MDataSource* aSupplier);
    1.87 +	virtual void ReadBufferL( CMMFBuffer* aBuffer, TInt aPosition, MDataSink* aConsumer) ;
    1.88 +	virtual void WriteBufferL( CMMFBuffer* aBuffer, TInt aPosition, MDataSource* aSupplier) ;
    1.89 +	virtual void ReadBufferL( CMMFBuffer* aBuffer, TInt aPosition) ;
    1.90 +	virtual void WriteBufferL( CMMFBuffer* aBuffer, TInt aPosition) ;
    1.91 +	virtual TInt64 BytesFree() ;  // amount of space available for the clip
    1.92 +	virtual TInt Size() ;  // length of clip
    1.93 +	virtual TInt SetSize( TInt aSize ); // sets the size of the clip (used mainly by crop)
    1.94 +
    1.95 +	// CMMFDescriptor
    1.96 +	virtual ~CMMFDescriptor() ;
    1.97 +	static MDataSource* NewSourceL() ; 
    1.98 +	static MDataSink* NewSinkL() ; 
    1.99 +
   1.100 +	void SetTransferBuffer (TBool aTBuffer) ;
   1.101 +	TBool CanUseTransferBuffer () ;
   1.102 +
   1.103 +protected :
   1.104 +	virtual void ConstructSinkL( const TDesC8& aInitData ) ;
   1.105 +	virtual void ConstructSourceL(  const TDesC8& aInitData ) ;
   1.106 +	void ConstructL( const TDesC8& aInitData ) ;
   1.107 +	CMMFDescriptor( ) ;
   1.108 +
   1.109 +private :
   1.110 +	// returns the Maximum length of the descriptor
   1.111 +	inline TInt MaxLength() { ASSERT( iDes ); return iDes->MaxLength(); }
   1.112 +
   1.113 +	// Need to know about the thread that the descriptor is in.
   1.114 +	RThread iDesThread ;
   1.115 +
   1.116 +	TDes8* iDes ;
   1.117 +	TInt iOffset ;
   1.118 +
   1.119 +	TFourCC  iSinkFourCC ;
   1.120 +	TFourCC  iSourceFourCC ;
   1.121 +
   1.122 +	TBool iUseTransferBuffer ;
   1.123 +
   1.124 +	
   1.125 +	} ;
   1.126 +
   1.127 +
   1.128 +#endif