camappengine/Engine/Src/CaeEngineImpVideoNameCustom.cpp
changeset 15 50d5061ee01e
parent 14 34024902876b
child 17 880d946921e4
equal deleted inserted replaced
14:34024902876b 15:50d5061ee01e
     1 /*
       
     2 * Copyright (c) 2002 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:  Camera Application Engine implementation for changing 
       
    15 *                video file name using MMF Video Recorder custom command interface
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include "CaeEngineImp.h" // For Camera Application Engine implementation.
       
    23 #include "CamCControllerCustomCommands.h" // For Camcorder plug-in custom commands and UId.
       
    24 #include <mmf/server/mmffile.h> // For MMF definitions (as TMMFFileConfig)
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // CCaeEngineImp::ChangeVideoFileNameL
       
    28 // -----------------------------------------------------------------------------
       
    29 //
       
    30 void CCaeEngineImp::ChangeVideoFileNameL()
       
    31     {
       
    32     LOGTEXT( _L( "Cae: CCaeEngineImp::ChangeVideoFileNameL() entering" ) );
       
    33 
       
    34     if ( iVideoControllerUid == KCamCControllerImplementationUid ) 
       
    35         {
       
    36         // Use custom command interface of Video Recorder to change the file name.
       
    37         // We know that the custom command is available with this specific implementation.
       
    38         TMMFFileConfig pckg;
       
    39         pckg().iPath = iVideoClipFileName->Des();
       
    40         TInt err = iVideoRecorder->CustomCommandSync( TMMFMessageDestination( iVideoControllerUid, 
       
    41                                                                    KMMFObjectHandleController ), 
       
    42                                            ECamCControllerCCNewFilename, 
       
    43                                            pckg, 
       
    44                                            KNullDesC8 );
       
    45         if (err)
       
    46             {
       
    47             LOGTEXT2( _L( "Cae: CCaeEngineImp::ChangeVideoFileNameL() CustomCommandSync failed err=%d, leaving" ), err );
       
    48             User::Leave(err);
       
    49             }
       
    50         iPrepPars = EFalse;
       
    51         iVideoRecorder->Prepare();
       
    52         }
       
    53     else 
       
    54         {
       
    55         // With 3rd party video controllers we need to re-open video recording because
       
    56         // we can not rely on using custom command for changing the file name.
       
    57         CloseVideoRecording();
       
    58         // Open video recorder.
       
    59         iVideoOpened = ETrue; // This is always set to ETrue when 
       
    60                               // OpenFileL has been called to allow 
       
    61                               // freeing resources by CloseVideoRecording().
       
    62         iVideoRecorder->OpenFileL( iVideoClipFileName->Des(),
       
    63                                    iCameraHandle,
       
    64                                    iVideoControllerUid,
       
    65                                    iVideoFormatUid, 
       
    66                                    iVideoType->Des(),  
       
    67                                    iVideoAudioType );
       
    68         }
       
    69 
       
    70     LOGTEXT( _L( "Cae: CCaeEngineImp::ChangeVideoFileNameL() returning" ) );
       
    71     }
       
    72 
       
    73 //  End of File