multimediacommsengine/mmceshared/inc/mcecomfilesource.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     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:    
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef CMCECOMFILESOURCE_H
       
    22 #define CMCECOMFILESOURCE_H
       
    23 
       
    24 #include <e32std.h>  
       
    25 #include "mcecommediasource.h"
       
    26 #include "mcecomcodec.h"
       
    27 
       
    28 
       
    29 class CMceCsSessionImplementation;
       
    30 
       
    31 
       
    32 class TMceFileInfo
       
    33     {
       
    34     
       
    35 public:    // Data
       
    36 
       
    37     enum TAccessType
       
    38         {
       
    39         EZero,
       
    40         EWrite,
       
    41         ERead,
       
    42         EReadWrite
       
    43         };
       
    44         
       
    45 public:    // Data
       
    46 
       
    47     TFileName iFileName;
       
    48     TTimeIntervalMicroSeconds iDuration;
       
    49     TInt iAudioElementCount;
       
    50     TInt iVideoElementCount;
       
    51     TMceComCodecName iAudioCodec;      
       
    52     TMceComCodecName iVideoCodec;      
       
    53     TReal iVideoFrameRate;
       
    54     TUint32 iVideoBitRate;
       
    55     TSize iVideoFrameSize;
       
    56 	TUint32 iAudioBitRate;
       
    57 	TAccessType iDirection;
       
    58 	TAccessType iAccessRights;
       
    59 	
       
    60 	inline TMceFileInfo() 
       
    61 	    : iFileName(0),
       
    62 	      iDuration(0),	
       
    63 	      iAudioElementCount(0),
       
    64 	      iVideoElementCount(0),
       
    65 	      iAudioCodec(0),      
       
    66     	  iVideoCodec(0),
       
    67     	  iVideoFrameRate(0),
       
    68 	      iVideoBitRate(0),
       
    69 	      iVideoFrameSize(0,0),
       
    70 	      iAudioBitRate(0),
       
    71 	      iDirection( ERead ),
       
    72 	      iAccessRights( EReadWrite ){}
       
    73 	      
       
    74     };
       
    75 
       
    76 
       
    77 class TMceTranscodeInfo
       
    78     {
       
    79 
       
    80 public:    // Data
       
    81 
       
    82     TUint32 iTranscodeSessionId;
       
    83     TFileName iFileName;
       
    84     TInt iQuality;
       
    85     TInt iProgress;
       
    86     TInt iError;
       
    87     };
       
    88     
       
    89 
       
    90 
       
    91 /**
       
    92  * 
       
    93  *
       
    94  * @lib 
       
    95  */
       
    96 class CMceComFileSource: public CMceComMediaSource
       
    97 	{
       
    98 
       
    99 public: // Constructors and destructor
       
   100 
       
   101     /**
       
   102     * Constructor
       
   103     */
       
   104     static CMceComFileSource* NewL();
       
   105 
       
   106     /**
       
   107     * Constructor
       
   108     */
       
   109     static CMceComFileSource* NewLC();
       
   110 
       
   111     /**
       
   112     * Destructor.
       
   113     */
       
   114 	~CMceComFileSource();
       
   115 
       
   116 public: // from CMceComMediaSource
       
   117 
       
   118     /**
       
   119     * Internalizes flat data
       
   120     * @param aReadStream read stream
       
   121     */
       
   122     void InternalizeFlatL( RReadStream& aReadStream );
       
   123 
       
   124     /**
       
   125     * Externalizes flat data
       
   126     * @param aWriteStream write stream
       
   127     */
       
   128     void ExternalizeFlatL( RWriteStream& aWriteStream );
       
   129 
       
   130     /**
       
   131     * Traversal event handler
       
   132     * @param aEvent the event
       
   133     * @return status, if event was consumed or not or object needs update
       
   134     */
       
   135     TInt EventReceivedL( TMceComEvent& aEvent );
       
   136 
       
   137     /**
       
   138     * Clones this object
       
   139     * @return the cloned object
       
   140     */
       
   141     CMceComMediaSource* CloneL();
       
   142 
       
   143     /**
       
   144     * Updates this object
       
   145     * @param aUpdate object updates this
       
   146     */
       
   147     void UpdateL( CMceComMediaSource& aUpdate );
       
   148 
       
   149     
       
   150 #ifdef MCE_COMMON_SERVER_SIDE
       
   151 
       
   152     /**
       
   153     * Returns mcc type for mcc endpoint
       
   154     * @return mcc type
       
   155     */
       
   156     const TUid MccType();
       
   157 
       
   158     /**
       
   159     * Returns init param for mcc endpoint
       
   160     * @return mcc type
       
   161     */
       
   162     const TDesC8& InitParamL( const CMceComCodec& aCodec );
       
   163 
       
   164     /**
       
   165     * Endpoint can be informed about initialization completion
       
   166     */
       
   167     void InitializedL();
       
   168 
       
   169 #endif//MCE_COMMON_SERVER_SIDE
       
   170     
       
   171 
       
   172 protected:
       
   173 
       
   174     /**
       
   175     * C++ default constructor.
       
   176     */
       
   177 	CMceComFileSource();
       
   178 		
       
   179 
       
   180 public: // serialized data
       
   181 
       
   182     TBool iFastForward;
       
   183     TBool iFastRewind;
       
   184     TTimeIntervalMicroSeconds iPosition;
       
   185 
       
   186 public: //data
       
   187 
       
   188     TMceFileInfo iFileInfo;
       
   189     
       
   190     TBool iInitialInfoRetrieved;    
       
   191 
       
   192     TInt iCurrentAudioElement;
       
   193     TInt iCurrentVideoElement;
       
   194     
       
   195     TMceTranscodeInfo iTranscodeInfo;
       
   196     
       
   197     CMceCsSessionImplementation* iClient;
       
   198 
       
   199 private: // data
       
   200     
       
   201     HBufC8* iSettings;
       
   202     
       
   203     friend class UT_CMceComFileSource;
       
   204     
       
   205 	};
       
   206 
       
   207 
       
   208 #endif