CMMFAudioOutput Class Reference

#include <mmf/server/mmfaudiooutput.h>

class CMMFAudioOutput : public CBase, public MMMFAudioOutput, public MDevSoundObserver, public CBase, public MMMFAudioOutput, public MDevSoundObserver
Public Member Functions
virtual ~CMMFAudioOutput()
virtual voidBufferFilledL(CMMFBuffer *)
virtual TInt BytesPlayed()
virtual TBool CanCreateSinkBuffer()
voidConstructL()
virtual CMMFBuffer *CreateSinkBufferL(TMediaId, TBool &)
virtual TFourCC DataType()
virtual voidEmptyBufferL(CMMFBuffer *, MDataSource *, TMediaId)
virtual voidHWEmptyBufferL(CMMFBuffer *, MDataSource *)
virtual TBool IsResumeSupported()
virtual voidNegotiateL(MDataSource &)
MDataSink *NewSinkL()
virtual voidSetDataTypeL(TFourCC)
virtual TInt SetSinkDataTypeCode(TFourCC, TMediaId)
virtual voidSetSinkPrioritySettings(const TMMFPrioritySettings &)
virtual TFourCC SinkDataTypeCode(TMediaId)
virtual voidSinkPauseL()
virtual voidSinkPlayL()
virtual voidSinkPrimeL()
virtual voidSinkStopL()
virtual voidSinkThreadLogoff()
virtual TInt SinkThreadLogon(MAsyncEventHandler &)
virtual CMMFDevSound &SoundDevice()
Protected Member Functions
virtual voidConstructSinkL(const TDesC8 &)
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()
MDataSink::DataSinkType()const
MDataSink::MDataSink(TUid)
MDataSink::NewSinkL(TUid,const TDesC8 &)
MDataSink::NewSinkLC(TUid,const TDesC8 &)
MDataSink::SinkCustomCommand(TMMFMessage &)
MDataSink::~MDataSink()
MMMFAudioOutput::MMMFAudioOutput()
MMMFAudioOutput::NewAudioOutputL(TUid,const TDesC8 &)

Constructor & Destructor Documentation

~CMMFAudioOutput ( )

~CMMFAudioOutput()[virtual]

Member Function Documentation

BufferFilledL ( CMMFBuffer * )

voidBufferFilledL(CMMFBuffer *aBuffer)[virtual]

Function called by a data source to pass back a filled buffer to the sink.

This is a pure virtual function that each derived class must implement. This method is used as the callback when the data sink actively requests a supplier ie. a data source to fill a buffer by calling the data sources FillBufferL. When the data sink gets this callback it knows that the buffer has been filled and is ready to be emptied.

Parameters
aBufferThe buffer that has been filled by a data source and is now available for processing.

BytesPlayed ( )

TInt BytesPlayed()[virtual]

Returns the number of bytes played.

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

CanCreateSinkBuffer ( )

TBool CanCreateSinkBuffer()[virtual]

Deprecated

Function to indicate whether the data sink can create a buffer.

This is a pure virtual function that each derived class must implement.

Return Value
A boolean indicating if the data sink can create a buffer. ETrue if it can otherwise EFalse.

ConstructL ( )

voidConstructL()

ConstructSinkL ( const TDesC8 & )

voidConstructSinkL(const TDesC8 &aInitData)[protected, virtual]

Performs any sink construction dependant on the sink construction initialisation data aInitData.

This is a pure virtual function that a derrived data sink must implement

Parameters
aInitDataThe sink specific initialisation data required for sink construction.

CreateSinkBufferL ( TMediaId, TBool & )

CMMFBuffer *CreateSinkBufferL(TMediaIdaMediaId,
TBool &aReference
)[virtual]

Returns a buffer created by the data sink.

This is a pure virtual function that each derived class must implement.

Parameters
aMediaIdThis identifies the type of media eg. audio or video and the stream ID. This parameter is required in cases where the source can supply data of more than one media type and/or multiple streams of data.
aReferenceThis must be written to by the method to indicate whether the created buffer is a 'reference' buffer. A 'reference' buffer is a buffer that is owned by the sink and should be used in preference to the source buffer provided the source buffer is also not a reference buffer.
Return Value
The created buffer.

DataType ( )

TFourCC DataType()const [virtual]

EmptyBufferL ( CMMFBuffer *, MDataSource *, TMediaId )

voidEmptyBufferL(CMMFBuffer *aBuffer,
MDataSource *aSupplier,
TMediaIdaMediaId
)[virtual]

Method called by a MDataSource to request the data sink to empty aBuffer of data.

This is a pure virtual function that each derived class must implement. This method is used when a data sink is passively waiting for requests from a supplier ie. a data source to empty a buffer. The data sink must call the BufferEmptiedL member on aSupplier when it has emptied the buffer of it's data. The data sink can either make this callback synchronously or asynchronously.

Parameters
aBufferThe full buffer that needs emptying of it's data.
aSupplierThe data source that supplied the data. The data sink needs this to make the BufferEmptiedL callback on aSupplier to indicate to the data source that the data sink has finished with the buffer.
aMediaIdThis identifies the type of media eg. audio or video and the stream ID. This parameter is required in cases where the source can supply data of more than one media type and/or multiple streams of data.

