os::MediaStage Class Reference
[The Syllable Media API]

Media Stage. More...

Inheritance diagram for os::MediaStage:

os::MediaDecoderStage os::MediaInputStage os::MediaOutputStage os::MediaSyncStage List of all members.

Public Member Functions

 MediaStage ()
virtual uint32 GetPhysicalType ()
 Physical type.
virtual String GetIdentifier ()
 Identifier.
virtual uint32 GetInputCount ()
 Number of inputs.
virtual uint32 GetInputFormatCount (uint32 nInput)
 Number of input formats.
virtual MediaFormat_s GetInputFormat (uint32 nInput, uint32 nNum)
 Input format.
virtual uint32 GetOutputCount ()
 Number of outputs.
virtual MediaFormat_s GetOutputFormat (uint32 nOutput)
 Output format.
virtual status_t Connected (uint32 nOutput, MediaStage *pcNextStage, uint32 nInput)
 Called when the media stage is connected to the next one.
virtual void Disconnected (bool bInput, uint32 nInOutput)
 Called when the media stage is disconnected from the next or previous one.
virtual status_t Connect (MediaStage *pcPrevStage, uint32 nOutput, uint32 nInput)
 Connect the stage to the previous one.
virtual status_t Disconnect (bool bInput, uint32 nInOutput)
 Disconnect the stage from the previous/next stage.
virtual void GetPrevStage (uint32 nInput, MediaStage **pcPrev, uint32 *pnOutput)
 Get the previous stage.
virtual void GetNextStage (uint32 nOutput, MediaStage **pcNext, uint32 *pnInput)
 Get the next stage.
virtual status_t Initialize ()
 Initializes the stage.
virtual bool HasInternalBuffer ()
 Internal buffer.
virtual status_t GetPacket (uint32 nOutput, MediaPacket_s *psPacket)
 Read one packet.
virtual void FreePacket (MediaPacket_s *psPacket)
 Frees one packet.
virtual uint64 GetDelay (bool bNonSharedOnly=false)
 Delay.
virtual uint64 GetBufferSize (bool bNonSharedOnly=false)
 Buffer size.

Protected Member Functions

virtual ~MediaStage ()

Detailed Description

Description:
The Media Stage class provides a high level api on top of the low level media objects (MediaInput, MediaOutput, MediaCodec). It provides an easy way to create powerful media applications. The basic concept is that the Media stage objects are connected to each other and create a pipeline. One example would be to play an audio file. In this case the pipeline would look like this: Input stage -> Decoder stage -> Sync stage -> Output stage. The Sync stage is a special object that controls the packet flow from the input through the decoder stages to the output. It can also synchronize one audio and one video stream.
To create your pipeline just create the stage objects like MediaInputStage or MediaDecoderStage and connect them to each other using their Connect() method. Then call the Initialize() method of every object. If no errors occured then you can now call the Run() method of the sync object in a thread to start the playback.

Author:
Arno Klenke


Constructor & Destructor Documentation

MediaStage::~MediaStage (  )  [protected, virtual]

MediaStage::MediaStage (  ) 


Member Function Documentation

uint32 MediaStage::GetPhysicalType (  )  [virtual]

Description:
Returns the physical of the stage.
Author:
Arno Klenke

Reimplemented in os::MediaInputStage, os::MediaDecoderStage, os::MediaOutputStage, and os::MediaSyncStage.

String MediaStage::GetIdentifier (  )  [virtual]

Description:
Returns the identifier of the object.
Author:
Arno Klenke

Reimplemented in os::MediaInputStage, os::MediaDecoderStage, os::MediaOutputStage, and os::MediaSyncStage.

uint32 MediaStage::GetInputCount (  )  [virtual]

Description:
Returns the number of inputs.
Author:
Arno Klenke

Reimplemented in os::MediaDecoderStage, os::MediaOutputStage, and os::MediaSyncStage.

uint32 MediaStage::GetInputFormatCount ( uint32  nInput  )  [virtual]

Description:
Returns the number of formats of one input.
Parameters:
nInput - The input.
Author:
Arno Klenke

Reimplemented in os::MediaDecoderStage, os::MediaOutputStage, and os::MediaSyncStage.

MediaFormat_s MediaStage::GetInputFormat ( uint32  nInput,
uint32  nNum 
) [virtual]

Description:
Returns one input format.
Parameters:
nInput - The input.
nNum - Input format number.
Author:
Arno Klenke

Reimplemented in os::MediaDecoderStage, os::MediaOutputStage, and os::MediaSyncStage.

uint32 MediaStage::GetOutputCount (  )  [virtual]

Description:
Returns the number of outputs.
Author:
Arno Klenke

