sipxmedialib  Version 3.3
MprEchoSuppress.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006 SIPez LLC.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2004-2006 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
9 // Licensed to SIPfoundry under a Contributor Agreement.
10 //
11 // $$
13 
14 #ifndef _MprEchoSuppress_h_
15 #define _MprEchoSuppress_h_
16 
17 // SYSTEM INCLUDES
18 
19 // APPLICATION INCLUDES
20 #include "os/OsStatus.h"
21 #include "mp/MpAudioResource.h"
22 
23 // DEFINES
24 // MACROS
25 // EXTERNAL FUNCTIONS
26 // EXTERNAL VARIABLES
27 // CONSTANTS
28 // STRUCTS
29 // TYPEDEFS
30 // FORWARD DECLARATIONS
31 
32 class MprToSpkr;
33 class FilterBank;
34 class HandsetFilterBank;
35 
40 {
41 /* //////////////////////////// PUBLIC //////////////////////////////////// */
42 public:
43 
44 /* ============================ CREATORS ================================== */
46 
47 
49  MprEchoSuppress(const UtlString& rName);
50 
52  virtual
54 
56 
57 /* ============================ MANIPULATORS ============================== */
59 
60 
61  void setSpkrPal(MprToSpkr* pal);
62 
63  int startSpeech();
64  int endSpeech();
65 
67 
68 /* ============================ ACCESSORS ================================= */
70 
71 
73 
74 /* ============================ INQUIRY =================================== */
76 
77 
79 
80 /* //////////////////////////// PROTECTED ///////////////////////////////// */
81 protected:
82 
83 /* //////////////////////////// PRIVATE /////////////////////////////////// */
84 private:
85  short mState;
90  short mshDelay;
93 
94  MpBufPtr LoudspeakerFade(MpBufPtr in, short& shSpkState, int iFreezeFlag);
95 
96  void frame_match(const MpAudioBufPtr &in);
97 
98  virtual UtlBoolean doProcessFrame(MpBufPtr inBufs[],
99  MpBufPtr outBufs[],
100  int inBufsSize,
101  int outBufsSize,
102  UtlBoolean isEnabled,
103  int samplesPerFrame,
104  int samplesPerSecond);
105 
106  void control_logic(unsigned long ulSigIn,
107  unsigned long ulSigOut,
108  short& shSpkState,
109  int iFreezeFlag);
110 
112  MprEchoSuppress(const MprEchoSuppress& rMprEchoSuppress);
113 
116 
117 };
118 
119 /* ============================ INLINE METHODS ============================ */
120 
121 #endif // _MprEchoSuppress_h_
The "To Speaker" media processing resource.
Definition: MprToSpkr.h:47
FilterBank * mpFilterBank
Definition: MprEchoSuppress.h:91
void control_logic(unsigned long ulSigIn, unsigned long ulSigOut, short &shSpkState, int iFreezeFlag)
int samplesPerFrame
short mState
Definition: MprEchoSuppress.h:85
MpAudioBufPtr mpPrev
Definition: MprEchoSuppress.h:87
int mTicksPerFrame
Definition: MprEchoSuppress.h:88
void frame_match(const MpAudioBufPtr &in)
Definition: MprEchoSuppress.cpp:187
int mSpeechFake
Definition: MprEchoSuppress.h:89
virtual UtlBoolean doProcessFrame(MpBufPtr inBufs[], MpBufPtr outBufs[], int inBufsSize, int outBufsSize, UtlBoolean isEnabled, int samplesPerFrame, int samplesPerSecond)
This method does the real work for the media processing resource and must be defined in each class de...
Definition: MprEchoSuppress.cpp:292
short mshDelay
Definition: MprEchoSuppress.h:90
MprEchoSuppress(const UtlString &rName)
Constructor.
Definition: MprEchoSuppress.cpp:115
HandsetFilterBank * mpHandsetFilterBank
Definition: MprEchoSuppress.h:92
int samplesPerSecond
MpBufPtr LoudspeakerFade(MpBufPtr in, short &shSpkState, int iFreezeFlag)
Definition: MprEchoSuppress.cpp:260
virtual ~MprEchoSuppress()
Destructor.
Definition: MprEchoSuppress.cpp:149
Smart pointer to MpAudioBuf.
Definition: MpAudioBuf.h:168
Abstract base class for all audio processing objects.
Definition: MpAudioResource.h:38
int startSpeech()
Definition: MprEchoSuppress.cpp:168
MprEchoSuppress & operator=(const MprEchoSuppress &rhs)
Assignment operator (not implemented for this class)
The "Echo suppress" media processing resource.
Definition: MprEchoSuppress.h:39
Definition: FilterBank.h:45
int endSpeech()
Definition: MprEchoSuppress.cpp:174
Smart pointer to MpBuf.
Definition: MpBuf.h:160
MprToSpkr * mpSpkrPal
Definition: MprEchoSuppress.h:86
Definition: HandsetFilterBank.h:22
void setSpkrPal(MprToSpkr *pal)
Definition: MprEchoSuppress.cpp:163
UtlBoolean isEnabled() const
Returns TRUE is this resource is currently enabled, FALSE otherwise.
Definition: MpResource.cpp:440