Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



Location: MmfAudioOutput.h
Link against: mmfaudiooutput.lib

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

Class CMMFAudioOutput

class CMMFAudioOutput : public CBase, public MMMFAudioOutput, public MDevSoundObserver;

Description

The interface into DevSound.

Abstract data sink class providing an interface into hardware sound output.

Uses CMMFDevSound to access such output.

Derivation

Members

Defined in CMMFAudioOutput:
BufferFilledL(), BufferToBeEmptied(), BufferToBeFilled(), BytesPlayed(), CanCreateSinkBuffer(), ConstructSinkL(), ConvertError(), CreateSinkBufferL(), DataType(), DeviceMessage(), EmptyBufferL(), HWEmptyBufferL(), InitializeComplete(), NegotiateL(), PlayError(), RecordError(), SendEventToClient(), SetDataTypeL(), SetSinkDataTypeCode(), SetSinkPrioritySettings(), SinkDataTypeCode(), SinkPauseL(), SinkPlayL(), SinkPrimeL(), SinkStopL(), SinkThreadLogoff(), SinkThreadLogon(), SoundDevice(), ToneFinished(), ~CMMFAudioOutput()

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

Inherited from MDataSink:
DataSinkType(), NewSinkL(), SinkCustomCommand()

Inherited from MMMFAudioOutput:
NewAudioOutputL()


Construction and destruction


~CMMFAudioOutput()

virtual ~CMMFAudioOutput();

Description

Standard SymbianOS destructor.

[Top]


Member functions


SinkDataTypeCode()

virtual TFourCC SinkDataTypeCode(TMediaId aMediaId);

Description

Gets the sink's data type code.

Used by datapath MDataSource / MDataSink for codec matching.

Parameters

TMediaId aMediaId

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

Return value

TFourCC

The 4CC of the data expected by this sink.


EmptyBufferL()

virtual void EmptyBufferL(CMMFBuffer *aBuffer, MDataSource *aSupplier, TMediaId aMediaId);

Description

Sends audio to MMFDevsound.

Parameters

CMMFBuffer *aBuffer

The data to write out.

MDataSource *aSupplier

The search criteria for the supplier.

TMediaId aMediaId

The type of data supplied - currently ignored.


BufferFilledL()

virtual void BufferFilledL(CMMFBuffer *aBuffer);

Description

Called by MDataSource to pass back a full buffer to the sink.

Should never be called by a sink, as sinks empty buffers, not fill them.

Parameters

CMMFBuffer *aBuffer

The filled buffer.


CanCreateSinkBuffer()

virtual TBool CanCreateSinkBuffer();

Description

Tests whether a sink buffer can be created.

The default implementation returns true.

Return value

TBool

A boolean indicating if the sink buffer can be created. ETrue if it can, otherwise EFalse.


CreateSinkBufferL()

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

Description

Creates a sink buffer.

Intended for asynchronous usage (buffers supplied by Devsound device)

Parameters

TMediaId aMediaId

The Media ID.

TBool &aReference

A boolean indicating if MDataSink owns the buffer. ETrue if does, otherwise EFalse.

Return value

CMMFBuffer *

A sink buffer.


SinkThreadLogon()

virtual TInt SinkThreadLogon(MAsyncEventHandler &aEventHandler);

Description

Logs on the sink's 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.


SinkThreadLogoff()

virtual void SinkThreadLogoff();

Description

Logs off the sink thread.

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


SinkPrimeL()

virtual void SinkPrimeL();

Description

Prime's the sink.

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

Called by CMMFDataPath::PrimeL().


SinkPauseL()

virtual void SinkPauseL();

Description

Pauses the sink.

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


SinkPlayL()

virtual void SinkPlayL();

Description

Starts playing the sink.

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


SinkStopL()

virtual void SinkStopL();

Description

Stops the sink.

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


SetSinkPrioritySettings()

virtual void SetSinkPrioritySettings(const TMMFPrioritySettings &aPrioritySettings);

Description

Sets the sink's priority settings.

Parameters

const TMMFPrioritySettings &aPrioritySettings

The sink's priority settings. Takes enumerations to determine audio playback priority. Higher numbers mean high priority (can interrupt lower priorities).


NegotiateL()

virtual void NegotiateL(MDataSource &aSource);

Description

Negotiates with the source to set, for example, the sample rate and number of channels.

Called if the sink's setup depends on source.

Parameters

MDataSource &aSource

The data source with which to negotiate.


BytesPlayed()

virtual TInt BytesPlayed();

Description

Returns 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.


HWEmptyBufferL()

virtual void HWEmptyBufferL(CMMFBuffer *aBuffer, MDataSource *aSupplier);

Description

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

Parameters

CMMFBuffer *aBuffer

The data to write out to a Hardware Device.

MDataSource *aSupplier

The MDataSource consuming the data contained in aBuffer


SoundDevice()

virtual CMMFDevSound &SoundDevice();

Description

Returns the sound device.

Accessor function exposing public CMMFDevsound methods.

Return value

CMMFDevSound &

A reference to a CMMFDevSound objector.


SetSinkDataTypeCode()

virtual TInt SetSinkDataTypeCode(TFourCC aSinkFourCC, TMediaId aMediaId);

Description

Sets the sink's data type code.

Parameters

TFourCC aSinkFourCC

The 4CC of the data to be supplied to this sink.

TMediaId aMediaId

The Media ID. 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.


ConstructSinkL()

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

Description

Overridable constuction specific to this datasource.

The default implementation does nothing.

Parameters

const TDesC8 &aInitData

The initialisation data.


InitializeComplete()

private: virtual void InitializeComplete(TInt aError);

Description

InitializeComplete MMFDevSoundObserver called when devsound initialisation completed.

Parameters

TInt aError


ToneFinished()

private: virtual void ToneFinished(TInt aError);

Description

ToneFinished MMFDevSoundObserver called when a tone has finished or interrupted

Should never get called.

Parameters

TInt aError


BufferToBeFilled()

private: virtual void BufferToBeFilled(CMMFBuffer *aBuffer);

Description

BufferToBeFilled MMFDevSoundObserver. Called when buffer used up.

Parameters

CMMFBuffer *aBuffer


PlayError()

private: virtual void PlayError(TInt aError);

Description

PlayError MMFDevSoundObserver.

Called when stopped due to error or EOF.

Parameters

TInt aError


BufferToBeEmptied()

private: virtual void BufferToBeEmptied(CMMFBuffer *aBuffer);

Description

BufferToBeEmptied MMFDevSoundObserver - should never get called.

Parameters

CMMFBuffer *aBuffer


RecordError()

private: virtual void RecordError(TInt aError);

Description

RecordError MMFDevSoundObserver called when recording has halted.

Should never get called.

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

DeviceMessage MMFDevSoundObserver

Parameters

TUid aMessageType

const TDesC8 &aMsg


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