Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



Location: mmfurl.h
Link against: mmfstdsourceandsinkplugin.lib

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

Class CMMFUrlSource

class CMMFUrlSource : public CBase, public MDataSource;

Description

Concrete implementation of a URL data source.

This class is used only to pass information regarding the URL and IAP into the controller plugin. IT CANNOT BE USED TO READ DATA FROM A URL. Each of the MDataSource APIs are implemented as either returning or leaving with KErrNotSupported as appropriate.

The configuration data for this class is an externalized CMMFUrlParams object.

Derivation

Members

Defined in CMMFUrlSource:
BufferEmptiedL(), CanCreateSourceBuffer(), ConstructSourceL(), CreateSourceBufferL(), CreateSourceBufferL(), FillBufferL(), IAPId(), NegotiateSourceL(), SetSourceDataTypeCode(), SetSourcePrioritySettings(), SourceCustomCommand(), SourceDataTypeCode(), SourcePauseL(), SourcePlayL(), SourcePrimeL(), SourceSampleConvert(), SourceStopL(), SourceThreadLogoff(), SourceThreadLogon(), Url(), UseIAPId(), ~CMMFUrlSource()

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

Inherited from MDataSource:
DataSourceType(), NewSourceL()

See also:


Construction and destruction


~CMMFUrlSource()

virtual ~CMMFUrlSource();

Description

Destructor.

[Top]


Member functions


Url()

inline const TDesC &Url() const;

Description

Returns the URL string.

For example:

    http://www.symbian.com/clip/mpg

Return value

const TDesC &

The URL string.


UseIAPId()

inline TBool UseIAPId() const;

Description

Indicates whether the IAP ID should be used.

Return value

TBool

A boolean indicating if the supplied IAPId should be used. ETrue if the supplied IAPId should be used. EFalse if the default IAPId should be used.


IAPId()

inline TInt IAPId() const;

Description

Returns the Internet Access Point ID.

Return value

TInt

The IAP ID.


SourceDataTypeCode()

virtual TFourCC SourceDataTypeCode(TMediaId aMediaId);

Description

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

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

Parameters

TMediaId aMediaId

This 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

TFourCC

The fourCC code identifying the source datatype for the specified aMediaId.


SetSourceDataTypeCode()

virtual TInt SetSourceDataTypeCode(TFourCC, TMediaId);

Description

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

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

Parameters

TFourCC

TMediaId

Return value

TInt

KErrNone if successful, KErrNotSupported if the source does not support having it's data type set, otherwise a system wide error code.


FillBufferL()

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

Description

Function called by a MDataSink to request the data source to fill aBuffer with data.

This is a pure virtual function that each derived class must implement. This method is used when a data source is passively waiting for requests from a consumer ie. a data sink to fill a buffer. The data source must call the BufferFilledL member on aConsumer when it has filled the buffer with data. The data source can either make this callback synchronously or asynchronously.

The format should read the frame number of the buffer via the buffer's CMMFBuffer::FrameNumber() function. From this, the format should be able to determine the actual position of the data on the data source. The technique here depends on the nature of the format. For a linear audio format, the position can be obtained by a simple calculation of the frame size, the header size and where appropriate the datatype.

For non-linear formats, either an index table of frame number and location will need to be created in the NewL() or some form of approximating algorithm will be required. Some formats have an index table as part of the format eg. AVI. If no random access is required then no index table is required, the format can keep track of the current read position and increment it on each access, and reset it if the frame number is reset to 0 or 1. Given that for non-linear ie. variable bit rate formats, the size of the data read may vary from frame to frame, then the format should either set the request size of the buffer for the required frame or call the source's ReadBufferL() (either CMMFClip::ReadBufferL(), CMMFDescriptor ::ReadBufferL() or CMMFFile::ReadBufferL()) function that takes the aLength parameter.

It is the responsibility of the format decode to determine the size and position of the source data for each frame. For linear audio formats, the format decode should fill the buffer up to its maximum length. For multimedia formats e.g. mp4, AVI etc, the format decode is effectively acting as a demultiplexor, and must obtain the appropriate data from the source depending on the aMediaId.

