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