epoc32/include/mmf/server/mmfdes.h
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
       
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     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
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __MMFDES_H_
       
    17 #define __MMFDES_H_
       
    18 
       
    19 
       
    20 #include <mmf/server/mmfclip.h>
       
    21 #include <mmf/common/mmfutilities.h>
       
    22 
       
    23 
       
    24 /**
       
    25 @publishedAll
       
    26 @released
       
    27 
       
    28 Descriptor parameters.
       
    29 
       
    30 Used by CMMFDescriptor::ConstructL().
       
    31 */
       
    32 class TMMFDescriptorParams
       
    33 	{
       
    34 public:
       
    35 	/**
       
    36     Address of TPr8 describing source descriptor.
       
    37 	*/
       
    38 	TAny* iDes ; // Address of TPr8 describing source Descriptor
       
    39 	/**
       
    40 	Descriptor thread.
       
    41 	*/
       
    42 	TThreadId iDesThreadId ;
       
    43 private:
       
    44 	/**
       
    45 	This member is internal and not intended for use.
       
    46 	*/
       
    47 	TInt iReserved1;
       
    48 	} ;
       
    49 
       
    50 /**
       
    51 @publishedAll
       
    52 @released
       
    53 */
       
    54 typedef TPckgBuf<TMMFDescriptorParams>  TMMFDescriptorConfig ;
       
    55 
       
    56 /**
       
    57 @publishedAll
       
    58 @released
       
    59 
       
    60 MultiMedia framework class.  Represents a client side descriptor.
       
    61 May be source descriptor from which data is read or destination to which data is written
       
    62 */
       
    63 class CMMFDescriptor : public CMMFClip
       
    64 	{
       
    65 public :
       
    66 
       
    67 	// From MDataSource
       
    68 	virtual TFourCC SourceDataTypeCode( TMediaId aMediaId) ;
       
    69 	virtual void FillBufferL(CMMFBuffer* aBuffer, MDataSink* aConsumer,TMediaId aMediaId) ;//called by a MDataSink to request buffer fill
       
    70 	virtual void BufferEmptiedL( CMMFBuffer* aBuffer ) ;
       
    71 	virtual TBool CanCreateSourceBuffer() ;
       
    72 	virtual CMMFBuffer* CreateSourceBufferL(TMediaId aMediaId, TBool &aReference) ;
       
    73 	
       
    74 	// From MDataSink
       
    75 	virtual TFourCC SinkDataTypeCode(TMediaId aMediaId) ; //used by data path MDataSource/Sink for codec matching
       
    76 	virtual void EmptyBufferL( CMMFBuffer* aBuffer, MDataSource* aSupplier, TMediaId aMediaId ) ;
       
    77 	virtual void BufferFilledL( CMMFBuffer* aBuffer ) ;
       
    78 	virtual TBool CanCreateSinkBuffer() ;
       
    79 	virtual CMMFBuffer* CreateSinkBufferL( TMediaId aMediaId , TBool &aReference) ;
       
    80 
       
    81 	// From CMMFClip
       
    82 	virtual void ReadBufferL( TInt aLength, CMMFBuffer* aBuffer, TInt aPosition, MDataSink* aConsumer);
       
    83 	virtual void WriteBufferL( TInt aLength, CMMFBuffer* aBuffer, TInt aPosition, MDataSource* aSupplier);
       
    84 	virtual void ReadBufferL( CMMFBuffer* aBuffer, TInt aPosition, MDataSink* aConsumer) ;
       
    85 	virtual void WriteBufferL( CMMFBuffer* aBuffer, TInt aPosition, MDataSource* aSupplier) ;
       
    86 	virtual void ReadBufferL( CMMFBuffer* aBuffer, TInt aPosition) ;
       
    87 	virtual void WriteBufferL( CMMFBuffer* aBuffer, TInt aPosition) ;
       
    88 	virtual TInt64 BytesFree() ;  // amount of space available for the clip
       
    89 	virtual TInt Size() ;  // length of clip
       
    90 	virtual TInt SetSize( TInt aSize ); // sets the size of the clip (used mainly by crop)
       
    91 
       
    92 	// CMMFDescriptor
       
    93 	virtual ~CMMFDescriptor() ;
       
    94 	static MDataSource* NewSourceL() ; 
       
    95 	static MDataSink* NewSinkL() ; 
       
    96 
       
    97 	void SetTransferBuffer (TBool aTBuffer) ;
       
    98 	TBool CanUseTransferBuffer () ;
       
    99 
       
   100 protected :
       
   101 	virtual void ConstructSinkL( const TDesC8& aInitData ) ;
       
   102 	virtual void ConstructSourceL(  const TDesC8& aInitData ) ;
       
   103 	void ConstructL( const TDesC8& aInitData ) ;
       
   104 	CMMFDescriptor( ) ;
       
   105 
       
   106 private :
       
   107 	// returns the Maximum length of the descriptor
       
   108 	inline TInt MaxLength() { ASSERT( iDes ); return iDes->MaxLength(); }
       
   109 
       
   110 	// Need to know about the thread that the descriptor is in.
       
   111 	RThread iDesThread ;
       
   112 
       
   113 	TDes8* iDes ;
       
   114 	TInt iOffset ;
       
   115 
       
   116 	TFourCC  iSinkFourCC ;
       
   117 	TFourCC  iSourceFourCC ;
       
   118 
       
   119 	TBool iUseTransferBuffer ;
       
   120 
       
   121 	
       
   122 	} ;
       
   123 
       
   124 
       
   125 #endif