camerauis/cameraxui/cxengine/tsrc/unit/unittest_cxevideocapturecontrolsymbian/cxevideocapturecontrolsymbianunit.cpp
author hgs
Thu, 13 May 2010 21:30:19 +0300
changeset 28 3075d9b614e6
parent 19 d9aefe59d544
child 29 699651f2666f
permissions -rw-r--r--
201017_1

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/
#include <AudioPreference.h>    // For KAudioPriorityVideoRecording

#include "cxeerrormappingsymbian.h"
#include "cxevideocapturecontrolsymbian.h"
#include "cxevideocapturecontrolsymbianunit.h"
#include "cxefakeVideorecorderutility.h"
#include "cxutils.h"
#include "cxediskmonitor.h"

CxeVideoCaptureControlSymbianUnit::CxeVideoCaptureControlSymbianUnit( 
                                   CxeCameraDevice &cameraDevice,
                                   CxeViewfinderControl &viewfinderControl,
                                   CxeCameraDeviceControl &cameraDeviceControl,
                                   CxeFilenameGenerator &nameGenerator,
                                   CxeSettings &settings,
                                   CxeQualityPresets &qualityPresets,
                                   CxeDiskMonitor &diskMonitor)
    : CxeVideoCaptureControlSymbian(cameraDevice, viewfinderControl, 
                                    cameraDeviceControl, nameGenerator,
                                    settings, qualityPresets, diskMonitor)
{
    CX_DEBUG_IN_FUNCTION();
}

CxeVideoCaptureControlSymbianUnit::~CxeVideoCaptureControlSymbianUnit()
{
    CX_DEBUG_IN_FUNCTION();
}

void CxeVideoCaptureControlSymbianUnit::createVideoRecorder()
{
    CX_DEBUG_ENTER_FUNCTION();

    // init video recoder
    if (state() == CxeVideoCaptureControl::Idle) {
        if (mVideoRecorder == NULL) {
            TRAPD(initErr, mVideoRecorder = 
                new CxeFakeVideoRecorderUtility( *this ,
                            KAudioPriorityVideoRecording,
                            TMdaPriorityPreference( KAudioPrefVideoRecording )));
            if (initErr) {
                CX_DEBUG(("WARNING - VideoRecorderUtility could not be reserved. Failed with err:%d", initErr));
                mVideoRecorder = NULL;
            }
        }
    }

    CX_DEBUG_EXIT_FUNCTION();
}

// end of file