CCMRMediaRecorder Class Reference

class CCMRMediaRecorder : public CBase

Abstract Media recorder interface

CAMCMEDIARECORDER.LIB
Since
2.1

Inherits from

Public Member Functions
TInt AudioBitRateL()
TBool AudioEnabledL()
TInt GainL()
voidGetAudioCodecL(TFourCC &)
voidGetSupportedAudioCodecsL(RArray< TFourCC > &)
voidGetSupportedVideoCodecsL(CDesC8Array &)
voidGetVideoCodecL(TDes8 &)
voidGetVideoFrameSizeL(TSize &)
voidGetVideoRateControlOptionsL(TRateControlOptions &)
TInt MaxGainL()
TInt MaxTotalBitRateL()
IMPORT_C CCMRMediaRecorder *NewL()
voidOpenL(MCMRMediaRecorderObserver *, MDataSource *, MCMRMediaSink *, TInt, const TDesC8 &, TFourCC)
voidPauseL()
voidPrepareL()
voidRecordL()
voidResumeL()
voidSetAudioBitRateL(TInt)
voidSetAudioCodecL(const TFourCC &)
voidSetAudioEnabledL(TBool)
voidSetAudioPriorityL(const TMMFPrioritySettings &)
voidSetGainL(TInt)
voidSetMaxTotalBitRateL(TInt)
voidSetPreferredVideoEncapsulationL(TVideoDataUnitEncapsulation)
voidSetPreferredVideoEncoderL(TUid &)
voidSetSegmentTargetSizeL(TUint, TUint, TUint)
voidSetVideoBitRateL(TInt)
voidSetVideoCodecL(const TDesC8 &)
voidSetVideoCodingOptionsL(const TCCMRVideoCodingOptions &)
voidSetVideoFrameRateL(TReal32)
voidSetVideoFrameSizeL(const TSize &)
voidSetVideoRateControlOptionsL(const TRateControlOptions &)
TRecorderState State()
voidStopL()
TInt VideoBitRateL()
TReal32 VideoFrameRateL()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enumTRecorderState {
EStateNone = 0, EStateOpen, EStatePreparing, EStateReadyToRecord, EStateRecording, EStatePaused, EStateStopping, EStatePausing
}

Member Functions Documentation

AudioBitRateL()

TInt AudioBitRateL()[pure virtual]
Gets the current target audio bitrate
Since
2.1

AudioEnabledL()

TBool AudioEnabledL()const [pure virtual]
Query whether audio recording is enabled
Since
2.1

GainL()

TInt GainL()const [pure virtual]
Get current audio recording gain
Since
2.1

GetAudioCodecL(TFourCC &)

voidGetAudioCodecL(TFourCC &aAudioType)[pure virtual]
Get the currently used audio codec
Since
2.1

Parameters

TFourCC & aAudioTypeUsed codec as FourCC

GetSupportedAudioCodecsL(RArray< TFourCC > &)

voidGetSupportedAudioCodecsL(RArray< TFourCC > &aAudioTypes)[pure virtual]
Get supported & installed audio codecs
Since
2.1

Parameters

RArray< TFourCC > & aAudioTypesList of supported & installed audio codecs

GetSupportedVideoCodecsL(CDesC8Array &)

voidGetSupportedVideoCodecsL(CDesC8Array &aVideoMimeTypes)[pure virtual]
Get supported & installed video codecs This can be called also when the recorder is not open
Since
2.1

Parameters

CDesC8Array & aVideoMimeTypesList of supported & installed video codecs as mime type

GetVideoCodecL(TDes8 &)

voidGetVideoCodecL(TDes8 &aVideoMimeType)[pure virtual]
Get the currently used video codec
Since
2.1

Parameters

TDes8 & aVideoMimeTypeUsed codec as mime type

GetVideoFrameSizeL(TSize &)

voidGetVideoFrameSizeL(TSize &aSize)const [pure virtual]
Get current video frame size
Since
2.1

Parameters

TSize & aSizeCurrent size (Output)

GetVideoRateControlOptionsL(TRateControlOptions &)

voidGetVideoRateControlOptionsL(TRateControlOptions &aOptions)[pure virtual]

