camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/cxevideocapturecontrolsymbianunit.cpp
branchRCL_3
changeset 24 bac7acad7cb3
parent 23 61bc0f252b2b
child 25 2c87b2808fd7
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
     1 /*
       
     2 * Copyright (c) 2009 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 #include <AudioPreference.h>    // For KAudioPriorityVideoRecording
       
    18 
       
    19 #include "cxeerrormappingsymbian.h"
       
    20 #include "cxevideocapturecontrolsymbian.h"
       
    21 #include "cxevideocapturecontrolsymbianunit.h"
       
    22 #include "cxefakeVideorecorderutility.h"
       
    23 #include "cxutils.h"
       
    24 #include "cxediskmonitor.h"
       
    25 
       
    26 CxeVideoCaptureControlSymbianUnit::CxeVideoCaptureControlSymbianUnit(
       
    27                                    CxeCameraDevice &cameraDevice,
       
    28                                    CxeViewfinderControl &viewfinderControl,
       
    29                                    CxeSnapshotControl &snapshotControl,
       
    30                                    CxeCameraDeviceControl &cameraDeviceControl,
       
    31                                    CxeFilenameGenerator &nameGenerator,
       
    32                                    CxeSettings &settings,
       
    33                                    CxeQualityPresets &qualityPresets,
       
    34                                    CxeDiskMonitor &diskMonitor)
       
    35     : CxeVideoCaptureControlSymbian(cameraDevice, viewfinderControl, snapshotControl,
       
    36                                     cameraDeviceControl, nameGenerator,
       
    37                                     settings, qualityPresets, diskMonitor)
       
    38 {
       
    39     CX_DEBUG_IN_FUNCTION();
       
    40 }
       
    41 
       
    42 CxeVideoCaptureControlSymbianUnit::~CxeVideoCaptureControlSymbianUnit()
       
    43 {
       
    44     CX_DEBUG_IN_FUNCTION();
       
    45 }
       
    46 
       
    47 void CxeVideoCaptureControlSymbianUnit::createVideoRecorder()
       
    48 {
       
    49     CX_DEBUG_ENTER_FUNCTION();
       
    50 
       
    51     // init video recoder
       
    52     if (state() == CxeVideoCaptureControl::Idle) {
       
    53         if (mVideoRecorder == NULL) {
       
    54             TRAPD(initErr, mVideoRecorder =
       
    55                 new CxeFakeVideoRecorderUtility( *this ,
       
    56                             KAudioPriorityVideoRecording,
       
    57                             TMdaPriorityPreference( KAudioPrefVideoRecording )));
       
    58             if (initErr) {
       
    59                 CX_DEBUG(("WARNING - VideoRecorderUtility could not be reserved. Failed with err:%d", initErr));
       
    60                 mVideoRecorder = NULL;
       
    61             }
       
    62         }
       
    63     }
       
    64 
       
    65     CX_DEBUG_EXIT_FUNCTION();
       
    66 }
       
    67 
       
    68 // end of file