Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <MmfAudioOutput.h>
Link against: mmfaudiooutput.lib
This item is not part of the S60 5th Edition SDK

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:

Inherited from CBase:

Inherited from MDataSink:

Inherited from MMMFAudioOutput:


Construction and destruction


~CMMFAudioOutput()

virtual ~CMMFAudioOutput();

Description

Standard SymbianOS destructor.

[Top]


Member functions


SinkDataTypeCode(TMediaId)

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(CMMFBuffer *,MDataSource *,TMediaId)

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(CMMFBuffer *)

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(TMediaId,TBool &)

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(MAsyncEventHandler &)

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(const TMMFPrioritySettings &)

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(MDataSource &)

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(CMMFBuffer *,MDataSource *)

Interface status: deprecated

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(TFourCC,TMediaId)

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(TFourCC)

Interface status: deprecated

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()const

Interface status: deprecated

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(const TDesC8 &)

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(TInt)

private: virtual void InitializeComplete(TInt aError);

Description

InitializeComplete MMFDevSoundObserver called when devsound initialisation completed.

Parameters

TInt aError


ToneFinished(TInt)

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(CMMFBuffer *)

private: virtual void BufferToBeFilled(CMMFBuffer *aBuffer);

Description

BufferToBeFilled MMFDevSoundObserver. Called when buffer used up.

Parameters

CMMFBuffer *aBuffer


PlayError(TInt)

private: virtual void PlayError(TInt aError);

Description

PlayError MMFDevSoundObserver.

Called when stopped due to error or EOF.

Parameters

TInt aError


BufferToBeEmptied(CMMFBuffer *)

private: virtual void BufferToBeEmptied(CMMFBuffer *aBuffer);

Description

BufferToBeEmptied MMFDevSoundObserver - should never get called.

Parameters

CMMFBuffer *aBuffer


RecordError(TInt)

private: virtual void RecordError(TInt aError);

Description

RecordError MMFDevSoundObserver called when recording has halted.

Should never get called.

Parameters

TInt aError


ConvertError(TInt)

private: virtual void ConvertError(TInt aError);

Description

ConvertError MMFDevSoundObserver.

Should never get called.

Parameters

TInt aError


DeviceMessage(TUid,const TDesC8 &)

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

Description

DeviceMessage MMFDevSoundObserver

Parameters

TUid aMessageType

const TDesC8 &aMsg


SendEventToClient(const TMMFEvent &)

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