Gets current video bit-rate control options for a whole bitstream. This method can only be called after the media recorder has been prepared or during recording.

Since
3.2

Parameters

TRateControlOptions & aOptions"Current bitrate control options."

MaxGainL()

TInt MaxGainL()const [pure virtual]
Get maximum audio recording gain
Since
2.1

MaxTotalBitRateL()

TInt MaxTotalBitRateL()const [pure virtual]
Get current maximum total (audio+video) bitrate
Since
2.1

NewL()

IMPORT_C CCMRMediaRecorder *NewL()[static]

Two-phased constructor.

OpenL(MCMRMediaRecorderObserver *, MDataSource *, MCMRMediaSink *, TInt, const TDesC8 &, TFourCC)

voidOpenL(MCMRMediaRecorderObserver *aObserver,
MDataSource *aAudioSource,
MCMRMediaSink *aSink,
TIntaCameraHandle,
const TDesC8 &aVideoMimeType =  KNullDesC8 ,
TFourCCaAudioType =  KFourCCNULL
)[pure virtual]
Open the recorder: Creates A/V recorders & other needed components
Since
2.1

Parameters

MCMRMediaRecorderObserver * aObserverMediarecorder observer
MDataSource * aAudioSourceMMF audio source
MCMRMediaSink * aSinkMCMRMediaSink for data output
TInt aCameraHandleCamera handle
const TDesC8 & aVideoMimeType =  KNullDesC8 Video codec MIME-type (default: KNullDesC8 => use default codec)
TFourCC aAudioType =  KFourCCNULL Audio coded FourCC (default: KFourCCNULL => use default codec)

PauseL()

voidPauseL()[pure virtual]
Pauses recording
Since
2.1

PrepareL()

voidPrepareL()[pure virtual]
Prepares the recorder, for minimising latency in starting
Since
2.1

RecordL()

voidRecordL()[pure virtual]
Starts recording audio and video
Since
2.1

ResumeL()

voidResumeL()[pure virtual]
Resumes recording from Pause
Since
2.1

SetAudioBitRateL(TInt)

voidSetAudioBitRateL(TIntaBitRate)[pure virtual]
Set bitrate for audio codec. If we use AMR-NB, the given bitrate is interpreted proprietarily: bitrates that are not exactly AMR bitrates mean that voice activity detection is used and the actual AMR bitrate is the given bitrate rounded upwards to the next AMR bitrate. E.g. aBitRate = 5500 means the AMR bit-rate is 5900 and VAD is enabled
Since
2.1

Parameters

TInt aBitRateNew bitrate

SetAudioCodecL(const TFourCC &)

voidSetAudioCodecL(const TFourCC &aAudioType)[pure virtual]
Set audio codec to be used (overrides the one given in OpenL)
Since
2.1

Parameters

const TFourCC & aAudioTypeAudio codec as FourCC

SetAudioEnabledL(TBool)

voidSetAudioEnabledL(TBoolaEnabled)[pure virtual]
Toggles audio recording on/off NOTE: This cannot be used during recording!
Since
2.1

Parameters

TBool aEnabledIf ETrue, audio will be recorded

SetAudioPriorityL(const TMMFPrioritySettings &)

voidSetAudioPriorityL(const TMMFPrioritySettings &aPrioritySettings)[pure virtual]
Set audio priority settings
Since
2.1

Parameters

const TMMFPrioritySettings & aPrioritySettingsaudio priority settings

SetGainL(TInt)

voidSetGainL(TIntaGain)[pure virtual]
Set new audio recording input gain
Since
2.1

Parameters

TInt aGainNew gain

SetMaxTotalBitRateL(TInt)

voidSetMaxTotalBitRateL(TIntaBitRate)[pure virtual]
Set new maximum total (audio+video) bitrate
Since
2.1

Parameters

TInt aBitRateNew bitrate

SetPreferredVideoEncapsulationL(TVideoDataUnitEncapsulation)

voidSetPreferredVideoEncapsulationL(TVideoDataUnitEncapsulationaCapsulation)[pure virtual]

