|
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 #include "OstTraceDefinitions.h" |
|
26 #ifdef OST_TRACE_COMPILER_IN_USE |
|
27 #include "CaeEngineImpVideoNameCustomTraces.h" |
|
28 #endif |
|
29 |
|
30 // ----------------------------------------------------------------------------- |
|
31 // CCaeEngineImp::ChangeVideoFileNameL |
|
32 // ----------------------------------------------------------------------------- |
|
33 // |
|
34 void CCaeEngineImp::ChangeVideoFileNameL() |
|
35 { |
|
36 OstTrace0( CAMERASRV_PERFORMANCE, CCAEENGINEIMP_CHANGEVIDEOFILENAMEL, "e_CAM_CAE_CHANGE_VIDEO_FILE_NAME 1" ); |
|
37 LOGTEXT( _L( "Cae: CCaeEngineImp::ChangeVideoFileNameL() entering" ) ); |
|
38 |
|
39 if ( iVideoControllerUid == KCamCControllerImplementationUid ) |
|
40 { |
|
41 // Use custom command interface of Video Recorder to change the file name. |
|
42 // We know that the custom command is available with this specific implementation. |
|
43 TMMFFileConfig pckg; |
|
44 pckg().iPath = iVideoClipFileName->Des(); |
|
45 OstTrace0( CAMERASRV_PERFORMANCE, DUP2_CCAEENGINEIMP_CHANGEVIDEOFILENAMEL, "e_CAM_CAE_CUSTOM_COMMAND 1" ); |
|
46 TInt err = iVideoRecorder->CustomCommandSync( TMMFMessageDestination( iVideoControllerUid, |
|
47 KMMFObjectHandleController ), |
|
48 ECamCControllerCCNewFilename, |
|
49 pckg, |
|
50 KNullDesC8 ); |
|
51 OstTrace0( CAMERASRV_PERFORMANCE, DUP3_CCAEENGINEIMP_CHANGEVIDEOFILENAMEL, "e_CAM_CAE_CUSTOM_COMMAND 0" ); |
|
52 if (err) |
|
53 { |
|
54 LOGTEXT2( _L( "Cae: CCaeEngineImp::ChangeVideoFileNameL() CustomCommandSync failed err=%d, leaving" ), err ); |
|
55 User::Leave(err); |
|
56 } |
|
57 iPrepPars = EFalse; |
|
58 OstTrace0( CAMERASRV_PERFORMANCE, DUP4_CCAEENGINEIMP_CHANGEVIDEOFILENAMEL, "e_CAM_CAE_VIDEORECORDER_PREPARE 1" ); |
|
59 iVideoRecorder->Prepare(); |
|
60 OstTrace0( CAMERASRV_PERFORMANCE, DUP5_CCAEENGINEIMP_CHANGEVIDEOFILENAMEL, "e_CAM_CAE_VIDEORECORDER_PREPARE 0" ); |
|
61 } |
|
62 else |
|
63 { |
|
64 // With 3rd party video controllers we need to re-open video recording because |
|
65 // we can not rely on using custom command for changing the file name. |
|
66 CloseVideoRecording(); |
|
67 // Open video recorder. |
|
68 iVideoOpened = ETrue; // This is always set to ETrue when |
|
69 // OpenFileL has been called to allow |
|
70 // freeing resources by CloseVideoRecording(). |
|
71 OstTrace0( CAMERASRV_PERFORMANCE, DUP6_CCAEENGINEIMP_CHANGEVIDEOFILENAMEL, "e_CAM_CAE_VIDEORECORDER_OPENFILE 1" ); |
|
72 iVideoRecorder->OpenFileL( iVideoClipFileName->Des(), |
|
73 iCameraHandle, |
|
74 iVideoControllerUid, |
|
75 iVideoFormatUid, |
|
76 iVideoType->Des(), |
|
77 iVideoAudioType ); |
|
78 OstTrace0( CAMERASRV_PERFORMANCE, DUP7_CCAEENGINEIMP_CHANGEVIDEOFILENAMEL, "e_CAM_CAE_VIDEORECORDER_OPENFILE 0" ); |
|
79 } |
|
80 OstTrace0( CAMERASRV_PERFORMANCE, DUP1_CCAEENGINEIMP_CHANGEVIDEOFILENAMEL, "e_CAM_CAE_CHANGE_VIDEO_FILE_NAME 0" ); |
|
81 LOGTEXT( _L( "Cae: CCaeEngineImp::ChangeVideoFileNameL() returning" ) ); |
|
82 } |
|
83 |
|
84 // End of File |