#include <mmf/server/mmffile.h>
class CMMFFile : public CMMFClip |
Protected Member Enumerations | |
---|---|
enum | TMMFileMode { ESourceMode, ESinkMode } |
Protected Member Functions | |
---|---|
CMMFFile() | |
void | CancelRequests() |
void | ConstructL(const TDesC8 &, TMMFileMode) |
virtual void | ConstructSinkL(const TDesC8 &) |
virtual void | ConstructSourceL(const TDesC8 &) |
CTransferBufferCopy * | ObtainCopyOfTransferBufferL(TInt) |
void | StoreRequestL(CReadWriteRequest *) |
MultiMedia framework class. Represents a physical file.
This may be source file from which data is read or destination to which data is written.
Intended to be used by controller plugin developers for source and sink plugins.
Indicates for which purpose the object instance is being created
Enumerator | Value | Description |
---|---|---|
ESourceMode |
The object is created for being a source | |
ESinkMode |
The object is created for being a sink |
CMMFFile | ( | ) | [protected] |
~CMMFFile | ( | ) | [virtual] |
void | BufferEmptiedL | ( | CMMFBuffer * | aBuffer | ) | [virtual] |
Reimplemented from MDataSource::BufferEmptiedL(CMMFBuffer *)
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 | |
---|---|
aBuffer | The buffer that has been emptied by a data sink and is now available for reuse. |
void | BufferFilledL | ( | CMMFBuffer * | aBuffer | ) | [virtual] |
Reimplemented from MDataSink::BufferFilledL(CMMFBuffer *)
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 | |
---|---|
aBuffer | The buffer that has been filled by a data source and is now available for processing. |
TInt64 | BytesFree | ( | ) | [virtual] |
Reimplemented from CMMFClip::BytesFree()
Returns the amount of space available for the clip.
This is a virtual function that each derived class must implement.
TBool | CanCreateSinkBuffer | ( | ) | [virtual] |
Reimplemented from MDataSink::CanCreateSinkBuffer()
Deprecated
Function to indicate whether the data sink can create a buffer.
This is a pure virtual function that each derived class must implement.
TBool | CanCreateSourceBuffer | ( | ) | [virtual] |
Reimplemented from MDataSource::CanCreateSourceBuffer()
Deprecated
Function to indicate whether the data source can create a buffer.
This is a pure virtual function that each derived class must implement.
TBool | CanUseTransferBuffer | ( | ) |
void | CancelRequests | ( | ) | [protected] |
void | ConstructL | ( | const TDesC8 & | aInitData, |
TMMFileMode | aFileMode | |||
) | [protected] |
void | ConstructSinkL | ( | const TDesC8 & | aInitData | ) | [protected, virtual] |
Reimplemented from MDataSink::ConstructSinkL(const TDesC8 &)
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 | |
---|---|
aInitData | The sink specific initialisation data required for sink construction. |
void | ConstructSourceL | ( | const TDesC8 & | aInitData | ) | [protected, virtual] |
Reimplemented from MDataSource::ConstructSourceL(const TDesC8 &)
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 | |
---|---|
aInitData | The source specific initialisation data required for source construction. |
CMMFBuffer * | CreateSinkBufferL | ( | TMediaId | aMediaId, |
TBool & | aReference | |||
) | [virtual] |
Reimplemented from MDataSink::CreateSinkBufferL(TMediaId,TBool &)
Returns a buffer created by the data sink.
This is a pure virtual function that each derived class must implement.
Parameters | |
---|---|
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. |
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 sink and should be used in preference to the source buffer provided the source buffer is also not a reference buffer. |
CMMFBuffer * | CreateSourceBufferL | ( | TMediaId | aMediaId, |
TBool & | aReference | |||
) | [virtual] |
Reimplemented from MDataSource::CreateSourceBufferL(TMediaId,TBool &)
Deprecated
Returns a buffer created by the data source
This is a pure virtual function that each derived class must implement.
Parameters | |
---|---|
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. |
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. |
TInt | Data | ( | ContentAccess::CData *& | aData | ) | [virtual] |
TInt | Delete | ( | ) | [virtual] |
Reimplemented from CMMFClip::Delete()
Deletes the clip.
This should be overriden in the derived classes, the default version returns KErrNotSupported.
another of the system-wide error codes.
void | EmptyBufferL | ( | CMMFBuffer * | aBuffer, |
MDataSource * | aSupplier, | |||
TMediaId | aMediaId | |||
) | [virtual] |
Reimplemented from MDataSink::EmptyBufferL(CMMFBuffer *,MDataSource *,TMediaId)
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 | |
---|---|
aBuffer | The full buffer that needs emptying of it's data. |
aSupplier | The 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. |
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. |
TInt | EvaluateIntent | ( | ContentAccess::TIntent | aIntent | ) | const [virtual] |
TInt | ExecuteIntent | ( | ContentAccess::TIntent | aIntent | ) | [virtual] |
const TDesC & | Extension | ( | ) | const [virtual] |
const TDesC & | FileDrive | ( | ) | const [virtual] |
RFile & | FileL | ( | ) | [virtual] |
const TDesC & | FileName | ( | ) | const [virtual] |
const TDesC & | FilePath | ( | ) | const [virtual] |
void | FillBufferL | ( | CMMFBuffer * | aBuffer, |
MDataSink * | aConsumer, | |||
TMediaId | aMediaId | |||
) | [virtual] |
Reimplemented from MDataSource::FillBufferL(CMMFBuffer *,MDataSink *,TMediaId)
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 | |
---|---|
aBuffer | The buffer that needs filling with data. |
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. |
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. |
const TFileName | FullName | ( | ) | const [virtual] |
TBool | IsProtectedL | ( | ) | const [virtual] |
MDataSink * | NewSinkL | ( | ) | [static] |
MDataSource * | NewSourceL | ( | ) | [static] |
CTransferBufferCopy * | ObtainCopyOfTransferBufferL | ( | TInt | aMaxLength | ) | [protected] |
void | ReadBufferL | ( | TInt | aLength, |
CMMFBuffer * | aBuffer, | |||
TInt | aPosition, | |||
MDataSink * | aConsumer | |||
) | [virtual] |
Reimplemented from CMMFClip::ReadBufferL(TInt,CMMFBuffer *,TInt,MDataSink *)
Reads aLength number of bytes of data from the offset, aPosition into the buffer, aBuffer.
Intended for asynchronous usage.
This is a virtual function that each derived class must implement.
Parameters | |
---|---|
aLength | The number of bytes to read. |
aBuffer | The buffer to read the data into. |
aPosition | The offset from which to start reading. |
aConsumer | The sink of tha data read from the clip. Will be informed of read if not NULL. |
void | ReadBufferL | ( | CMMFBuffer * | aBuffer, |
TInt | aPosition, | |||
MDataSink * | aConsumer | |||
) | [virtual] |
Reimplemented from CMMFClip::ReadBufferL(CMMFBuffer *,TInt,MDataSink *)
Reads the maximum number of bytes of data from the offset, aPosition into the buffer, aBuffer.
Intended for asynchronous usage.
This is a virtual function that each derived class must implement.
Parameters | |
---|---|
aBuffer | The buffer to read the data into. |
aPosition | The offset from which to start reading. |
aConsumer | The sink of tha data read from the clip. Will be informed of read if not NULL. |
void | ReadBufferL | ( | CMMFBuffer * | aBuffer, |
TInt | aPosition | |||
) | [virtual] |
Reimplemented from CMMFClip::ReadBufferL(CMMFBuffer *,TInt)
Reads the maximum number of bytes of data from the offset, aPosition into the buffer, aBuffer.
Intended for synchronous usage.
This is a virtual function that each derived class must implement.
Parameters | |
---|---|
aBuffer | The buffer to read the data into. |
aPosition | The offset from which to start reading. |
TInt | SetAgentProperty | ( | ContentAccess::TAgentProperty | aProperty, |
TInt | aValue | |||
) | [virtual] |
Reimplemented from CMMFClip::SetSize(TInt)
Sets the size of the clip. This should be overriden in the derived
classes, the default version returns KErrNotSupported.
another of the system-wide error codes.
Parameters | |
---|---|
aSize | The size of the clip. |
void | SetTransferBuffer | ( | TBool | aTBuffer | ) |
Reimplemented from MDataSink::SinkDataTypeCode(TMediaId)
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 | |
---|---|
aMediaId | This 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. |
void | SinkPrimeL | ( | ) | [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.
void | SinkStopL | ( | ) | [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'
TBool | SinkStopped | ( | ) | [virtual] |
void | SinkThreadLogoff | ( | ) | [virtual] |
Reimplemented from MDataSink::SinkThreadLogoff()
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.
TInt | SinkThreadLogon | ( | MAsyncEventHandler & | aEventHandler | ) | [virtual] |
Reimplemented from MDataSink::SinkThreadLogon(MAsyncEventHandler &)
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 | |
---|---|
aEventHandler | This 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. |
TInt | Size | ( | ) | [virtual] |
Reimplemented from CMMFClip::Size()
Returns the size of the clip in bytes.
This is a virtual function that each derived class must implement.
Reimplemented from MDataSource::SourceDataTypeCode(TMediaId)
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 | |
---|---|
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. |
void | SourcePauseL | ( | ) | [virtual] |
Reimplemented from MDataSource::SourcePauseL()
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'
void | SourcePrimeL | ( | ) | [virtual] |
Reimplemented from MDataSource::SourcePrimeL()
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.
void | SourceStopL | ( | ) | [virtual] |
Reimplemented from MDataSource::SourceStopL()
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'.
void | SourceThreadLogoff | ( | ) | [virtual] |
Reimplemented from MDataSource::SourceThreadLogoff()
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.
TInt | SourceThreadLogon | ( | MAsyncEventHandler & | aEventHandler | ) | [virtual] |
Reimplemented from MDataSource::SourceThreadLogon(MAsyncEventHandler &)
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 | |
---|---|
aEventHandler | This 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 SourceThreadLogon as opposed to say the constructor. |
void | StoreRequestL | ( | CReadWriteRequest * | aRequest | ) | [protected] |
const TDesC & | UniqueId | ( | ) | const [virtual] |
void | WriteBufferL | ( | TInt | aLength, |
CMMFBuffer * | aBuffer, | |||
TInt | aPosition, | |||
MDataSource * | aSupplier | |||
) | [virtual] |
Reimplemented from CMMFClip::WriteBufferL(TInt,CMMFBuffer *,TInt,MDataSource *)
Writes aLength number of bytes of data from the offset, aPosition from the buffer, aBuffer.
Intended for asynchronous usage.
This is a virtual function that each derived class must implement.
Parameters | |
---|---|
aLength | The number of bytes to write. |
aBuffer | The buffer to write the data into. |
aPosition | The offset from which to start writing. |
aSupplier | The source of the data writen to the clip. Will be informed of write if not NULL. |
void | WriteBufferL | ( | CMMFBuffer * | aBuffer, |
TInt | aPosition, | |||
MDataSource * | aSupplier | |||
) | [virtual] |
Reimplemented from CMMFClip::WriteBufferL(CMMFBuffer *,TInt,MDataSource *)
Writes the maximum number of bytes of data from the offset, aPosition from the buffer, aBuffer.
Intended for asynchronous usage.
This is a virtual function that each derived class must implement.
Parameters | |
---|---|
aBuffer | The buffer to write the data into. |
aPosition | The offset from which to start writing. |
aSupplier | The source of the data writen to the clip. Will be informed of write if not NULL. |
void | WriteBufferL | ( | CMMFBuffer * | aBuffer, |
TInt | aPosition | |||
) | [virtual] |
Reimplemented from CMMFClip::WriteBufferL(CMMFBuffer *,TInt)
Writes the maximum number of bytes of data from the offset, aPosition from the buffer, aBuffer.
Intended for synchronous usage.
This is a virtual function that each derived class must implement.
Parameters | |
---|---|
aBuffer | The buffer to write the data into. |
aPosition | The offset from which to start writing. |