Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: MmfAudioInput.h
Link against: mmfaudioinput.lib

This item is not part of the S60 3rd Edition SDK for Symbian OS, Feature Pack 2.

Class CMMFAudioInput

class CMMFAudioInput : public CBase, public MMMFAudioInput, public MDevSoundObserver;

Description

Concrete data source to provide microphone support.

Intended to be used by controller plugin developers for source plugins. Uses CMMFDevSound to access hardware.

Derivation

Members

Defined in CMMFAudioInput:
BufferEmptiedL(), BufferToBeEmptied(), BufferToBeFilled(), BytesPlayed(), CanCreateSourceBuffer(), ConstructSourceL(), ConvertError(), CreateSourceBufferL(), CreateSourceBufferL(), CreateSourceBufferL(), CreateSourceBufferL(), DataType(), DeviceMessage(), FillBufferL(), HWFillBufferL(), InitializeComplete(), NegotiateSourceL(), PlayError(), RecordError(), SendEventToClient(), SetDataTypeL(), SetSourceDataTypeCode(), SetSourcePrioritySettings(), SoundDevice(), SourceDataTypeCode(), SourcePauseL(), SourcePlayL(), SourcePrimeL(), SourceStopL(), SourceThreadLogoff(), SourceThreadLogon(), ToneFinished(), iBufferStatus, ~CMMFAudioInput()

Inherited from CBase:
Delete(), Extension_(), operator new()

Inherited from MDataSource:
DataSourceType(), NewSourceL(), SourceCustomCommand(), SourceSampleConvert()

Inherited from MMMFAudioInput:
NewAudioInputL()


Construction and destruction


~CMMFAudioInput()

virtual ~CMMFAudioInput();

Description

Standard SymbianOS destructor.

[Top]


Member functions


SourceDataTypeCode()

virtual TFourCC SourceDataTypeCode(TMediaId aMediaId);

Description

Gets the data type code for the source specified by the media ID.

Parameters

TMediaId aMediaId

An optional parameter to specifiy a specific stream when the datasource contains more than one stream of data.

Return value

TFourCC

The 4CC of the data supplied by this source.


FillBufferL()

virtual void FillBufferL(CMMFBuffer *aBuffer, MDataSink *aConsumer, TMediaId aMediaId);

Pre-Condition

iMMFDevSound must be loaded.

Description

Gets audio from MMFDevsound.

Parameters

CMMFBuffer *aBuffer

The data to read in from a Devsound device.

MDataSink *aConsumer

The MDataSink consuming the data contained in aBuffer.

TMediaId aMediaId

Type of data supplied - currently ignored.


BufferEmptiedL()

virtual void BufferEmptiedL(CMMFBuffer *aBuffer);

Description

Indicates the data sink has emptied the buffer.

Called by the data path's MDataSink when it has emptied the buffer.

The default implementation is empty.

Parameters

CMMFBuffer *aBuffer

The data buffer that has been emptied (not used).


CanCreateSourceBuffer()

virtual TBool CanCreateSourceBuffer();

Description

Tests whether a source buffer can be created.

The default imlpementation returns true.

Return value

TBool

A boolean indicating if the buffer can be made. ETrue if the buffer can be created, false otherwise.


CreateSourceBufferL()

virtual CMMFBuffer *CreateSourceBufferL(TMediaId aMediaId);

Description

Creates a source buffer.

Intended for synchronous usage.

Parameters

TMediaId aMediaId

The Media ID. Not used in the default implementation.

Return value

CMMFBuffer *

The buffer created


CreateSourceBufferL()

inline virtual CMMFBuffer *CreateSourceBufferL(TMediaId aMediaId, CMMFBuffer &aSinkBuffer);

Description

Intended for synchronous usage (returns buffer specific to a Media Type).

Parameters

TMediaId aMediaId

The Media ID.

CMMFBuffer &aSinkBuffer

Not Used.

Return value

CMMFBuffer *

A pointer to the CMMFBuffer source buffer.


CreateSourceBufferL()

virtual CMMFBuffer *CreateSourceBufferL(TMediaId aMediaId, TBool &aReference);

Description

Creates a source buffer.

Intended for asynchronous usage (buffers supplied by Devsound device)

Parameters

TMediaId aMediaId

The Media ID. Not used in the default implementation.

TBool &aReference

A boolean indicating if MDataSource owns the buffer. ETrue if it does, EFalse if it does not.

Return value

CMMFBuffer *

The buffer created (this will always be NULL when asychronous).


CreateSourceBufferL()

inline virtual CMMFBuffer *CreateSourceBufferL(TMediaId aMediaId, CMMFBuffer &aSinkBuffer, TBool &aReference);

Description

Creates a source buffer.

Intended for asynchronous usage (returns buffer specific to a Media Type).

Parameters

TMediaId aMediaId

The Media ID.

CMMFBuffer &aSinkBuffer

Not used.

TBool &aReference

A boolean indicating if MDataSource owns the buffer. If EFalse the the caller owns the buffer.

Return value

CMMFBuffer *

The source buffer.


SourceThreadLogon()

virtual TInt SourceThreadLogon(MAsyncEventHandler &aEventHandler);

Description

Logs on the source thread.

Thread specific initialization procedure for this device. Runs automatically on thread construction.

Parameters

MAsyncEventHandler &aEventHandler

The event handler.

Return value

TInt

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.


SourceThreadLogoff()

virtual void SourceThreadLogoff();

Description

Logs off the source thread.

Thread specific destruction procedure for this device. Runs automatically on thread destruction.


SourcePrimeL()

virtual void SourcePrimeL();

Description

Primes the source.

This is a virtual function that each derived class must implement, but may be left blank for default behaviour.

