sl@0: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef __VIDEORECORDER_H__ sl@0: #define __VIDEORECORDER_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: class CMMFVideoRecorderCallback; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: An interface to a set of video recorder callback functions. sl@0: sl@0: The class is a mixin and is intended to be inherited by the client sl@0: class which is observing the video recording operation. The functions sl@0: encapsulated by this class are called when specific events occur in sl@0: the process of initialising and recording a video clip. A reference to sl@0: this object is passed as a parameter when constructing a video recorder sl@0: utility object. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: class MVideoRecorderUtilityObserver sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: Notification to the client that the opening of the video clip has completed, sl@0: successfully, or otherwise. sl@0: sl@0: @param aError sl@0: The status of the video recorder after initialisation. sl@0: This is either KErrNone if the open has completed successfully, sl@0: or one of the system wide error codes. sl@0: */ sl@0: virtual void MvruoOpenComplete(TInt aError) = 0; sl@0: sl@0: /** sl@0: Notification that video recorder is ready to begin recording. This callback sl@0: is generated in response to a call to Prepare. sl@0: sl@0: @param aError sl@0: This is either KErrNone if the video recorder has been prepared for sl@0: recording successfully, or one of the system wide error codes sl@0: */ sl@0: virtual void MvruoPrepareComplete(TInt aError) = 0; sl@0: sl@0: /** sl@0: Notification that video recording has completed. This is not called if sl@0: recording is explicitly stopped by calling Stop. sl@0: sl@0: @param aError sl@0: This is either KErrNone if recording was completed successfully, sl@0: or one of the system wide error codes. sl@0: */ sl@0: virtual void MvruoRecordComplete(TInt aError) = 0; sl@0: sl@0: /** sl@0: General event notification from controller. These events are specified by sl@0: the supplier of the controller. sl@0: sl@0: @param aEvent sl@0: The event sent by the controller. sl@0: */ sl@0: virtual void MvruoEvent(const TMMFEvent& aEvent) = 0; sl@0: }; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Records video data. sl@0: sl@0: The class offers a simple interface to record and set meta data and control information for a video sl@0: clip and save the result to a file, descriptor or URL. sl@0: sl@0: Note: sl@0: Some video formats also allow the storing of audio data. To accommodate this, this class contains sl@0: audio functions that can manipulate such data. sl@0: sl@0: While this class is abstract, NewL() constructs, initialises and returns pointers to instances of sl@0: concrete classes derived from this abstract class. This concrete class is part of the MMF sl@0: implementation and is private. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: class CVideoRecorderUtility : public CBase, sl@0: public MMMFClientUtility sl@0: { sl@0: friend class CTestStepUnitMMFVidClient; sl@0: sl@0: class CBody; sl@0: sl@0: public: sl@0: sl@0: sl@0: ~CVideoRecorderUtility(); sl@0: IMPORT_C static CVideoRecorderUtility* NewL(MVideoRecorderUtilityObserver& aObserver, sl@0: TInt aPriority=EMdaPriorityNormal, sl@0: TInt aPref=EMdaPriorityPreferenceTimeAndQuality); sl@0: IMPORT_C void OpenFileL(const TDesC& aFileName, sl@0: TInt aCameraHandle, sl@0: TUid aControllerUid, sl@0: TUid aVideoFormat, sl@0: const TDesC8& aVideoType = KNullDesC8, sl@0: TFourCC aAudioType = KMMFFourCCCodeNULL); sl@0: IMPORT_C void OpenFileL(const RFile& aFile, sl@0: TInt aCameraHandle, sl@0: TUid aControllerUid, sl@0: TUid aVideoFormat, sl@0: const TDesC8& aVideoType = KNullDesC8, sl@0: TFourCC aAudioType = KMMFFourCCCodeNULL); sl@0: IMPORT_C void OpenDesL(TDes8& aDescriptor, sl@0: TInt aCameraHandle, sl@0: TUid aControllerUid, sl@0: TUid aVideoFormat, sl@0: const TDesC8& aVideoType = KNullDesC8, sl@0: TFourCC aAudioType = KMMFFourCCCodeNULL); sl@0: IMPORT_C void OpenUrlL(const TDesC& aUrl, sl@0: TInt aIapId, sl@0: TInt aCameraHandle, sl@0: TUid aControllerUid, sl@0: TUid aVideoFormat, sl@0: const TDesC8& aVideoType = KNullDesC8, sl@0: TFourCC aAudioType = KMMFFourCCCodeNULL); sl@0: IMPORT_C void Close(); sl@0: IMPORT_C void Prepare(); sl@0: IMPORT_C void Record(); sl@0: IMPORT_C TInt Stop(); sl@0: IMPORT_C void PauseL(); sl@0: IMPORT_C void SetPriorityL(TInt aPriority, TInt aPref); sl@0: IMPORT_C void GetPriorityL(TInt& aPriority, TMdaPriorityPreference& aPref) const; sl@0: IMPORT_C void SetVideoFrameRateL(TReal32 aFrameRate); sl@0: IMPORT_C TReal32 VideoFrameRateL() const; sl@0: IMPORT_C void SetVideoFrameSizeL(const TSize& aSize); sl@0: IMPORT_C void GetVideoFrameSizeL(TSize& aSize) const; sl@0: IMPORT_C void SetVideoBitRateL(TInt aBitRate); sl@0: IMPORT_C TInt VideoBitRateL(); sl@0: IMPORT_C void SetAudioBitRateL(TInt aBitRate); sl@0: IMPORT_C TInt AudioBitRateL() const; sl@0: IMPORT_C void SetAudioEnabledL(TBool aEnabled); sl@0: IMPORT_C TBool AudioEnabledL() const; sl@0: IMPORT_C TTimeIntervalMicroSeconds DurationL() const; sl@0: IMPORT_C void SetMaxClipSizeL(TInt aClipSizeInBytes); sl@0: IMPORT_C void SetGainL(TInt aGain); sl@0: IMPORT_C TInt GainL() const; sl@0: IMPORT_C TInt MaxGainL() const; sl@0: IMPORT_C TInt NumberOfMetaDataEntriesL() const; sl@0: IMPORT_C CMMFMetaDataEntry* MetaDataEntryL(TInt aIndex) const; sl@0: IMPORT_C void AddMetaDataEntryL(const CMMFMetaDataEntry& aNewEntry); sl@0: IMPORT_C void RemoveMetaDataEntryL(TInt aIndex); sl@0: IMPORT_C void ReplaceMetaDataEntryL(TInt aIndex,const CMMFMetaDataEntry& aNewEntry); sl@0: IMPORT_C TFourCC AudioTypeL() const; sl@0: IMPORT_C void SetVideoTypeL(const TDesC8& aType); sl@0: IMPORT_C void SetAudioTypeL(TFourCC aType); sl@0: IMPORT_C void GetSupportedVideoTypesL(CDesC8Array& aVideoTypes) const; sl@0: IMPORT_C void GetSupportedAudioTypesL(RArray& aAudioTypes) const; sl@0: IMPORT_C TTimeIntervalMicroSeconds RecordTimeAvailable() const; sl@0: IMPORT_C const TDesC8& VideoFormatMimeType() const; sl@0: IMPORT_C const CMMFControllerImplementationInformation& ControllerImplementationInformationL(); sl@0: IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom); sl@0: IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2); sl@0: IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus); sl@0: IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus); sl@0: IMPORT_C void SetPixelAspectRatioL(const TVideoAspectRatio& aAspectRatio); sl@0: IMPORT_C void GetPixelAspectRatioL(TVideoAspectRatio& aAspectRatio) const; sl@0: IMPORT_C void GetSupportedPixelAspectRatiosL(RArray& aAspectRatios) const; sl@0: IMPORT_C void SetAudioChannelsL(const TUint aNumChannels); sl@0: IMPORT_C TUint AudioChannelsL() const; sl@0: IMPORT_C void GetSupportedAudioChannelsL(RArray& aChannels) const; sl@0: IMPORT_C void SetAudioSampleRateL(const TUint aSampleRate); sl@0: IMPORT_C TUint AudioSampleRateL() const; sl@0: IMPORT_C void GetSupportedAudioSampleRatesL(RArray &aSampleRates) const; sl@0: IMPORT_C void SetVideoEnabledL(TBool aEnabled); sl@0: IMPORT_C TBool VideoEnabledL() const; sl@0: IMPORT_C void SetVideoQualityL(TInt aQuality); sl@0: IMPORT_C TInt VideoQualityL() const; sl@0: IMPORT_C void SetVideoFrameRateFixedL(TBool aFixedFrameRate); sl@0: IMPORT_C TBool VideoFrameRateFixedL() const; sl@0: sl@0: private: sl@0: enum TMMFVideoRecorderState sl@0: { sl@0: EStopped, sl@0: EOpening, sl@0: EPaused, sl@0: ERecording sl@0: }; sl@0: sl@0: private: sl@0: CBody* iBody; sl@0: friend class CBody; sl@0: }; sl@0: sl@0: #endif