HWEmptyBufferL ( CMMFBuffer *, MDataSource * )

voidHWEmptyBufferL(CMMFBuffer *aBuffer,
MDataSource *aSupplier
)[virtual]

Deprecated

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

Parameters
aBufferThe data to read in from a Hardware Device
aSupplierThe MDataSink consuming the data contained in aBuffer.

IsResumeSupported ( )

TBool IsResumeSupported()[virtual]

NegotiateL ( MDataSource & )

voidNegotiateL(MDataSource &aDataSource)[virtual]

Deprecated

Allows the data sink to negotiate with a data source.

This method is required in cases where the settings of data sink are dependant on those of a data source. This is a virtual function that a derrived data sink can implement.

Parameters
aDataSourceThe data source whose settings can affect the data sink.

NewSinkL ( )

MDataSink *NewSinkL()[static]

SetDataTypeL ( TFourCC )

voidSetDataTypeL(TFourCCaAudioType)[virtual]

SetSinkDataTypeCode ( TFourCC, TMediaId )

TInt SetSinkDataTypeCode(TFourCCaSinkFourCC,
TMediaIdaMediaId
)[virtual]

Sets the data type as a fourCC code for the data sink.

This is a virtual function that each derived class can implement if the data sink supports the ability to have its data type set.

Parameters
aSinkFourCCThis specifies the data type as a fourCC code to set the sink to.
aMediaIdThis identifies the type of media eg. audio or video and the stream ID. This parameter is required in cases where the source can supply data of more than one media type and/or multiple streams of data.
Return Value
KErrNone if successful, KErrNotSupported if the sink does not support having it's data type set, otherwise a system wide error code.

SetSinkPrioritySettings ( const TMMFPrioritySettings & )

voidSetSinkPrioritySettings(const TMMFPrioritySettings &aPrioritySettings)[virtual]

Sets the sink priority settings.

This is a virtual function that a derrived data sink can implement if a priority mechanism is required to arbitrate between multiple clients trying to access the same resource.

Parameters
aPrioritySettingsThe sink priority settings.

SinkDataTypeCode ( TMediaId )

TFourCC SinkDataTypeCode(TMediaIdaMediaId)[virtual]

Returns the data type as a fourCC code of the data sink.

This is a pure virtual function that each derrived class must implement.

Parameters
aMediaIdThis identifies the type of media eg. audio or video and the stream ID. This parameter is required in cases where the sink can accept data of more than one media type and/or multiple streams of data.
Return Value
The fourCC code identifying the sink datatype for the specified aMediaId.

SinkPauseL ( )

voidSinkPauseL()[virtual]

Reimplemented from MDataSink::SinkPauseL()

Function to 'pause' the data sink.

This is a virtual function that a derrived data sink can implement if any data sink specific action is required to 'pause'.

SinkPlayL ( )

voidSinkPlayL()[virtual]

Reimplemented from MDataSink::SinkPlayL()

Function 'play' the data sink.

This is a virtual function that a derrived data sink can implement if any data sink specific action is required prior to 'playing' ie. the start of data transfer.

SinkPrimeL ( )

voidSinkPrimeL()[virtual]

Reimplemented from MDataSink::SinkPrimeL()

Function to 'prime' the data sink.

This is a virtual function that a derrived data sink can implement if any data sink specific 'priming' is required.

SinkStopL ( )

voidSinkStopL()[virtual]

Reimplemented from MDataSink::SinkStopL()

Function to 'stop' the data sink.

This is a virtual function that a derrived data sink can implement if any data sink specific action is required to 'stop'

SinkThreadLogoff ( )

voidSinkThreadLogoff()[virtual]

Function to 'logoff' the data sink from the same thread that sink consumes data in.

This method may be required as the thread that the data sink is deleted in may not be the same thread that the data transfer took place in. Therefore any thread specific releasing of resources needs to be performed in the SinkThreadLogoff rather than in the destructor.

This is a virtual function that a derrived data sink can implement if any thread specific releasing of resources is required.

SinkThreadLogon ( MAsyncEventHandler & )

TInt SinkThreadLogon(MAsyncEventHandler &aEventHandler)[virtual]

Function to 'logon' the data sink to the same thread that sink will be consuming data in.

This method may be required as the thread that the data sink was created in is not always the same thread that the data transfer will take place in. Therefore any thread specific initialisation needs to be performed in the SinkThreadLogon rather than in the creation of the data sink.

This is a virtual function that a derrived data sink can implement if any thread specific initialisation is required and/or the data sink can create any asynchronous events.

Parameters
aEventHandlerThis is an MAsyncEventHandler to handle asynchronous events that occur during the transfer of multimedia data. The event handler must be in the same thread as the data transfer thread - hence the reason it is passed in the SinkThreadLogon as opposed to say the constructor.
Return Value
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

SoundDevice ( )

CMMFDevSound &SoundDevice()[virtual]

Returns the sound device.

Accessor function exposing public CMMFDevsound methods.

Return Value
A reference to a CMMFDevSound objector.