Reimplemented in os::MediaInputStage, os::MediaDecoderStage, and os::MediaSyncStage.

MediaFormat_s MediaStage::GetOutputFormat ( uint32  nOutput  )  [virtual]

Description:
Returns the format of one output.
Parameters:
nOutput - The output.
Author:
Arno Klenke

Reimplemented in os::MediaInputStage, os::MediaDecoderStage, and os::MediaSyncStage.

status_t MediaStage::Connected ( uint32  nOutput,
MediaStage pcNextStage,
uint32  nInput 
) [virtual]

Description:
Called when the media stage is connected to the next one.
Parameters:
nOutput - Output of the stage.
pcNextStage - The stage that has been connected.
nInput - Input of the connected stage.
Author:
Arno Klenke

void MediaStage::Disconnected ( bool  bInput,
uint32  nInOutput 
) [virtual]

Description:
Called when the media stage is disconnected from the next or previous one.
Parameters:
bInput - If true then the stage was disconnected from the previous one. Else from the next one.
nInOutput - The input (bInput=true) or output (bInput=false)
Author:
Arno Klenke

status_t MediaStage::Connect ( MediaStage pcPrevStage,
uint32  nOutput,
uint32  nInput 
) [virtual]

Description:
Connect the stage to a previous one.
Parameters:
pcPrevStage - The previous stage.
nOutput - Output of the previous stage.
nInput - Input to which the previous stage should be connected.
Author:
Arno Klenke

status_t MediaStage::Disconnect ( bool  bInput,
uint32  nInOutput 
) [virtual]

Description:
Disconnect the stage from the previous/next stage.
Parameters:
bInput - If true then the stage will be disconnected from the previous one. Else from the next one.
nInOutput - The input (bInput=true) or output (bInput=false)
Author:
Arno Klenke

void MediaStage::GetPrevStage ( uint32  nInput,
MediaStage **  pcPrev,
uint32 *  pnOutput 
) [virtual]

Description:
Get the previous stage.
Parameters:
nInput - The input.
pcPrev - Contains a pointer to the previous stage after the call.
pnOutput - Contains the output of the previous stage after the call.
Author:
Arno Klenke

void MediaStage::GetNextStage ( uint32  nOutput,
MediaStage **  pcNext,
uint32 *  pnInput 
) [virtual]

Description:
Get the next stage.
Parameters:
nOutput - The output.
pcNext - Contains a pointer to the next stage after the call.
pnInput - Contains the input of the next stage after the call.
Author:
Arno Klenke

status_t MediaStage::Initialize (  )  [virtual]

Description:
This method has to be called for every stage object after you have connected all the stages.
Author:
Arno Klenke

Reimplemented in os::MediaDecoderStage, os::MediaOutputStage, and os::MediaSyncStage.

bool MediaStage::HasInternalBuffer (  )  [virtual]

Description:
Return whether the data pointer of the packets read with GetPacket() point to internal memory of the stage object.
Author:
Arno Klenke

Reimplemented in os::MediaInputStage, and os::MediaDecoderStage.

status_t MediaStage::GetPacket ( uint32  nOutput,
MediaPacket_s psPacket 
) [virtual]

Description:
Reads one packet from the stage. The stage object will read data from the previous stages if necessary. You normally do not have to call this method directly because the MediaSyncStage takes care of this.
Parameters:
nOutput - The output.
psPacket - Pointer to a packet.
Author:
Arno Klenke

Reimplemented in os::MediaInputStage, os::MediaDecoderStage, os::MediaOutputStage, and os::MediaSyncStage.

void MediaStage::FreePacket ( MediaPacket_s psPacket  )  [virtual]

Description:
Frees one packet. You normally do not have to call this method directly because the MediaSyncStage takes care of this.
Parameters:
psPacket - Pointer to a packet.
Author:
Arno Klenke

Reimplemented in os::MediaInputStage.

uint64 MediaStage::GetDelay ( bool  bNonSharedOnly = false  )  [virtual]

Description:
Returns the delay of the stage.
Parameters:
bNonSharedOnly - If the output has shared and non-shared buffers then true will return the buffer size of the non-shared buffer only. Otherwise the complete buffer size will be returned.
Author:
Arno Klenke

Reimplemented in os::MediaOutputStage.

uint64 MediaStage::GetBufferSize ( bool  bNonSharedOnly = false  )  [virtual]

Description:
Returns the buffer size of the stage.
Parameters:
bNonSharedOnly - If the output has shared and non-shared buffers then true will return the buffer size of the non-shared buffer only. Otherwise the complete buffer size will be returned.
Author:
Arno Klenke

Reimplemented in os::MediaOutputStage.


Generated on Sat May 9 22:49:21 2009 for Syllable Media API by  doxygen 1.5.1