Parameters

CMMFBuffer *aBuffer

The buffer that needs filling with data.

MDataSink *aConsumer

The data sink that consumes the data. The data source needs this to make the BufferFilledL callback on aConsumer when the data source has completed filling the aBuffer.

TMediaId


BufferEmptiedL()

virtual void BufferEmptiedL(CMMFBuffer *aBuffer);

Description

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

This is a pure virtual function that each derived class must implement. This method is used as the callback when the data source actively requests a consumer ie. a data sink to empty a buffer by calling the data sinks EmptyBufferL. When the data source gets this callback it knows that the buffer has been emptied and can be reused.

Parameters

CMMFBuffer *aBuffer

The buffer that has been emptied by a data sink and is now available for reuse.


CanCreateSourceBuffer()

virtual TBool CanCreateSourceBuffer();

Description

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

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

Return value

TBool

A boolean indicating if the data source can create a buffer. ETrue if it can otherwise EFalse.


CreateSourceBufferL()

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

Description

Returns a buffer created by the data source

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

Parameters

TMediaId

TBool &aReference

This 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 source and should be used in preference to the sink buffer provided the sink buffer is also not a reference buffer.

Return value

CMMFBuffer *

A pointer to the created buffer.


CreateSourceBufferL()

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

Description

Returns a buffer created by the data source.

This is a virtual function that a derived class can implement. This can be used in preference to the above CreateSourceBufferL method in cases where the source buffer creation has a dependancy on the sink buffer.

Parameters

TMediaId aMediaId

This 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 strams of data eg a multimedia file

CMMFBuffer &

TBool &aReference

This 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 source and should be used in preference to the sink buffer provided the sink buffer is not a reference buffer.

Return value

CMMFBuffer *

A pointer to the created buffer.


SourceThreadLogon()

virtual TInt SourceThreadLogon(MAsyncEventHandler &);

Description

Function to 'logon' the data source to the same thread that source will be supplying data in.

This method may be required as the thread that the data source 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 SourceThreadLogon rather than in the creation of the data source.

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

Parameters

MAsyncEventHandler &

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

Function to 'logoff' the data source from the same thread that source supplies data in.

This method may be required as the thread that the data source 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 SourceThreadLogoff rather than in the destructor.

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


NegotiateSourceL()

virtual void NegotiateSourceL(MDataSink &);

Description

Function to allow the data source to negotiate with a data sink

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

Parameters

MDataSink &


SourceSampleConvert()

virtual TBool SourceSampleConvert();

Description

Indicates whether the data source supports sample rate conversion.

This is a virtual function that a derived class can implement.

Return value

TBool

A boolean indicating if the data source can perform a sample rate conversion. ETrue if it can otherwise EFalse.


SourcePrimeL()

virtual void SourcePrimeL();

Description

Function to 'prime' the data source.

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


SourcePlayL()

virtual void SourcePlayL();

Description

Function to 'play' the data source.

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


SourcePauseL()

virtual void SourcePauseL();

Description

Function to 'pause' the data source.

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


SourceStopL()

virtual void SourceStopL();

Description

Function to 'stop' the data source.

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


SetSourcePrioritySettings()

Capability: MultimediaDD A process requesting or using this method that has MultimediaDD capability will always have precedence over a process that does not have MultimediaDD.

virtual void SetSourcePrioritySettings(const TMMFPrioritySettings &);

Description

Function to set the source priority settings.

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

Parameters

const TMMFPrioritySettings &


SourceCustomCommand()

virtual void SourceCustomCommand(TMMFMessage &aMessage);

Description

Function to call a source specific custom command.

This is a virtual function that a derrived data source can implement if it implements any custom commands.

Parameters

TMMFMessage &aMessage

The message specifying the custom command.


ConstructSourceL()

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

Description

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

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

Parameters

const TDesC8 &aInitData

The source specific initialisation data required for source construction.