9 #ifndef _MpResourceTopology_h_ 10 #define _MpResourceTopology_h_ 14 #include <os/OsStatus.h> 15 #include <utl/UtlString.h> 16 #include <utl/UtlDList.h> 17 #include <utl/UtlHashMap.h> 21 #define DEFAULT_FROM_FILE_RESOURCE_NAME "FromFile1" 22 #define DEFAULT_FROM_INPUT_DEVICE_RESOURCE_NAME "FromMic1" 23 #define DEFAULT_BRIDGE_RESOURCE_NAME "Bridge1" 24 #define DEFAULT_VIDEO_MIXER_RESOURCE_NAME "VideoMixer1" 25 #define DEFAULT_SPEAKER_SELECTOR_RESOURCE_NAME "SpeakerSelector1" 26 #define DEFAULT_TONE_GEN_RESOURCE_NAME "ToneGen1" 27 #define DEFAULT_TONE_DETECT_RESOURCE_NAME "ToneDetect" 28 #define DEFAULT_TO_OUTPUT_DEVICE_RESOURCE_NAME "ToSpeaker1" 29 #define DEFAULT_SPEEX_PREPROCESS_RESOURCE_NAME "SpeexPreprocess" 30 #define DEFAULT_NULL_RESOURCE_NAME "Null1" 31 #define DEFAULT_RTP_INPUT_RESOURCE_NAME "InRtp-%d" 32 #define DEFAULT_VIDEO_RTP_INPUT_RESOURCE_NAME "InVideoRtp-%d" 33 #define DEFAULT_DECODE_RESOURCE_NAME "Decode-%d" 34 #define DEFAULT_RTP_OUTPUT_RESOURCE_NAME "OutRtp-%d" 35 #define DEFAULT_VIDEO_RTP_OUTPUT_RESOURCE_NAME "OutVideoRtp-%d" 36 #define DEFAULT_ENCODE_RESOURCE_NAME "Encode-%d" 37 #define DEFAULT_RECORDER_RESOURCE_NAME "CallRecorder" 38 #define DEFAULT_TO_OUTPUT_SPLITTER_RESOURCE_NAME "ToOutputSplitter1" 39 #define DEFAULT_VAD_RESOURCE_NAME "Vad" 40 #define DEFAULT_VOICE_ACTIVITY_NOTIFIER_RESOURCE_NAME "VoiceActivityNotifier" 41 #define DEFAULT_DELAY_RESOURCE_NAME "Delay" 42 #define DEFAULT_NOTCH_FILTER_RESOURCE_NAME "NotchFilter" 44 #define CONNECTION_NAME_SUFFIX "-%d" 45 #define STREAM_NAME_SUFFIX "-%d" 46 #define MIC_NAME_SUFFIX "-Mic" 47 #define SPEAKER_NAME_SUFFIX "-Spkr" 48 #define AEC_OUTPUT_BUFFER_RESOURCE_NAME_SUFFIX "-outBuffer" 49 #define AEC_NAME_SUFFIX "-AEC" 50 #define DIRECTION_IN_SUFFIX "-In" 51 #define DIRECTION_OUT_SUFFIX "-Out" 57 #define VIRTUAL_NAME_LOCAL_STREAM_OUTPUT "StreamOutput" MIC_NAME_SUFFIX 63 #define VIRTUAL_NAME_LOCAL_STREAM_INPUT "StreamInput" SPEAKER_NAME_SUFFIX 72 #define VIRTUAL_NAME_RTP_STREAM_OUTPUT "StreamOutput" CONNECTION_NAME_SUFFIX 83 #define VIRTUAL_NAME_CONNECTION_PORTS "ConnectionPorts" 93 class UtlHashMapIterator;
138 #if defined(_MSC_VER) && (_MSC_VER <= 1200) 156 #if defined(_MSC_VER) && (_MSC_VER <= 1200) 158 const char* outputResourceName;
165 #if defined(_MSC_VER) && (_MSC_VER <= 1200) 167 const char* inputResourceName;
213 const UtlString& inputResourceName,
234 const UtlString& virtualResourceName,
235 int virtualPortIndex);
244 const UtlString& virtualResourceName,
245 int virtualPortIndex);
254 UtlString& firstDanglingResourceName,
255 UtlBoolean allowExternalResources =
FALSE)
const;
276 int& firstInvalidResourceIndex)
const;
304 int &resourcePort)
const;
310 int &resourcePort)
const;
314 UtlString& outputResourceName,
315 int& outputPortIndex,
316 UtlString& inputResourceName,
317 int& inputPortIndex);
335 UtlString& realResourceName,
337 UtlString& virtualResourceName,
338 int &virtualPortIndex);
359 UtlString& realResourceName,
361 UtlString& virtualResourceName,
362 int &virtualPortIndex);
393 UtlContainer& connectionsToTraverse)
const;
407 #endif // _MpResourceTopology_h_ int getNextLogicalPortNumber()
Get the next logical port, used when the same port number ???
Definition: MpResourceTopology.cpp:632
int findResourceConnections(const UtlString &resourceName, UtlContainer &connectionsToTraverse) const
Definition: MpResourceTopology.cpp:739
void freeVirtualInputIterator(VirtualPortIterator &portIter)
Destroy virtual input ports iterator.
Definition: MpResourceTopology.cpp:642
OsStatus addResource(const UtlString &resourceType, const UtlString &resourceName, MpConnectionID connectionId=MP_INVALID_CONNECTION_ID, int streamId=-1)
Add a new resource definition to the topology.
Definition: MpResourceTopology.cpp:105
MpResourceTopology()
Constructor.
Definition: MpResourceTopology.cpp:90
void initVirtualInputIterator(VirtualPortIterator &portIter)
Initialize virtual input ports iterator.
Definition: MpResourceTopology.cpp:637
int streamId
Definition: MpResourceTopology.h:151
A connection type for use with addConnections().
Definition: MpResourceTopology.h:154
OsStatus addConnection(const UtlString &outputResourceName, int outputPortIndex, const UtlString &inputResourceName, int inputPortIndex)
Add a new connection definition to the topology.
Definition: MpResourceTopology.cpp:141
OsStatus getInputVirtualResource(const UtlString &virtualName, int virtualPort, UtlString &resourceName, int &resourcePort) const
Get the resource name and port index by the virtual input name and port index.
Definition: MpResourceTopology.cpp:525
MpLogicalPortTypes
Definition: MpResourceTopology.h:128
virtual ~MpResourceTopology()
Destructor.
Definition: MpResourceTopology.cpp:96
void initVirtualOutputIterator(VirtualPortIterator &portIter)
Initialize virtual output ports iterator.
Definition: MpResourceTopology.cpp:669
OsStatus getResource(int resourceIndex, UtlString &resourceType, UtlString &resourceName, MpConnectionID &connectionId, int &streamId) const
Get the resource definition indicated by the resourceIndex.
Definition: MpResourceTopology.cpp:482
UtlHashMap mVirtualInputs
Mapping between virtual and real inputs.
Definition: MpResourceTopology.h:389
static void replaceNumInName(UtlString &resourceName, int resourceNum)
Utility to replace "%d" in resource name with an integer.
Definition: MpResourceTopology.cpp:468
const UtlString inputResourceName
Definition: MpResourceTopology.h:169
const UtlString outputResourceName
Definition: MpResourceTopology.h:160
MpConnectionID connectionId
Definition: MpResourceTopology.h:150
Definition: MpResourceTopology.h:130
OsStatus addConnections(const ConnectionDef *defines, int numDefines)
Add resources from an array.
Definition: MpResourceTopology.cpp:153
UtlDList mConnections
Definition: MpResourceTopology.h:388
OsStatus getConnection(int connectionIndex, UtlString &outputResourceName, int &outputPortIndex, UtlString &inputResourceName, int &inputPortIndex)
Get the connection definition indicated by the connectionIndex.
Definition: MpResourceTopology.cpp:607
A resource type for use with addResources().
Definition: MpResourceTopology.h:136
OsStatus getNextVirtualOutput(VirtualPortIterator &portIter, UtlString &realResourceName, int &realPortIndex, UtlString &virtualResourceName, int &virtualPortIndex)
Get virtual output data from an iterator.
Definition: MpResourceTopology.cpp:681
int mPriorLogicalPort
Definition: MpResourceTopology.h:386
const UtlString resourceName
Definition: MpResourceTopology.h:147
OsStatus validateConnections(UtlString &firstUnconnectedResourceName, UtlString &firstDanglingResourceName, UtlBoolean allowExternalResources=FALSE) const
Validate that the connections are connect the resources.
Definition: MpResourceTopology.cpp:299
void freeVirtualOutputIterator(VirtualPortIterator &portIter)
Destroy virtual output ports iterator.
Definition: MpResourceTopology.cpp:674
MpResourceFactory is used to construct resources by type name.
Definition: MpResourceFactory.h:61
MpResourceTopology & operator=(const MpResourceTopology &rhs)
Disabled assignment operator.
OsStatus validateResourceTypes(MpResourceFactory &resourceFactory, int &firstInvalidResourceIndex) const
Validate that all the resource types in this topology have a constructor in the factory.
Definition: MpResourceTopology.cpp:447
UtlDList mResources
Definition: MpResourceTopology.h:387
int dumpConnections(UtlString &dumpString)
Dump connections to debug string.
Definition: MpResourceTopology.cpp:714
OsStatus addResources(const ResourceDef *defines, int numDefines)
Add resources from an array.
Definition: MpResourceTopology.cpp:125
int dumpResources(UtlString &dumpString)
Dump resources to debug string.
Definition: MpResourceTopology.cpp:693
OsStatus getOutputVirtualResource(const UtlString &virtualName, int virtualPort, UtlString &resourceName, int &resourcePort) const
Get the resource name and port index by the virtual output name and port index.
Definition: MpResourceTopology.cpp:566
const UtlString resourceType
Definition: MpResourceTopology.h:146
OsStatus addVirtualOutput(const UtlString &realResourceName, int realPortIndex, const UtlString &virtualResourceName, int virtualPortIndex)
Add a new virtual output definition to the topology.
Definition: MpResourceTopology.cpp:247
int MpConnectionID
Flowgraph connection ID.
Definition: MpTypes.h:56
UtlHashMap mVirtualOutputs
Mapping between virtual and real outputs.
Definition: MpResourceTopology.h:390
MpResourceTopology is used to define a set of resources and how they are to be connected in a flowgra...
Definition: MpResourceTopology.h:123
UtlHashMapIterator * VirtualPortIterator
Definition: MpResourceTopology.h:133
#define MP_INVALID_CONNECTION_ID
Definition: MpTypes.h:57
#define FALSE
Definition: PlgDefsV1.h:37
int outputPortIndex
Definition: MpResourceTopology.h:163
int inputPortIndex
Definition: MpResourceTopology.h:172
OsStatus addVirtualInput(const UtlString &realResourceName, int realPortIndex, const UtlString &virtualResourceName, int virtualPortIndex)
Add a new virtual input definition to the topology.
Definition: MpResourceTopology.cpp:195
OsStatus getNextVirtualInput(VirtualPortIterator &portIter, UtlString &realResourceName, int &realPortIndex, UtlString &virtualResourceName, int &virtualPortIndex)
Get virtual input data from an iterator.
Definition: MpResourceTopology.cpp:648