Set video encoder output format encapsulation for H.264 / AVC. Usage optional. This overrides Media Recorder internal default preferences for TVideoDataUnitEncapsulation if used encoder supports multiple encapsulations.

Default for H.264 / AVC is: EDuGenericPayload

Since
3.2.3

Parameters

TVideoDataUnitEncapsulation aCapsulation"Encapsulation for coded video data units."

SetPreferredVideoEncoderL(TUid &)

voidSetPreferredVideoEncoderL(TUid &aEncoder)[pure virtual]

Set video encoder using its UID. Usage optional. This overrides Media Recorder internal search for encoder based on set video mime type ( SetVideoCodecL() ).

Since
3.2.3

Parameters

TUid & aEncoder"Video encoder UID."

SetSegmentTargetSizeL(TUint, TUint, TUint)

voidSetSegmentTargetSizeL(TUintaLayer,
TUintaSizeBytes,
TUintaSizeMacroblocks
)[pure virtual]
Set video encoder target segment size. Usage optional. Exposes CMMFDevVideoRecord::SetSegmentTargetSize (devvideorecord.h) to MediaRecorder clients. Typically used in video sharing use case instead of local video recording.
Since
5.2

Parameters

TUint aLayer"Layer number. Layers are numbered [0 n-1], where n is the number of layers available. Use zero if layered bit-rate scalability is not used."
TUint aSizeBytes"Segment target size in bytes. Set to zero to use unlimited segment size. The segment size in bytes should include all data that is typically stored or transmitted for each segment in the format currently in use. This includes all related headers." @param "aSizeMacroblocks" "Segment target size in number of macroblocks per segment. Set to zero to use unlimited segment size."
TUint aSizeMacroblocks

SetVideoBitRateL(TInt)

voidSetVideoBitRateL(TIntaBitRate)[pure virtual]
Set new target video bitrate. Possible to change also when recording.
Since
2.1

Parameters

TInt aBitRateTarget bitrate in bps, or KMMFVariableVideoBitRate

SetVideoCodecL(const TDesC8 &)

voidSetVideoCodecL(const TDesC8 &aVideoMimeType)[pure virtual]
Set video codec to be used (overrides the one given in OpenL)
Since
2.1

Parameters

const TDesC8 & aVideoMimeTypevideo mime type

SetVideoCodingOptionsL(const TCCMRVideoCodingOptions &)

voidSetVideoCodingOptionsL(const TCCMRVideoCodingOptions &aOptions)[pure virtual]
Set misc video coding options
Since
2.1

Parameters

const TCCMRVideoCodingOptions & aOptionsvideo coding options

SetVideoFrameRateL(TReal32)

voidSetVideoFrameRateL(TReal32aFrameRate)[pure virtual]
Set new video frame rate (encoding and capturing). Possible to change also when recording but then affects only to encoding rate and cannot increase higher than capturing rate set in the initialization.
Since
2.1

Parameters

TReal32 aFrameRateNew frame rate

SetVideoFrameSizeL(const TSize &)

voidSetVideoFrameSizeL(const TSize &aSize)[pure virtual]
Set new video frame size. Possible only when not recording
Since
2.1

Parameters

const TSize & aSizeNew size

SetVideoRateControlOptionsL(const TRateControlOptions &)

voidSetVideoRateControlOptionsL(const TRateControlOptions &aOptions)[pure virtual]

Sets the video bitrate control options for a whole bitstream. This method can only be called after the media recorder has been prepared or during recording.

Since
3.2

Parameters

const TRateControlOptions & aOptions"Bitrate control options."

State()

TRecorderState State()[pure virtual]
Returns the current state of the recorder
Since
2.1

StopL()

voidStopL()[pure virtual]
Stops recording audio and video
Since
2.1

VideoBitRateL()

TInt VideoBitRateL()[pure virtual]
Get current target video bitrate
Since
2.1

VideoFrameRateL()

TReal32 VideoFrameRateL()[pure virtual]
Get current video frame rate
Since
2.1

Member Enumerations Documentation

Enum TRecorderState

Enumerators

EStateNone = 0
EStateOpen
EStatePreparing
EStateReadyToRecord
EStateRecording
EStatePaused
EStateStopping
EStatePausing