14 #ifndef _MpCallFlowGraph_h_ 15 #define _MpCallFlowGraph_h_ 26 #include <os/OsProtectEvent.h> 28 #include <os/OsSocket.h> 31 #define DEBUG_POSTPONE 35 #define DOING_ECHO_CANCELATION 36 #define SPEEX_ECHO_CANCELATION 40 #ifndef HAVE_SPEEX // [ 41 # undef SPEEX_ECHO_CANCELATION 42 #endif // !HAVE_SPEEX ] 46 #ifdef DOING_ECHO_CANCELATION // [ 47 # ifndef SPEEX_ECHO_CANCELATION // [ 50 # undef DOING_ECHO_CANCELATION 51 # endif // !SPEEX_ECHO_CANCELATION ] 52 #else // DOING_ECHO_CANCELATION ][ 53 # undef SPEEX_ECHO_CANCELATION 54 # undef SIPX_ECHO_CANCELATION 55 #endif // DOING_ECHO_CANCELATION ] 102 #ifndef DISABLE_LOCAL_AUDIO // [ 106 #ifdef HIGH_SAMPLERATE_AUDIO // [ 110 #endif // HIGH_SAMPLERATE_AUDIO ] 111 #endif // DISABLE_LOCAL_AUDIO ] 125 OsMsgDispatcher *pNotifDispatcher= NULL);
138 void startTone(
int toneId,
int toneOptions);
146 const char* playFilename,
147 const char* baseName,
155 const char* fileName) ;
157 OsStatus
record(
int timeMS,
159 const char* micName = NULL,
160 const char* echoOutName = NULL,
161 const char* spkrName = NULL,
162 const char* mic32Name = NULL,
163 const char* spkr32Name = NULL,
164 const char* echoIn8Name = NULL,
165 const char* echoIn32Name = NULL,
166 const char* playName = NULL,
167 const char* callName = NULL,
173 int time,
int silenceLength,
178 unsigned long bufSize,
183 OsProtectedEvent* event = NULL,
184 UtlBoolean autoStopOnFinish =
TRUE);
198 OsStatus
playFile(
const char* audioFileName
204 , UtlBoolean autoStopOnFinish =
TRUE);
219 void stopFile(UtlBoolean closeFile);
224 void startSendRtp(OsSocket& rRtpSocket, OsSocket& rRtcpSocket,
227 SdpCodec* pDtmfCodec = NULL);
234 OsSocket& rRtpSocket, OsSocket& rRtcpSocket,
265 UtlBoolean isMcast =
FALSE);
293 static UtlBoolean
setAGC(UtlBoolean bEnable);
347 #ifndef DISABLE_STREAM_PLAYER 350 #ifndef DISABLE_LOCAL_AUDIO // [ 354 # ifdef HAVE_SPEEX // [ 356 # endif // HAVE_SPEEX ] 357 # if defined (SPEEX_ECHO_CANCELATION) 359 # elif defined (SIPX_ECHO_CANCELATION) 363 #endif // DISABLE_LOCAL_AUDIO ] 457 #ifdef DEBUG_POSTPONE 458 void postPone(
int ms);
462 #ifndef DISABLE_STREAM_PLAYER 518 #endif // DISABLE_STREAM_PLAYER 530 #endif // _MpCallFlowGraph_h_ Message object used to communicate with the media processing task.
Definition: MpFlowGraphMsg.h:33
RecorderChoice
Definition: MpCallFlowGraph.h:101
OsStatus resumeFile()
Tell fromFile resource to resume playing, if previously paused.
Definition: MpCallFlowGraph.cpp:1068
MpRtpOutputConnection * mpOutputConnections[MAX_CONNECTIONS]
Definition: MpCallFlowGraph.h:378
OsStatus postNotification(const MpResNotificationMsg &msg)
posts a resource notification message to the Notification dispatcher.
Definition: MpCallFlowGraph.cpp:630
int mNumRtpStreams[MAX_CONNECTIONS]
Definition: MpCallFlowGraph.h:374
Definition: MprRecorder.h:61
void stopSendRtp(MpConnectionID connID=1)
Stops sending RTP and RTCP packets.
Definition: MpCallFlowGraph.cpp:1310
The "Tone Generator" media processing resource.
Definition: MprToneGen.h:37
The "To Speaker" media processing resource.
Definition: MprToSpkr.h:47
UtlBoolean handleStreamRealizeUrl(MpStreamMsg &rMsg)
Handle the FLOWGRAPH_STREAM_REALIZE_URL message.
Definition: MpCallFlowGraph.cpp:1714
UtlBoolean handleStreamStop(MpStreamMsg &rMsg)
Handle the FLOWGRAPH_STREAM_STOP message.
Definition: MpCallFlowGraph.cpp:1820
UtlBoolean handleStartTone(MpFlowGraphMsg &rMsg)
Handle the FLOWGRAPH_START_TONE message.
Definition: MpCallFlowGraph.cpp:1631
MprFromFile * mpFromFile
Definition: MpCallFlowGraph.h:346
The "Play audio from file" media processing resource.
Definition: MprFromFile.h:37
UtlBoolean setupRecorder(RecorderChoice which, const char *audioFileName, int time, int silenceLength, MprRecorder::RecordFileFormat format=MprRecorder::RAW_PCM_16)
Definition: MpCallFlowGraph.cpp:977
MprToneGen * mpToneGen
Definition: MpCallFlowGraph.h:370
Definition: MpCallFlowGraph.h:105
UtlBoolean mToneIsGlobal
Definition: MpCallFlowGraph.h:372
UtlBoolean handleStartRecord(MpFlowGraphMsg &rMsg)
Handle the FLOWGRAPH_START_RECORD message.
MprMixer * mpCallrecMixer
Definition: MpCallFlowGraph.h:366
The "From Microphone" media processing resource.
Definition: MprFromMic.h:42
The conference bridge resource.
Definition: MprBridge.h:57
MprMixer * mpMcastMixer[MAX_CONNECTIONS]
Definition: MpCallFlowGraph.h:377
MpCallFlowGraph & operator=(const MpCallFlowGraph &rhs)
Assignment operator (not implemented for this class)
UtlBoolean handleStreamPause(MpStreamMsg &rMsg)
Handle the FLOWGRAPH_STREAM_PAUSE message.
Definition: MpCallFlowGraph.cpp:1811
ToneOptions
Definition: MpCallFlowGraph.h:95
MpRtpInputConnection * mpInputConnections[MAX_CONNECTIONS]
Definition: MpCallFlowGraph.h:373
virtual OsStatus loseFocus(void)
Informs the flow graph that it has lost the MpMediaTask focus.
Definition: MpCallFlowGraph.cpp:594
UtlBoolean handleStopToneOrPlay(void)
Handle the FLOWGRAPH_STOP_TONE and FLOWGRAPH_STOP_PLAY messages.
Definition: MpCallFlowGraph.cpp:1668
Definition: MpCallFlowGraph.h:343
UtlBoolean isCodecSupported(SdpCodec &rCodec)
Returns TRUE if the indicated codec is supported.
Definition: MpCallFlowGraph.cpp:1453
OsBSem mConnTableLock
Definition: MpCallFlowGraph.h:371
MprBridge * mpBridge
Definition: MpCallFlowGraph.h:345
Flow graph used to handle a basic call.
Definition: MpCallFlowGraph.h:90
MprMixer * mpTFsMicMixer
Definition: MpCallFlowGraph.h:364
Play locally.
Definition: MpCallFlowGraph.h:97
MprSplitter * mpSpeakerCallrecSplitter
Definition: MpCallFlowGraph.h:368
PlayStart
Definition: MpCallFlowGraph.h:332
Message object used to communicate with the media processing task.
Definition: MpStreamMsg.h:36
virtual ~MpCallFlowGraph()
Destructor.
Definition: MpCallFlowGraph.cpp:403
UtlBoolean handleOnMprRecorderDisabled(const UtlString &resourceName)
Definition: MpCallFlowGraph.cpp:1881
The "Splitter" media processing resource.
Definition: MprSplitter.h:41
static UtlBoolean setInbandDTMF(UtlBoolean bEnable)
Enables/Disable the transmission of inband DTMF audio.
Definition: MpCallFlowGraph.cpp:1381
MprFromStream * mpFromStream
Definition: MpCallFlowGraph.h:348
static UtlBoolean setAECMode(FLOWGRAPH_AEC_MODE mode)
Set Acoustic Echo Cancelation mode.
Definition: MpCallFlowGraph.cpp:1389
void startTone(int toneId, int toneOptions)
Starts playing the indicated tone.
Definition: MpCallFlowGraph.cpp:686
Flow graph for coordinating the execution of media processing resources.
Definition: MpFlowGraphBase.h:91
int closeRecorders(void)
Definition: MpCallFlowGraph.cpp:740
MprEncode * mpEncoders[MAX_CONNECTIONS]
Definition: MpCallFlowGraph.h:379
MprSplitter * mpMicCallrecSplitter
Definition: MpCallFlowGraph.h:367
static UtlBoolean sbEnableAGC
Definition: MpCallFlowGraph.h:340
UtlBoolean handleStreamDestroy(MpStreamMsg &rMsg)
Handle the FLOWGRAPH_STREAM_DESTROY message.
Definition: MpCallFlowGraph.cpp:1850
UtlBoolean handleOnMprRecorderEnabled(const UtlString &resourceName)
Definition: MpCallFlowGraph.cpp:1860
UtlBoolean handleStopRecord(MpFlowGraphMsg &rMsg)
Handle the FLOWGRAPH_STOP_RECORD message.
void startSendRtp(OsSocket &rRtpSocket, OsSocket &rRtcpSocket, MpConnectionID connID=1, SdpCodec *pPrimaryCodec=NULL, SdpCodec *pDtmfCodec=NULL)
Starts sending RTP and RTCP packets.
Definition: MpCallFlowGraph.cpp:1289
static UtlBoolean sbEnableAEC
Definition: MpCallFlowGraph.h:339
int16_t MpAudioSample
Definition: MpTypes.h:44
Definition: MpCallFlowGraph.h:334
Definition: MpCallFlowGraph.h:67
Definition: MpCallFlowGraph.h:104
MprSplitter * mpToneFileSplitter
Definition: MpCallFlowGraph.h:369
OsStatus pauseFile()
Tell fromFile resource to pause the currently playing file, if one is being played.
Definition: MpCallFlowGraph.cpp:1057
UtlBoolean handleStartPlay(MpFlowGraphMsg &rMsg)
Handle the FLOWGRAPH_START_PLAY message for MprFromFile.
Definition: MpCallFlowGraph.cpp:1606
OsStatus recordMic(int ms, MpAudioSample *pAudioBuf, int bufferSize)
Definition: MpCallFlowGraph.cpp:892
FLOWGRAPH_AEC_MODE
Definition: MpCallFlowGraph.h:63
OsStatus record(int timeMS, int silenceLength, const char *micName=NULL, const char *echoOutName=NULL, const char *spkrName=NULL, const char *mic32Name=NULL, const char *spkr32Name=NULL, const char *echoIn8Name=NULL, const char *echoIn32Name=NULL, const char *playName=NULL, const char *callName=NULL, int toneOptions=0, int repeat=0, MprRecorder::RecordFileFormat format=MprRecorder::RAW_PCM_16)
Definition: MpCallFlowGraph.cpp:914
Definition: MpCallFlowGraph.h:333
UtlBoolean mIsMcastConnection[MAX_CONNECTIONS]
Definition: MpCallFlowGraph.h:375
FlowGraphType
Definition: MpFlowGraphBase.h:107
Definition: MpCallFlowGraph.h:112
RecordFileFormat
These match the WAVE compression format codes in the RIFF header for convenience. ...
Definition: MprRecorder.h:59
void stopTone(void)
Stops playing the tone (applies to all tone destinations).
Definition: MpCallFlowGraph.cpp:715
MprRecorder * mpRecorders[MAX_RECORDERS]
Definition: MpCallFlowGraph.h:386
The "Recorder" media processing resource.
Definition: MprRecorder.h:53
MprSplitter * mpMicSplitter
Definition: MpCallFlowGraph.h:352
The "Decode" media processing resource.
Definition: MprDecode.h:45
Definition: MpCallFlowGraph.h:335
static UtlBoolean sbSendInBandDTMF
Definition: MpCallFlowGraph.h:338
virtual UtlBoolean handleMessage(OsMsg &rMsg)
Handles an incoming message for the flow graph.
Definition: MpCallFlowGraph.cpp:1465
Definition: MpResNotificationMsg.h:31
UtlBoolean handleStreamRewind(MpStreamMsg &rMsg)
Handle the FLOWGRAPH_STREAM_REWIND message.
Definition: MpCallFlowGraph.cpp:1760
The "Speex Audio Preprocessor" media processing resource.
Definition: MprSpeexPreProcess.h:42
UtlBoolean muteInput(MpConnectionID connID)
disables hearing audio data from a source
Definition: MpCallFlowGraph.h:68
full conversation recorder
Definition: MpCallFlowGraph.h:113
virtual OsStatus gainFocus(void)
Informs the flow graph that it now has the MpMediaTask focus.
Definition: MpCallFlowGraph.cpp:544
Connection container for the inbound and outbound network paths to a single remote party...
Definition: MpRtpOutputConnection.h:47
The "Echo suppress" media processing resource.
Definition: MprEchoSuppress.h:39
The "Encode" media processing resource.
Definition: MprEncode.h:41
Definition: MpCallFlowGraph.h:114
UtlBoolean muteOutput(MpConnectionID connID)
disables sending audio data to a remote party
MpCallFlowGraph(const char *pLocale="", int samplesPerFrame=0, int samplesPerSec=0, OsMsgDispatcher *pNotifDispatcher=NULL)
Default constructor.
Definition: MpCallFlowGraph.cpp:81
MpConnectionID createConnection(int maxRtpStreams=1, UtlBoolean isMcast=FALSE)
Creates a new MpAudioConnection; returns -1 if failure.
Definition: MpCallFlowGraph.cpp:1097
static UtlBoolean setAudioNoiseReduction(UtlBoolean bEnable)
Enable/disable speex noise reduction.
Definition: MpCallFlowGraph.cpp:1432
The "Mixer" media processing resource.
Definition: MprMixer.h:36
Definition: MpCallFlowGraph.h:66
OsStatus playFile(const char *audioFileName, UtlBoolean repeat, int toneOptions, UtlBoolean autoStopOnFinish=TRUE)
Start playing audio from a file.
Definition: MpCallFlowGraph.cpp:1001
UtlBoolean handleStreamRealizeBuffer(MpStreamMsg &rMsg)
Handle the FLOWGRAPH_STREAM_REALIZE_BUFFER message.
Definition: MpCallFlowGraph.cpp:1732
int MpConnectionID
Flowgraph connection ID.
Definition: MpTypes.h:56
MprFromMic * mpFromMic
Definition: MpCallFlowGraph.h:351
UtlBoolean handleStreamPlay(MpStreamMsg &rMsg)
Handle the FLOWGRAPH_STREAM_PLAY message.
Definition: MpCallFlowGraph.cpp:1771
OsStatus Record(int ms, const char *playFilename, const char *baseName, const char *endName, int recorderMask)
Definition: MpCallFlowGraph.cpp:780
static UtlBoolean sbEnableNoiseReduction
Definition: MpCallFlowGraph.h:341
The "Speex Echo Canceler" media processing resource.
Definition: MprSpeexEchoCancel.h:49
void stopFile(UtlBoolean closeFile)
Stop playing audio from a file.
Definition: MpCallFlowGraph.cpp:1080
Definition: MpCallFlowGraph.h:65
void stopReceiveRtp(MpConnectionID connID=1)
Stops receiving RTP and RTCP packets.
Definition: MpCallFlowGraph.cpp:1365
virtual MpFlowGraphBase::FlowGraphType getType()
Returns the type of this flow graph.
Definition: MpCallFlowGraph.cpp:1445
UtlBoolean mToneGenDefocused
disabled during defocused state flag
Definition: MpCallFlowGraph.h:380
static UtlBoolean setAGC(UtlBoolean bEnable)
Enable/disable Automatic Gain Control.
Definition: MpCallFlowGraph.cpp:1422
MprDecode ** mpDecoders[MAX_CONNECTIONS]
Definition: MpCallFlowGraph.h:376
#define TRUE
Definition: PlgDefsV1.h:41
#define FALSE
Definition: PlgDefsV1.h:37
UtlBoolean handleStreamPrefetch(MpStreamMsg &rMsg)
Handle the FLOWGRAPH_STREAM_PREFETCH message.
Definition: MpCallFlowGraph.cpp:1750
OsStatus deleteConnection(MpConnectionID connID)
Removes an MpAudioConnection and deletes it and all its resources.
Definition: MpCallFlowGraph.cpp:1252
OsStatus playBuffer(char *audioBuf, unsigned long bufSize, uint32_t inRate, int type, UtlBoolean repeat, int toneOptions, OsProtectedEvent *event=NULL, UtlBoolean autoStopOnFinish=TRUE)
Start playing audio from a buffer passed in.
Definition: MpCallFlowGraph.cpp:1026
MprToSpkr * mpToSpkr
Definition: MpCallFlowGraph.h:362
void startReceiveRtp(SdpCodec *pCodecs[], int numCodecs, OsSocket &rRtpSocket, OsSocket &rRtcpSocket, MpConnectionID connID=1)
Starts receiving RTP and RTCP packets.
Definition: MpCallFlowGraph.cpp:1326
MprMixer * mpTFsBridgeMixer
Definition: MpCallFlowGraph.h:365
UtlBoolean unmuteOutput(MpConnectionID connID)
enables sending audio data to a remote party
MprRecorder * mpBufferRecorder
Definition: MpCallFlowGraph.h:353
UtlBoolean unmuteInput(MpConnectionID connID)
enables hearing audio data from a source
Definition: MpCallFlowGraph.h:103
This resource is an insertion point for the streaming infrastructure by connecting the flowgraph to M...
Definition: MprFromStream.h:73
Mix the tone to play out the network connection.
Definition: MpCallFlowGraph.h:98
UtlBoolean handleRemoveConnection(MpFlowGraphMsg &rMsg)
Handle the FLOWGRAPH_REMOVE_CONNECTION message.
Definition: MpCallFlowGraph.cpp:1545