sipxmedialib  Version 3.3
MprBridgeConstructor.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006-2007 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2006-2007 SIPez LLC.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 
11 // Author: Dan Petrie <dpetrie AT SIPez DOT com>
12 
13 #ifndef _MprBridgeConstructor_h_
14 #define _MprBridgeConstructor_h_
15 
16 // SYSTEM INCLUDES
17 // APPLICATION INCLUDES
19 #include <mp/MprBridge.h>
20 
21 // DEFINES
22 #ifndef DEFAULT_BRIDGE_MAX_IN_OUTPUTS
23 #define DEFAULT_BRIDGE_MAX_IN_OUTPUTS 10
24 #endif
25 // MACROS
26 // EXTERNAL FUNCTIONS
27 // EXTERNAL VARIABLES
28 // CONSTANTS
29 // STRUCTS
30 // TYPEDEFS
31 // FORWARD DECLARATIONS
32 
38 {
39 /* //////////////////////////// PUBLIC //////////////////////////////////// */
40 public:
41 
42 /* ============================ CREATORS ================================== */
43 
45  MprBridgeConstructor(int minInOutputs = 1,
46  int maxInOutputs = DEFAULT_BRIDGE_MAX_IN_OUTPUTS,
47  UtlBoolean mixSilence=TRUE,
50  minInOutputs, maxInOutputs, //minInputs, maxInputs,
51  minInOutputs, maxInOutputs) //minOutputs, maxOutputs
52  , mMixSilence(mixSilence)
53  , mAlgorithm(algorithm)
54  {
55  };
56 
58  virtual ~MprBridgeConstructor(){};
59 
60 /* ============================ MANIPULATORS ============================== */
61 
63  virtual OsStatus newResource(const UtlString& resourceName,
64  int maxResourcesToCreate,
65  int& numResourcesCreated,
66  MpResource* resourceArray[])
67  {
68  assert(maxResourcesToCreate >= 1);
69  numResourcesCreated = 1;
70  resourceArray[0] = new MprBridge(resourceName, mMaxInputs,
72  resourceArray[0]->enable();
73  return(OS_SUCCESS);
74  }
75 
76 /* ============================ ACCESSORS ================================= */
77 
78 /* ============================ INQUIRY =================================== */
79 
80 /* //////////////////////////// PROTECTED ///////////////////////////////// */
81 protected:
82 
83  UtlBoolean mMixSilence;
85 
86 /* //////////////////////////// PRIVATE /////////////////////////////////// */
87 private:
88 
90  MprBridgeConstructor(const MprBridgeConstructor& rMprBridgeConstructor);
91 
92 
95 
96 };
97 
98 /* ============================ INLINE METHODS ============================ */
99 
100 #endif // _MprBridgeConstructor_h_
MprBridgeConstructor(int minInOutputs=1, int maxInOutputs=DEFAULT_BRIDGE_MAX_IN_OUTPUTS, UtlBoolean mixSilence=TRUE, MprBridge::AlgType algorithm=MprBridge::ALG_LINEAR)
Constructor.
Definition: MprBridgeConstructor.h:45
MprBridgeConstructor is used to construct a bridge mixer resource.
Definition: MprBridgeConstructor.h:37
virtual ~MprBridgeConstructor()
Destructor.
Definition: MprBridgeConstructor.h:58
The conference bridge resource.
Definition: MprBridge.h:57
MprBridgeConstructor & operator=(const MprBridgeConstructor &rhs)
Disable assignment operator.
Linear O(n) algorithm (MpBridgeAlgLinear)
Definition: MprBridge.h:66
UtlBoolean mMixSilence
Definition: MprBridgeConstructor.h:83
MprBridge::AlgType mAlgorithm
Definition: MprBridgeConstructor.h:84
int mMaxInputs
Definition: MpResourceConstructor.h:92
virtual UtlBoolean enable()
Enable this resource.
Definition: MpResource.cpp:145
Abstract base class for all media processing objects.
Definition: MpResource.h:56
MpAudioResourceConstructor is used to construct a specific audio resource type.
Definition: MpAudioResourceConstructor.h:36
#define TRUE
Definition: PlgDefsV1.h:41
AlgType
Type of the bridge mix algorithm to use.
Definition: MprBridge.h:63
#define DEFAULT_BRIDGE_RESOURCE_TYPE
Definition: MpResourceFactory.h:20
#define DEFAULT_BRIDGE_MAX_IN_OUTPUTS
Definition: MprBridgeConstructor.h:23
virtual OsStatus newResource(const UtlString &resourceName, int maxResourcesToCreate, int &numResourcesCreated, MpResource *resourceArray[])
Create a new resource.
Definition: MprBridgeConstructor.h:63