EMIPLIB
1.2.1
|
Base class of a component which can be placed in a component chain. More...
#include <mipcomponent.h>
Inherits MIPErrorBase.
Inherited by MIPALawDecoder, MIPALawEncoder, MIPAlsaOutput, MIPAudio3DBase, MIPAudioFileInput, MIPAudioFilter, MIPAudioMixer, MIPAudioRecorderInput, MIPAudioSplitter, MIPAudioTrackOutput, MIPAVCodecFrameConverter, MIPAverageTimer, MIPComponentAlias, MIPEsdOutput, MIPFrequencyGenerator, MIPGSMDecoder, MIPGSMEncoder, MIPInterChainTimer, MIPJackInput, MIPJackOutput, MIPLPCDecoder, MIPLPCEncoder, MIPMediaBuffer, MIPMessageDumper, MIPOpenALOutput, MIPOSSInputOutput, MIPOutputMessageQueue, MIPOutputMessageQueueWithState, MIPPAInputOutput, MIPPulseOutput, MIPPushEventTimer, MIPQt5OutputComponent, MIPRTPComponent, MIPRTPDecoder, MIPSampleEncoder, MIPSamplingRateConverter, MIPSDLAudioOutput, MIPSILKDecoder, MIPSILKEncoder, MIPSndFileInput, MIPSndFileOutput, MIPSpeexDecoder, MIPSpeexEchoCanceller, MIPSpeexEncoder, MIPTinyJPEGDecoder, MIPULawDecoder, MIPULawEncoder, MIPV4L2Input, MIPVideoFrameStorage, MIPVideoMixer, MIPWAVInput, MIPWAVOutput, MIPWinMMInput, MIPWinMMOutput, MIPYUV420FileInput, and MIPYUV420FrameCutter.
Public Member Functions | |
virtual void | lock () |
Locks the current component. More... | |
virtual void | unlock () |
Unlocks the current component. More... | |
virtual bool | push (const MIPComponentChain &chain, int64_t iteration, MIPMessage *pMsg)=0 |
Feeds a message into the component. More... | |
virtual bool | pull (const MIPComponentChain &chain, int64_t iteration, MIPMessage **pMsg)=0 |
Retrieve a message from the component. More... | |
virtual bool | processFeedback (const MIPComponentChain &chain, int64_t feedbackChainID, MIPFeedback *feedback) |
Add feedback information about this component. More... | |
std::string | getComponentName () const |
Returns the name of the component. More... | |
Public Member Functions inherited from MIPErrorBase | |
std::string | getErrorString () const |
Returns the last known error description. More... | |
Protected Member Functions | |
MIPComponent (const std::string &componentName) | |
Create a component with the specified name. More... | |
Protected Member Functions inherited from MIPErrorBase | |
void | setErrorString (const std::string &str) const |
Stores an error description. More... | |
This class serves as a base class from which actual components can be derived. A working component needs to implement the MIPComponent::pull and MIPComponent::push methods.
|
protected |
Constructor which can only be called from derived classes and which stores the name of the component.
|
inline |
This function returns the name of the component, as it was specified in the constructor.
|
inlinevirtual |
This function locks the component. It is used in the MIPComponentChain background thread to prevent a component being accessed at the same time in different threads.
Referenced by MIPComponentAlias::MIPComponentAlias().
|
inlinevirtual |
If the component implements this function, it can add feedback information to the MIPFeedback object passed as the third argument. As with the push and pull functions, the current chain is also passed as an argument. Since it is possible that two feedback chains end in the same component, an identifier describing the specific feedback chain is passed as the second argument.
Referenced by MIPAudioMixer::clearIgnoreList(), and MIPComponentAlias::MIPComponentAlias().
|
pure virtual |
This function needs to be implemented by a derived class. It is part of the message passing system and is intended to retrieve messages from the current component. The function is called from the background thread of a MIPComponentChain object. In principle, it is possible that a component can be accessed by different chains. For this reason, the calling chain is passed as the first argument. The second argument describes the current iteration in the chain's background thread. Finally, in the third parameter a pointer to the retrieved message is stored.
In one specific iteration of the background thread, it is possible that multiple messages need to be retrieved (received RTP packets for example). To make this possible, the component should have a list of messages ready and each time the pull function is called, another message should be stored in the pMsg parameter. After the last message has been passed, a NULL pointer should be stored in pMsg to indicate that it was indeed the last message. At this point, the retrieval system should be reinitialized in such a way that a successive call to the pull function will again store the first message in pMsg. This way it is possible to pass messages from one component to multiple components.
Referenced by MIPOutputMessageQueueWithState::clear(), MIPAudioMixer::clearIgnoreList(), MIPAudioFilter::clearMiddleFilter(), MIPV4L2Input::getFrameSubtype(), MIPSndFileOutput::getNumberOfChannels(), MIPSpeexEchoCanceller::getOutputAnalyzer(), MIPOSSInputOutput::getRawAudioSubtype(), MIPEsdOutput::getSampleWidth(), MIPJackOutput::getSamplingRate(), MIPJackInput::getSamplingRate(), MIPHRIRListen::getSamplingRate(), MIPComponentAlias::MIPComponentAlias(), MIPWAVInput::setSourceID(), MIPSndFileInput::setSourceID(), and MIPAudioFileInput::setSourceID().
|
pure virtual |
This function needs to be implemented by a derived class. It is part of the message passing system and is intended to feed messages to the current component. The function is called from the background thread of a MIPComponentChain object. In principle, it is possible that a component can be accessed by different chains. For this reason, the calling chain is passed as the first argument. The second argument describes the current iteration in the chain's background thread. Finally, the third argument is a pointer to the message itself.
Referenced by MIPAudioMixer::clearIgnoreList(), MIPAudioFilter::clearMiddleFilter(), MIPV4L2Input::getFrameSubtype(), MIPSndFileOutput::getNumberOfChannels(), MIPSpeexEchoCanceller::getOutputAnalyzer(), MIPOSSInputOutput::getRawAudioSubtype(), MIPEsdOutput::getSampleWidth(), MIPJackOutput::getSamplingRate(), MIPJackInput::getSamplingRate(), MIPHRIRListen::getSamplingRate(), MIPComponentAlias::MIPComponentAlias(), MIPWAVInput::setSourceID(), MIPSndFileInput::setSourceID(), and MIPAudioFileInput::setSourceID().
|
inlinevirtual |
This function removes the lock on the current component. It too is used in the MIPComponentChain background thread.
Referenced by MIPComponentAlias::MIPComponentAlias().