mmfenh/enhancedmediaclient/Plugins/ProgDLSource/inc/ProgDLDataSource.h
changeset 33 5e8b14bae8c3
parent 28 ebf79c79991a
child 36 73253677b50a
equal deleted inserted replaced
28:ebf79c79991a 33:5e8b14bae8c3
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Header of ProgDLSource.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __PROGDLDATASOURCE_H_
       
    20 #define __PROGDLDATASOURCE_H_
       
    21 
       
    22 
       
    23 #include <mmf/server/mmfdatasource.h> 
       
    24 #include <MultimediaDataSource.h> 
       
    25 #include <DataBufferSource.h> 
       
    26 
       
    27 class CSinkQueueItem;
       
    28 using multimedia::TBufferingConfig;
       
    29 /**
       
    30 @publishedAll
       
    31 @released
       
    32 
       
    33 Provides the filename and path of file. 
       
    34 
       
    35 Used by CProgDLMultimediaSource::ConstructL().
       
    36 */
       
    37 class TMMFFileParams
       
    38     {
       
    39     public:
       
    40     /**
       
    41     Filename and path of file. 
       
    42         */
       
    43         TFileName iPath ; // Filename and path of file.
       
    44     private:
       
    45     /**
       
    46     This member is internal and not intended for use.
       
    47         */
       
    48         TInt iReserved1;
       
    49     };
       
    50 
       
    51     /**
       
    52     @internalTechnology	
       
    53 */
       
    54 const TUid KFileHandleUid = {0x101FFA19};
       
    55 const TUid KMMFileSourceUid = {0x101F7DA9};
       
    56 const TUid KMMFileHandleSourceUid = {0x101F7DAA};
       
    57 
       
    58 /**
       
    59 @publishedAll
       
    60 @released
       
    61 
       
    62   Provides a pointer to the file handle 
       
    63   
       
    64     Used by CProgDLMultimediaSource::ConstructL().
       
    65 */
       
    66 class TMMFFileHandleParams
       
    67     {
       
    68     public:
       
    69         TMMFFileHandleParams(RFile* aFile) : iUid(KFileHandleUid), iFile(aFile) {}
       
    70         TMMFFileHandleParams() : iUid(KFileHandleUid) {}
       
    71         
       
    72         TUid iUid;
       
    73         /**
       
    74         Handle of file 
       
    75         */
       
    76         RFile* iFile;
       
    77     private:
       
    78     /**
       
    79     This member is internal and not intended for use.
       
    80         */
       
    81         TInt iReserved1;
       
    82     };
       
    83 
       
    84 
       
    85 
       
    86 
       
    87     /**
       
    88     @publishedAll
       
    89     @released
       
    90 */
       
    91 typedef TPckgBuf<TMMFFileParams>  TMMFFileConfig ;
       
    92 
       
    93 /**
       
    94 @publishedAll
       
    95 @released
       
    96 */
       
    97 typedef TPckgBuf<TMMFFileHandleParams>  TMMFFileHandleConfig ;
       
    98 
       
    99 
       
   100 /**
       
   101 @publishedAll
       
   102 @released
       
   103 
       
   104   This details how big the iTransferBufferCopies array of CProgDLMultimediaSource may
       
   105   become before we start looking to free entries.
       
   106 */
       
   107 const TInt KAcceptableTransferBufferCopiesSize = 5;
       
   108 
       
   109 /**
       
   110 @publishedAll
       
   111 @released
       
   112 
       
   113   This details how big the iTransferBufferCopies array of CProgDLMultimediaSource may
       
   114   become before we start looking to free entries.
       
   115 */
       
   116 const TInt KMaximumTransferBufferCopiesSize = 100;
       
   117 
       
   118 class CProgDLMultimediaSource;
       
   119 
       
   120 class CProgDLSource : public MDataSource
       
   121     {
       
   122     public:
       
   123         static CProgDLSource* NewL( TUid aType );
       
   124 		~CProgDLSource(void);        
       
   125         // From MDataSource begins
       
   126         TFourCC SourceDataTypeCode(TMediaId aMediaId) ;
       
   127         void FillBufferL( CMMFBuffer* aBuffer, MDataSink* aConsumer, TMediaId aMediaId ) ;
       
   128         void BufferEmptiedL( CMMFBuffer* aBuffer ) ;
       
   129         TBool CanCreateSourceBuffer() ;
       
   130         CMMFBuffer* CreateSourceBufferL( TMediaId aMediaId, TBool &aReference ) ;
       
   131         TInt SourceThreadLogon(MAsyncEventHandler& aEventHandler) ;
       
   132         void SourceThreadLogoff();
       
   133         void SourcePrimeL();
       
   134         void SourcePlayL();
       
   135         void SourceStopL();
       
   136         void SourceCustomCommand(TMMFMessage& aMessage);
       
   137         void ConstructSourceL(const TDesC8 &aInitData);
       
   138         TUid DataSourceType() const;
       
   139         TInt SetSourceDataTypeCode(TFourCC aSourceFourCC, TMediaId /*aMediaId*/ );
       
   140          // From MDataSource ends
       
   141         
       
   142         void SetMultimediaSource(CProgDLMultimediaSource& aMultimediaSource);
       
   143         TDesC8& GetInitData();
       
   144     private:
       
   145         CProgDLSource(TUid aType);
       
   146         
       
   147         void ConstructL (void);
       
   148     private:
       
   149         //Data
       
   150         CProgDLMultimediaSource* iMultiMediaSource; 
       
   151         HBufC8* iInitData;       
       
   152  
       
   153     }; 
       
   154     
       
   155 #endif