sipxmedialib  Version 3.3
MprToOutputDeviceWithAecConstructor.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: Alexander Chemeris <Alexander DOT Chemeris AT SIPez DOT com>
12 
13 #ifndef _MprToOutputDeviceWithAecConstructor_h_
14 #define _MprToOutputDeviceWithAecConstructor_h_
15 
16 // SYSTEM INCLUDES
17 // APPLICATION INCLUDES
19 #include <mp/MprToOutputDevice.h>
20 #include <mp/MprSpeexEchoCancel.h>
21 
22 // DEFINES
23 // MACROS
24 // EXTERNAL FUNCTIONS
25 // EXTERNAL VARIABLES
26 // CONSTANTS
27 // STRUCTS
28 // TYPEDEFS
29 // FORWARD DECLARATIONS
31 
39 {
40 /* //////////////////////////// PUBLIC //////////////////////////////////// */
41 public:
42 
43 /* ============================ CREATORS ================================== */
44 
47  MpOutputDeviceHandle defaultDriver = 1)
49  1, 1, //minInputs, maxInputs,
50  0, 1) //minOutputs, maxOutputs
51  , mpDefaultManager(defaultManager)
52  , mDefaultDriver(defaultDriver)
53  {
54  OsSysLog::add(FAC_MP, PRI_DEBUG,
55  "MprToOutputDeviceWithAecConstructor::MprToOutputDeviceWithAecConstructor");
56  };
57 
60 
61 /* ============================ MANIPULATORS ============================== */
62 
64  virtual OsStatus newResource(const UtlString& resourceName,
65  int maxResourcesToCreate,
66  int& numResourcesCreated,
67  MpResource* resourceArray[])
68  {
69  OsSysLog::add(FAC_MP, PRI_DEBUG,
70  "MprToOutputDeviceWithAecConstructor::newResource");
71 
72  assert(maxResourcesToCreate >= 2);
73  numResourcesCreated = 2;
74  MprToOutputDevice *pToOutput = new MprToOutputDevice(resourceName,
77  pToOutput->enableCopyQ(TRUE);
78  resourceArray[0] = pToOutput;
79  resourceArray[0]->disable();
80 
81  resourceArray[1] = new MprSpeexEchoCancel(resourceName+AEC_NAME_SUFFIX,
82  pToOutput->getCopyQ());
83  resourceArray[1]->enable();
84  return OS_SUCCESS;
85  }
86 
87 /* ============================ ACCESSORS ================================= */
88 
89 /* ============================ INQUIRY =================================== */
90 
91 /* //////////////////////////// PROTECTED ///////////////////////////////// */
92 protected:
93 
97 
99 /* //////////////////////////// PRIVATE /////////////////////////////////// */
100 private:
101 
103  MprToOutputDeviceWithAecConstructor(const MprToOutputDeviceWithAecConstructor& rMprToOutputDeviceWithAecConstructor);
104 
105 
108 
109 };
110 
111 /* ============================ INLINE METHODS ============================ */
112 
113 #endif // _MprToOutputDeviceWithAecConstructor_h_
OsMsgQ * getCopyQ()
Get pointer to the copy queue.
Definition: MprToOutputDevice.h:173
virtual ~MprToOutputDeviceWithAecConstructor()
Destructor.
Definition: MprToOutputDeviceWithAecConstructor.h:59
#define DEFAULT_TO_OUTPUT_DEVICE_WITH_AEC_RESOURCE_TYPE
Definition: MpResourceFactory.h:25
Resource in which input media from source outside the flowgraph is introduced.
Definition: MprToOutputDevice.h:50
MpOutputDeviceHandle mDefaultDriver
Definition: MprToOutputDeviceWithAecConstructor.h:96
virtual UtlBoolean disable()
Disable this resource.
Definition: MpResource.cpp:121
int MpOutputDeviceHandle
Definition: MpTypes.h:50
#define AEC_NAME_SUFFIX
Definition: MpResourceTopology.h:49
virtual UtlBoolean enable()
Enable this resource.
Definition: MpResource.cpp:145
Container of output devices.
Definition: MpOutputDeviceManager.h:66
static OsStatus enableCopyQ(const UtlString &namedResource, OsMsgQ &fgQ, UtlBoolean enable)
Send message to enable/disable copy queue.
Definition: MprToOutputDevice.cpp:117
MprToOutputDeviceWithAecConstructor(MpOutputDeviceManager *defaultManager, MpOutputDeviceHandle defaultDriver=1)
Constructor.
Definition: MprToOutputDeviceWithAecConstructor.h:46
MpOutputDeviceManager * mpDefaultManager
Definition: MprToOutputDeviceWithAecConstructor.h:94
The "Speex Echo Canceler" media processing resource.
Definition: MprSpeexEchoCancel.h:49
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
virtual OsStatus newResource(const UtlString &resourceName, int maxResourcesToCreate, int &numResourcesCreated, MpResource *resourceArray[])
Create a new resource.
Definition: MprToOutputDeviceWithAecConstructor.h:64
MprToOutputDeviceWithAecConstructor is used to construct a ToOutputDevice resource with AEC attached ...
Definition: MprToOutputDeviceWithAecConstructor.h:38
MprToOutputDeviceWithAecConstructor & operator=(const MprToOutputDeviceWithAecConstructor &rhs)
Disable assignment operator.
#define TRUE
Definition: PlgDefsV1.h:41