videoeditorengine/vedengine/inc/vedvideoconversion.h
changeset 0 951a5db380a0
equal deleted inserted replaced
-1:000000000000 0:951a5db380a0
       
     1 /*
       
     2 * Copyright (c) 2010 Ixonos Plc.
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the "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 * Ixonos Plc
       
    14 *
       
    15 * Description:  
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __VEDVIDEOCONVERSION_H__
       
    21 #define __VEDVIDEOCONVERSION_H__
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <f32file.h>
       
    25 
       
    26 enum TMMSCompatibility
       
    27 {
       
    28      ECompatible,
       
    29      ECutNeeded,  // Only cut or also format conversion
       
    30      EConversionNeeded,  // File small enough, format wrong
       
    31      EIncompatible  // Wrong format, cannot convert
       
    32 };
       
    33 
       
    34 #define KVedOriginalDuration TTimeIntervalMicroSeconds(-1)
       
    35 
       
    36 class CVideoConverter;
       
    37 
       
    38 class MVideoConverterObserver
       
    39 {
       
    40 
       
    41     public:
       
    42     
       
    43         virtual void MvcoFileInserted(CVideoConverter& aConverter) = 0;
       
    44         
       
    45         virtual void MvcoFileInsertionFailed(CVideoConverter& aConverter, TInt aError) = 0;
       
    46 
       
    47         virtual void MvcoConversionStartedL(CVideoConverter& aConverter) = 0;
       
    48     
       
    49         virtual void MvcoConversionProgressed(CVideoConverter& aConverter, TInt aPercentage) = 0;
       
    50     
       
    51         virtual void MvcoConversionCompleted(CVideoConverter& aConverter, TInt aError) = 0;
       
    52 };
       
    53 
       
    54 
       
    55 class CVideoConverter : public CBase
       
    56 {
       
    57 
       
    58     public:
       
    59     
       
    60         IMPORT_C static CVideoConverter* NewL(MVideoConverterObserver& aObserver);
       
    61         
       
    62         IMPORT_C static CVideoConverter* NewLC(MVideoConverterObserver& aObserver);
       
    63         
       
    64         // Insert file to be checked / converted
       
    65         virtual void InsertFileL(RFile* aFile) = 0;
       
    66 
       
    67         // check compatibility
       
    68         virtual TMMSCompatibility CheckMMSCompatibilityL(TInt aMaxSize) = 0;
       
    69                 
       
    70         // get estimate for end time based on start time and target size
       
    71         virtual void GetDurationEstimateL(TInt aTargetSize, TTimeIntervalMicroSeconds aStartTime, 
       
    72                                           TTimeIntervalMicroSeconds& aEndTime) = 0;
       
    73         
       
    74         // Start converting file
       
    75         virtual void ConvertL(RFile* aOutputFile, TInt aSizeLimit,
       
    76                               TTimeIntervalMicroSeconds aCutInTime = TTimeIntervalMicroSeconds(0),
       
    77                               TTimeIntervalMicroSeconds aCutOutTime = KVedOriginalDuration) = 0;
       
    78         
       
    79         // Cancel
       
    80         virtual TInt CancelConversion() = 0;
       
    81         
       
    82         // Reset converter, remove file etc.
       
    83         virtual TInt Reset() = 0;
       
    84 
       
    85 };
       
    86 
       
    87 #endif
       
    88 
       
    89 // End of file