videoeditorengine/vedengine/videoprocessor/src/movieprocessor.cpp
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 * Implementation of the movie processor
       
    17 * interface class.                
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 //  EXTERNAL RESOURCES
       
    23 
       
    24 //  Include Files
       
    25 
       
    26 #include "movieprocessorimpl.h"
       
    27 #include "VedMovie.h"
       
    28 #include "movieprocessor.h"
       
    29 #include "VideoProcessorAudioData.h"
       
    30 
       
    31 
       
    32 // -----------------------------------------------------------------------------
       
    33 // CMovieProcessor::NewL
       
    34 // Two-phased constructor.
       
    35 // -----------------------------------------------------------------------------
       
    36 //
       
    37 CMovieProcessor* CMovieProcessor::NewL()    
       
    38 
       
    39 	{
       
    40 	CMovieProcessor* self = NewLC();
       
    41 	CleanupStack::Pop(self);
       
    42 	return self;
       
    43 	}
       
    44 
       
    45 CMovieProcessor* CMovieProcessor::NewLC()
       
    46 	{
       
    47 	CMovieProcessor* self = new (ELeave) CMovieProcessor();
       
    48 	CleanupStack::PushL(self);
       
    49 	self->ConstructL();
       
    50 	return self;
       
    51 	}
       
    52 
       
    53 // -----------------------------------------------------------------------------
       
    54 // CMovieProcessor::CMovieProcessor()
       
    55 // C++ default constructor can NOT contain any code, that
       
    56 // might leave.
       
    57 // -----------------------------------------------------------------------------
       
    58 //
       
    59 CMovieProcessor::CMovieProcessor()
       
    60 	{
       
    61 	iMovieProcessor=0;
       
    62 	}
       
    63 
       
    64 // -----------------------------------------------------------------------------
       
    65 // CMovieProcessor::ConstructL
       
    66 // Symbian 2nd phase constructor can leave.
       
    67 // -----------------------------------------------------------------------------
       
    68 //
       
    69 void CMovieProcessor::ConstructL()
       
    70 	{
       
    71 	iMovieProcessor = CMovieProcessorImpl::NewL();
       
    72 	}
       
    73 
       
    74 // -----------------------------------------------------------------------------
       
    75 // CMovieProcessor::~CMovieProcessor
       
    76 // Destructor.
       
    77 // -----------------------------------------------------------------------------
       
    78 //
       
    79 CMovieProcessor::~CMovieProcessor()
       
    80 {
       
    81     iAudioDataArray.ResetAndDestroy();
       
    82 	if(iMovieProcessor)
       
    83 	{
       
    84 		delete iMovieProcessor; 
       
    85 		iMovieProcessor=0;
       
    86 	}
       
    87 }
       
    88 
       
    89 // -----------------------------------------------------------------------------
       
    90 // CMovieProcessor::StartMovieL
       
    91 // Prepares the processor for processing a movie and starts processing
       
    92 // (other items were commented in a header).
       
    93 // -----------------------------------------------------------------------------
       
    94 //
       
    95 void CMovieProcessor::StartMovieL(CVedMovieImp* aMovie, const TDesC& aFileName, 
       
    96                                   RFile* aFileHandle,MVedMovieProcessingObserver* aObserver)
       
    97 	{    
       
    98 	iMovieProcessor->StartMovieL(aMovie, aFileName, aFileHandle, aObserver); 
       
    99 	}
       
   100 
       
   101 
       
   102 // -----------------------------------------------------------------------------
       
   103 // CMovieProcessor::GetVideoClipPropertiesL
       
   104 // Retrieves information about the given clip
       
   105 // (other items were commented in a header).
       
   106 // -----------------------------------------------------------------------------
       
   107 //
       
   108 void CMovieProcessor::GetVideoClipPropertiesL(const TDesC& aFileName,
       
   109                                               RFile* aFileHandle,
       
   110 											  TVedVideoFormat& aFormat,
       
   111 											  TVedVideoType& aVideoType, 
       
   112 											  TSize& aResolution,
       
   113 											  TVedAudioType& aAudioType, 
       
   114 											  TTimeIntervalMicroSeconds& aDuration,
       
   115 											  TInt& aVideoFrameCount,
       
   116 											  TInt& aSamplingRate, 
       
   117 											  TVedAudioChannelMode& aChannelMode)
       
   118 	{	
       
   119 
       
   120 	iMovieProcessor->GetClipPropertiesL(aFileName, aFileHandle, aFormat, aVideoType, 
       
   121 		aResolution, aAudioType,  aDuration, aVideoFrameCount, aSamplingRate, aChannelMode);
       
   122 
       
   123 	return; 
       
   124 
       
   125 	}
       
   126 
       
   127 // -----------------------------------------------------------------------------
       
   128 // CMovieProcessor::GenerateVideoFrameInfoArrayL
       
   129 // Retrieves frames parameters for a clip to array
       
   130 // (other items were commented in a header).
       
   131 // -----------------------------------------------------------------------------
       
   132 //
       
   133 void CMovieProcessor::GenerateVideoFrameInfoArrayL(const TDesC& aFileName, RFile* aFileHandle, TVedVideoFrameInfo*& aVideoFrameInfoArray)
       
   134     {
       
   135     iMovieProcessor->GenerateVideoFrameInfoArrayL((const TDesC&)aFileName, aFileHandle,(TVedVideoFrameInfo*&)aVideoFrameInfoArray);
       
   136     return;
       
   137     }
       
   138 
       
   139 // -----------------------------------------------------------------------------
       
   140 // CMovieProcessor::GetMovieSizeEstimateL
       
   141 // Calculates file size estimate for the output file
       
   142 // (other items were commented in a header).
       
   143 // -----------------------------------------------------------------------------
       
   144 //
       
   145 TInt CMovieProcessor::GetMovieSizeEstimateL(const CVedMovie* aMovie)
       
   146 	{
       
   147 	return iMovieProcessor->GetMovieSizeEstimateL(aMovie); 
       
   148 	}
       
   149 
       
   150 // -----------------------------------------------------------------------------
       
   151 // CMovieProcessor::GetMovieSizeEstimateForMMSL
       
   152 // Calculates file size estimate for the output file
       
   153 // (other items were commented in a header).
       
   154 // -----------------------------------------------------------------------------
       
   155 //
       
   156 TInt CMovieProcessor::GetMovieSizeEstimateForMMSL(const CVedMovie* aMovie, TInt aTargetSize, 
       
   157 												  TTimeIntervalMicroSeconds aStartTime, 
       
   158 												  TTimeIntervalMicroSeconds& aEndTime)
       
   159 	{
       
   160 	return iMovieProcessor->GetMovieSizeEstimateForMMSL(aMovie, aTargetSize, aStartTime, aEndTime); 
       
   161 	}
       
   162 
       
   163 
       
   164 // -----------------------------------------------------------------------------
       
   165 // CMovieProcessor::StartThumbL
       
   166 // Initiates thumbnail generation
       
   167 // (other items were commented in a header).
       
   168 // -----------------------------------------------------------------------------
       
   169 //
       
   170 void CMovieProcessor::StartThumbL(const TDesC& aFileName, RFile* aFileHandle, TInt aIndex, 
       
   171                                   TSize aResolution, TDisplayMode aDisplayMode, TBool aEnhance)
       
   172 	{
       
   173 	iMovieProcessor->StartThumbL(aFileName, aFileHandle, aIndex, aResolution, aDisplayMode, aEnhance); 
       
   174 	}
       
   175 
       
   176 
       
   177 // -----------------------------------------------------------------------------
       
   178 // CMovieProcessor::ProcessThumbL
       
   179 // Starts thumbnail image generation
       
   180 // (other items were commented in a header).
       
   181 // -----------------------------------------------------------------------------
       
   182 //	
       
   183 void CMovieProcessor::ProcessThumbL(TRequestStatus &aStatus, TVedTranscodeFactor* aFactor)
       
   184 {
       
   185     iMovieProcessor->ProcessThumbL(aStatus, aFactor);
       
   186 }
       
   187 
       
   188 // -----------------------------------------------------------------------------
       
   189 // CMovieProcessor::FetchThumb
       
   190 // Gets a pointer to completed thumbnail bitmap
       
   191 // (other items were commented in a header).
       
   192 // -----------------------------------------------------------------------------
       
   193 //	
       
   194 void CMovieProcessor::FetchThumb(CFbsBitmap*& aThumb)
       
   195 {
       
   196     iMovieProcessor->FetchThumb(aThumb);   
       
   197 }
       
   198 
       
   199 
       
   200 // -----------------------------------------------------------------------------
       
   201 // CMovieProcessor::CancelProcessingL
       
   202 // Stops processing the movie
       
   203 // (other items were commented in a header).
       
   204 // -----------------------------------------------------------------------------
       
   205 //
       
   206 void CMovieProcessor::CancelProcessingL()
       
   207 {
       
   208     iMovieProcessor->CancelProcessingL();
       
   209 }
       
   210 
       
   211 // -----------------------------------------------------------------------------
       
   212 // CMovieProcessor::SetMovieSizeLimit
       
   213 // Sets the maximum size for the movie
       
   214 // (other items were commented in a header).
       
   215 // -----------------------------------------------------------------------------
       
   216 //	
       
   217 void CMovieProcessor::SetMovieSizeLimit(TInt aLimit)
       
   218     {
       
   219     iMovieProcessor->SetMovieSizeLimit(aLimit);
       
   220     }
       
   221