os/mm/mmlibs/mmfw/inc/VideoRecorder.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmlibs/mmfw/inc/VideoRecorder.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,217 @@
     1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef __VIDEORECORDER_H__
    1.20 +#define __VIDEORECORDER_H__
    1.21 +
    1.22 +#include <f32file.h>
    1.23 +#include <mmf/common/mmfbase.h>
    1.24 +#include <mmf/common/mmfutilities.h>
    1.25 +#include <mmf/common/mmfcontroller.h>
    1.26 +#include <mmf/common/mmfstandardcustomcommands.h>
    1.27 +#include <mmf/common/mmfcontrollerframeworkbase.h>
    1.28 +#include <mda/common/base.h>
    1.29 +#include <mmfclntutility.h>      
    1.30 +
    1.31 +class CMMFVideoRecorderCallback;
    1.32 +
    1.33 +/**
    1.34 +@publishedAll
    1.35 +@released
    1.36 +
    1.37 +An interface to a set of video recorder callback functions.
    1.38 +
    1.39 +The class is a mixin and is intended to be inherited by the client
    1.40 +class which is observing the video recording operation. The functions
    1.41 +encapsulated by this class are called when specific events occur in
    1.42 +the process of initialising and recording a video clip. A reference to
    1.43 +this object is passed as a parameter when constructing a video recorder
    1.44 +utility object.
    1.45 +
    1.46 +@since 7.0s
    1.47 +*/
    1.48 +class MVideoRecorderUtilityObserver
    1.49 +	{
    1.50 +public:
    1.51 +
    1.52 +	/**
    1.53 +	Notification to the client that the opening of the video clip has completed,
    1.54 +	successfully, or otherwise.
    1.55 +	
    1.56 +	@param  aError
    1.57 +	        The status of the video recorder after initialisation.
    1.58 +	        This is either KErrNone if the open has completed successfully,
    1.59 +	        or one of the system wide error codes.
    1.60 +	*/
    1.61 +	virtual void MvruoOpenComplete(TInt aError) = 0;  
    1.62 +
    1.63 +	/**
    1.64 +	Notification that video recorder is ready to begin recording. This callback
    1.65 +	is generated in response to a call to Prepare.
    1.66 +
    1.67 +	@param  aError
    1.68 +	        This is either KErrNone if the video recorder has been prepared for
    1.69 +	        recording successfully, or one of the system wide error codes
    1.70 +	*/
    1.71 +	virtual void MvruoPrepareComplete(TInt aError) = 0;
    1.72 +
    1.73 +	/**
    1.74 +	Notification that video recording has completed. This is not called if
    1.75 +	recording is explicitly stopped by calling Stop.
    1.76 +	
    1.77 +	@param  aError
    1.78 +	        This is either KErrNone if recording was completed successfully,
    1.79 +	        or one of the system wide error codes.
    1.80 +	*/
    1.81 +	virtual void MvruoRecordComplete(TInt aError) = 0;
    1.82 +
    1.83 +	/**
    1.84 +	General event notification from controller. These events are specified by
    1.85 +	the supplier of the controller.
    1.86 +
    1.87 +	@param  aEvent
    1.88 +	        The event sent by the controller.
    1.89 +	*/
    1.90 +	virtual void MvruoEvent(const TMMFEvent& aEvent) = 0;
    1.91 +	};
    1.92 +
    1.93 +/**
    1.94 +@publishedAll
    1.95 +@released
    1.96 +
    1.97 +Records video data.
    1.98 +
    1.99 +The class offers a simple interface to record and set meta data and control information for a video
   1.100 +clip and save the result to a file, descriptor or URL.
   1.101 +
   1.102 +Note:
   1.103 +Some video formats also allow the storing of audio data. To accommodate this, this class contains
   1.104 +audio functions that can manipulate such data.
   1.105 +
   1.106 +While this class is abstract, NewL() constructs, initialises and returns pointers to instances of
   1.107 +concrete classes derived from this abstract class. This concrete class is part of the MMF
   1.108 +implementation and is private.
   1.109 +
   1.110 +@since 7.0s
   1.111 +*/
   1.112 +class CVideoRecorderUtility : public CBase,
   1.113 +							  public MMMFClientUtility
   1.114 +	{
   1.115 +friend class CTestStepUnitMMFVidClient;
   1.116 +
   1.117 +	class CBody;
   1.118 +
   1.119 +public:
   1.120 +
   1.121 +
   1.122 +	~CVideoRecorderUtility();
   1.123 +	IMPORT_C static CVideoRecorderUtility* NewL(MVideoRecorderUtilityObserver& aObserver,
   1.124 +												TInt aPriority=EMdaPriorityNormal,
   1.125 +												TInt aPref=EMdaPriorityPreferenceTimeAndQuality);
   1.126 +	IMPORT_C void OpenFileL(const TDesC& aFileName,
   1.127 +							TInt aCameraHandle,
   1.128 +							TUid aControllerUid,
   1.129 +							TUid aVideoFormat,
   1.130 +							const TDesC8& aVideoType = KNullDesC8,
   1.131 +							TFourCC aAudioType = KMMFFourCCCodeNULL);
   1.132 +	IMPORT_C void OpenFileL(const RFile& aFile,
   1.133 +							TInt aCameraHandle,
   1.134 +							TUid aControllerUid,
   1.135 +							TUid aVideoFormat,
   1.136 +							const TDesC8& aVideoType = KNullDesC8,
   1.137 +							TFourCC aAudioType = KMMFFourCCCodeNULL);
   1.138 +    IMPORT_C void OpenDesL(TDes8& aDescriptor,
   1.139 +							TInt aCameraHandle,
   1.140 +							TUid aControllerUid,
   1.141 +							TUid aVideoFormat,
   1.142 +							const TDesC8& aVideoType = KNullDesC8,
   1.143 +							TFourCC aAudioType = KMMFFourCCCodeNULL);
   1.144 +    IMPORT_C void OpenUrlL(const TDesC& aUrl,
   1.145 +							TInt aIapId,
   1.146 +							TInt aCameraHandle,
   1.147 +							TUid aControllerUid,
   1.148 +							TUid aVideoFormat,
   1.149 +							const TDesC8& aVideoType = KNullDesC8,
   1.150 +							TFourCC aAudioType = KMMFFourCCCodeNULL);
   1.151 +    IMPORT_C void Close();
   1.152 +    IMPORT_C void Prepare();
   1.153 +    IMPORT_C void Record();
   1.154 +    IMPORT_C TInt Stop();
   1.155 +    IMPORT_C void PauseL();
   1.156 +    IMPORT_C void SetPriorityL(TInt aPriority, TInt aPref);
   1.157 +    IMPORT_C void GetPriorityL(TInt& aPriority, TMdaPriorityPreference& aPref) const;
   1.158 +    IMPORT_C void SetVideoFrameRateL(TReal32 aFrameRate);
   1.159 +    IMPORT_C TReal32 VideoFrameRateL() const;
   1.160 +    IMPORT_C void SetVideoFrameSizeL(const TSize& aSize);
   1.161 +    IMPORT_C void GetVideoFrameSizeL(TSize& aSize) const;
   1.162 +    IMPORT_C void SetVideoBitRateL(TInt aBitRate);
   1.163 +    IMPORT_C TInt VideoBitRateL();
   1.164 +    IMPORT_C void SetAudioBitRateL(TInt aBitRate);
   1.165 +    IMPORT_C TInt AudioBitRateL() const;
   1.166 +    IMPORT_C void SetAudioEnabledL(TBool aEnabled);
   1.167 +    IMPORT_C TBool AudioEnabledL() const;
   1.168 +    IMPORT_C TTimeIntervalMicroSeconds DurationL() const;
   1.169 +    IMPORT_C void SetMaxClipSizeL(TInt aClipSizeInBytes);
   1.170 +    IMPORT_C void SetGainL(TInt aGain);
   1.171 +    IMPORT_C TInt GainL() const;
   1.172 +    IMPORT_C TInt MaxGainL() const;
   1.173 +    IMPORT_C TInt NumberOfMetaDataEntriesL() const;
   1.174 +    IMPORT_C CMMFMetaDataEntry* MetaDataEntryL(TInt aIndex) const;
   1.175 +    IMPORT_C void AddMetaDataEntryL(const CMMFMetaDataEntry& aNewEntry);
   1.176 +    IMPORT_C void RemoveMetaDataEntryL(TInt aIndex);
   1.177 +    IMPORT_C void ReplaceMetaDataEntryL(TInt aIndex,const CMMFMetaDataEntry& aNewEntry);
   1.178 +    IMPORT_C TFourCC AudioTypeL() const;
   1.179 +    IMPORT_C void SetVideoTypeL(const TDesC8& aType);
   1.180 +    IMPORT_C void SetAudioTypeL(TFourCC aType);
   1.181 +    IMPORT_C void GetSupportedVideoTypesL(CDesC8Array& aVideoTypes) const;
   1.182 +    IMPORT_C void GetSupportedAudioTypesL(RArray<TFourCC>& aAudioTypes) const;
   1.183 +    IMPORT_C TTimeIntervalMicroSeconds RecordTimeAvailable() const;
   1.184 +    IMPORT_C const TDesC8& VideoFormatMimeType() const;
   1.185 +    IMPORT_C const CMMFControllerImplementationInformation& ControllerImplementationInformationL();
   1.186 +    IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom);
   1.187 +    IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2);
   1.188 +    IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus);
   1.189 +    IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus);
   1.190 +    IMPORT_C void SetPixelAspectRatioL(const TVideoAspectRatio& aAspectRatio);
   1.191 +    IMPORT_C void GetPixelAspectRatioL(TVideoAspectRatio& aAspectRatio) const;
   1.192 +    IMPORT_C void GetSupportedPixelAspectRatiosL(RArray<TVideoAspectRatio>& aAspectRatios) const;
   1.193 +    IMPORT_C void SetAudioChannelsL(const TUint aNumChannels);
   1.194 +    IMPORT_C TUint AudioChannelsL() const;
   1.195 +    IMPORT_C void GetSupportedAudioChannelsL(RArray<TUint>& aChannels) const;
   1.196 +    IMPORT_C void SetAudioSampleRateL(const TUint aSampleRate);    
   1.197 +    IMPORT_C TUint AudioSampleRateL() const;
   1.198 +    IMPORT_C void GetSupportedAudioSampleRatesL(RArray<TUint> &aSampleRates) const;
   1.199 +    IMPORT_C void SetVideoEnabledL(TBool aEnabled);
   1.200 +    IMPORT_C TBool VideoEnabledL() const;
   1.201 +    IMPORT_C void SetVideoQualityL(TInt aQuality);
   1.202 +    IMPORT_C TInt VideoQualityL() const;
   1.203 +    IMPORT_C void SetVideoFrameRateFixedL(TBool aFixedFrameRate);
   1.204 +    IMPORT_C TBool VideoFrameRateFixedL() const;
   1.205 +
   1.206 +private:
   1.207 +	enum TMMFVideoRecorderState
   1.208 +		{
   1.209 +		EStopped,
   1.210 +		EOpening,
   1.211 +		EPaused,
   1.212 +		ERecording
   1.213 +		};
   1.214 +
   1.215 +private:
   1.216 +	CBody* iBody;
   1.217 +	friend class CBody;
   1.218 +	};
   1.219 +
   1.220 +#endif