sipxmedialib  Version 3.3
MprSplitterConstructor.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 _MprSplitterConstructor_h_
14 #define _MprSplitterConstructor_h_
15 
16 // SYSTEM INCLUDES
17 // APPLICATION INCLUDES
19 #include <mp/MprSplitter.h>
20 
21 // DEFINES
22 #ifndef DEFAULT_SPLITTER_MAX_OUTPUTS
23 #define DEFAULT_SPLITTER_MAX_OUTPUTS 4
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 
46  MprSplitterConstructor(int minInOutputs = 1,
47  int maxOutputs = DEFAULT_SPLITTER_MAX_OUTPUTS)
49  0, 1, //minInputs, maxInputs,
50  0, maxOutputs) //minOutputs, maxOutputs
51  {
52  };
53 
57 
58 /* ============================ MANIPULATORS ============================== */
59 
61  virtual OsStatus newResource(const UtlString& resourceName,
62  int maxResourcesToCreate,
63  int& numResourcesCreated,
64  MpResource* resourceArray[])
65  {
66  assert(maxResourcesToCreate >= 1);
67  numResourcesCreated = 1;
68  resourceArray[0] = new MprSplitter(resourceName,
69  mMaxOutputs);
70  resourceArray[0]->enable();
71  return(OS_SUCCESS);
72  }
73 
74 /* ============================ ACCESSORS ================================= */
75 
76 /* ============================ INQUIRY =================================== */
77 
78 /* //////////////////////////// PROTECTED ///////////////////////////////// */
79 protected:
80 
81 /* //////////////////////////// PRIVATE /////////////////////////////////// */
82 private:
83 
86  MprSplitterConstructor(const MprSplitterConstructor& rMprSplitterConstructor);
87 
88 
92 
93 };
94 
95 /* ============================ INLINE METHODS ============================ */
96 
97 #endif // _MprSplitterConstructor_h_
MprSplitterConstructor & operator=(const MprSplitterConstructor &rhs)
MprSplitterConstructor(int minInOutputs=1, int maxOutputs=DEFAULT_SPLITTER_MAX_OUTPUTS)
Definition: MprSplitterConstructor.h:46
The "Splitter" media processing resource.
Definition: MprSplitter.h:41
MprSplitterConstructor is used to construct a bridge mixer resource.
Definition: MprSplitterConstructor.h:37
virtual OsStatus newResource(const UtlString &resourceName, int maxResourcesToCreate, int &numResourcesCreated, MpResource *resourceArray[])
Create a new resource.
Definition: MprSplitterConstructor.h:61
#define DEFAULT_SPLITTER_RESOURCE_TYPE
Definition: MpResourceFactory.h:35
virtual ~MprSplitterConstructor()
Definition: MprSplitterConstructor.h:56
virtual UtlBoolean enable()
Enable this resource.
Definition: MpResource.cpp:145
#define DEFAULT_SPLITTER_MAX_OUTPUTS
Definition: MprSplitterConstructor.h:23
int mMaxOutputs
Definition: MpResourceConstructor.h:94
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