Overridable PrimeL method. Additional Prime method specific to this DataSource.


SourceStopL()

virtual void SourceStopL();

Description

Stops the source.

This is a virtual function that each derived class must implement, but may be left blank for default behaviour.

Overridable StopL method. Additional Stop method specific to this DataSource.


SourcePlayL()

virtual void SourcePlayL();

Description

Plays the source.

This is a virtual function that each derived class must implement, but may be left blank for default behaviour.

Overridable PlayL method. Additional Play method specific to this DataSource.


SourcePauseL()

virtual void SourcePauseL();

Description

Pauses the source.

This is a virtual function that each derived class must implement, but may be left blank for default behaviour.

Overridable PauseL method. Additional Pause method specific to this DataSource.


SetSourcePrioritySettings()

virtual void SetSourcePrioritySettings(const TMMFPrioritySettings &aPrioritySettings);

Description

Sets the source's priority settings.

Parameters

const TMMFPrioritySettings &aPrioritySettings

The source priority settings. Takes enumerations to determine audio record priority. Higher numbers mean high priority (can interrupt lower priorities).


NegotiateSourceL()

virtual void NegotiateSourceL(MDataSink &aSink);

Description

Negotiates with the sink.

Called if the source's setup depends on sink.

Parameters

MDataSink &aSink

The Data sink. Takes an MDataSink reference so a DataSource can negotiate with this MDataSource.


BytesPlayed()

virtual TInt BytesPlayed();

Description

Gets the number of bytes played.

Return value

TInt

The number of bytes played. If 16-bit divide this number returned by 2 to get word length.


HWFillBufferL()

virtual void HWFillBufferL(CMMFBuffer *aBuffer, MDataSink *aConsumer);

Description

Gets audio from hardware device abstracted MMFDevsound (not used).

Parameters

CMMFBuffer *aBuffer

The data to read in from a Hardware Device

MDataSink *aConsumer

The MDataSink consuming the data contained in aBuffer.


SoundDevice()

virtual CMMFDevSound &SoundDevice();

Pre-Condition

Dev Sound should be loaded.

Description

Returns the sound device.

Accessor function exposing public CMMFDevsound methods.

Return value

CMMFDevSound &

A reference to a CMMFDevSound objector.


SetSourceDataTypeCode()

virtual TInt SetSourceDataTypeCode(TFourCC aSourceFourCC, TMediaId aMediaId);

Description

Sets the data type code for the source.

Parameters

TFourCC aSourceFourCC

The 4CC of the data supplied by this source.

TMediaId aMediaId

The Media ID. An optional parameter to specifiy specific stream when datasource contains more than one stream of data.

Return value

TInt

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.


SetDataTypeL()

virtual void SetDataTypeL(TFourCC aAudioType);

Description

This method should not be used - it is provided to maintain SC with v7.0s.

Parameters

TFourCC aAudioType

The 4CC of the data supplied by this source.


DataType()

virtual TFourCC DataType() const;

Description

This method should not be used - it is provided to maintain SC with v7.0s.

Return value

TFourCC

The 4CC of the data supplied by this source.


ConstructSourceL()

protected: virtual void ConstructSourceL(const TDesC8 &aInitData);

Description

Overridable constuctor specific to this datasource.

Parameters

const TDesC8 &aInitData

The initialisation data.


InitializeComplete()

private: virtual void InitializeComplete(TInt aError);

Description

Handles initialization completion event.

A derived class must provide an implementation to handle the initialization request.

CMMFDevSound object calls this function when its InitializeL() function completes.

Parameters

TInt aError

Error code. KErrNone if successful. Other values are possible indicating a problem initializing CMMFDevSound object.


ToneFinished()

private: virtual void ToneFinished(TInt aError);

Description

ToneFinished MMFDevSoundObserver - should never get called.

Parameters

TInt aError


BufferToBeFilled()

private: virtual void BufferToBeFilled(CMMFBuffer *aBuffer);

Description

BufferToBeFilled MMFDevSoundObserver - should never get called.

Parameters

CMMFBuffer *aBuffer


PlayError()

private: virtual void PlayError(TInt aError);

Description

PlayError MMFDevSoundObserver - should never get called.

Parameters

TInt aError


BufferToBeEmptied()

private: virtual void BufferToBeEmptied(CMMFBuffer *aBuffer);

Description

BuffferToBeEmptied MMFDevSoundObserver Called when stopped due to error.

Parameters

CMMFBuffer *aBuffer


RecordError()

private: virtual void RecordError(TInt aError);

Description

RecordError MMFDevSoundObserver Called when stopped due to error.

Parameters

TInt aError


ConvertError()

private: virtual void ConvertError(TInt aError);

Description

ConvertError MMFDevSoundObserver - should never get called.

Parameters

TInt aError


DeviceMessage()

private: virtual void DeviceMessage(TUid aMessageType, const TDesC8 &aMsg);

Description

Handles device event.

A derived class must provide an implementtion to handle the messages from audio hardware device.

CMMFDevSound object calls this function when a message is received from the audio hardware device.

Parameters

TUid aMessageType

Defines the type of message. Used to determine how to interpret the contents of aMsg.

const TDesC8 &aMsg

Message that is packed in the Descriptor format.


SendEventToClient()

private: virtual void SendEventToClient(const TMMFEvent &);

Description

Handles policy request completion event.

A derived class must provide an implementation to handle the policy request completion event.

CMMFDevSound object calls this function when an attempt to acquire sound device is rejected by audio policy server.

Parameters

const TMMFEvent &

Not used

[Top]


Member data


iBufferStatus

TRequestStatus iBufferStatus;

Description

Buffer completion status.