sipxmedialib  Version 3.3
MpMisc.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006-2012 SIPez LLC. All rights reserved.
3 //
4 // Copyright (C) 2004-2006 SIPfoundry Inc.
5 // Licensed by SIPfoundry under the LGPL license.
6 //
7 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
8 // Licensed to SIPfoundry under a Contributor Agreement.
9 //
10 // $$
12 
13 #ifndef _INCLUDED_MPMISC_H /* [ */
14 #define _INCLUDED_MPMISC_H
15 
16 // Forward declarations
17 class OsConfigDb;
18 
19 #include "os/OsMsgQ.h"
20 #include "mp/MpTypes.h"
21 #include "mp/MpBufPool.h"
22 #include "mp/MpAudioBuf.h"
23 
24 /* miscellaneous debugging support: */
25 
26 #define Zprintf printf
27 #undef Zprintf
28 #define Zprintf(fmt, a, b, c, d, e, f)
29 #define Nprintf(fmt, a, b, c, d, e, f)
30 #define Lprintf(fmt, a, b, c, d, e, f)
31 
32 extern MpBufPool** sMpBufPools[];
33 
34 extern int sMpNumBufPools;
35 
36 /* mpStartUp initializes the MpMisc struct and other MP data, for */
37 /* example, the buffer pools and tables */
38 extern OsStatus mpStartUp(int sampleRate, int samplesPerFrame,
39  int numAudioBuffers, OsConfigDb* pConfigDb,
40  const size_t numCodecPaths, const UtlString codecPaths[]);
41 
42 /* tears down whatever was created in mpStartUp */
43 extern OsStatus mpShutdown(void);
44 
45 /* mpStartTasks spawns the low level MP tasks for DMA and network I/O */
46 extern OsStatus mpStartTasks(void);
47 
48 /* mpStopTasks stops the low level MP tasks */
49 extern OsStatus mpStopTasks(void);
50 
51 /* Log to syslog buffer statistics with the given log label */
52 void mpLogBufferStats(const char* label);
53 
54 /* Get buffer pool statistics */
55 /* void mpGetBufferPoolStats(int numPools, UtlString poolNames[], int freeCount, int totalCount[]); */
56 
58 struct __MpGlobals {
59  OsMsgQ* pMicQ;
60  OsMsgQ* pSpkQ;
61  OsMsgQ* pEchoQ;
62  int frameSamples;
64  int frameBytes;
73 #ifdef REAL_RTCP // [ This is just a reminder - we should implement MpRtcpBuf
75  MpBufPool *RtcpHeadersPool;
76 #endif // REAL_RTCP ]
85  int max_mic_buffers;
89 };
90 
91 extern struct __MpGlobals MpMisc;
92 
93 #endif /* _INCLUDED_MPMISC_H ] */
MpAudioBufPtr comfortNoise
Definition: MpMisc.h:84
int samplesPerFrame
OsStatus mpStopTasks(void)
Definition: MpMisc.cpp:852
MpAudioBufPtr mpFgSilence
Definition: MpMisc.h:80
MpBufPool * UdpPool
Memory pool for raw UDP packets.
Definition: MpMisc.h:77
This structure contain all static variables.
Definition: MpMisc.h:58
int sMpNumBufPools
Definition: MpMisc.cpp:118
void mpLogBufferStats(const char *label)
Definition: MpMisc.cpp:862
int frameBytes
Size of one audio frame.
Definition: MpMisc.h:64
OsMsgQ * pMicQ
Message queue for microphone data.
Definition: MpMisc.h:59
int max_spkr_buffers
Maximum messages in spkr queue (soft limit)
Definition: MpMisc.h:88
struct __MpGlobals MpMisc
Definition: MpMisc.cpp:101
MpBufPool * RtpHeadersPool
Definition: MpMisc.h:72
Smart pointer to MpAudioBuf.
Definition: MpAudioBuf.h:168
OsStatus mpStartTasks(void)
Definition: MpMisc.cpp:837
MpBufPool * RawAudioPool
Memory pool for raw audio data buffers.
Definition: MpMisc.h:67
int max_mic_buffers
Maximum messages in mic queue (soft limit)
Definition: MpMisc.h:87
OsStatus mpStartUp(int sampleRate, int samplesPerFrame, int numAudioBuffers, OsConfigDb *pConfigDb, const size_t numCodecPaths, const UtlString codecPaths[])
Definition: MpMisc.cpp:462
OsMsgQ * pEchoQ
Definition: MpMisc.h:61
int frameSamples
Number of samples in one audio frame.
Definition: MpMisc.h:63
MpBufPool * AudioHeadersPool
Definition: MpMisc.h:68
MpBufPool * UdpHeadersPool
Definition: MpMisc.h:78
MpBufPool * RtcpPool
Memory pool for RTCP data buffers.
Definition: MpMisc.h:71
OsStatus mpShutdown(void)
Definition: MpMisc.cpp:752
int rtpMaxBytes
Maximum bytes in an RTP packet.
Definition: MpMisc.h:66
OsMsgQ * pSpkQ
Message queue for speaker data.
Definition: MpMisc.h:60
MpBufPool ** sMpBufPools[]
Definition: MpMisc.cpp:104
MpBufPool * RtpPool
Memory pool for RTP data buffers.
Definition: MpMisc.h:70
int sampleBytes
Size of one audio sample (in bytes)
Definition: MpMisc.h:65
Pool of buffers.
Definition: MpBufPool.h:32