?? jb.x
字號:
/********************************************************************20**
Name: JitterBuffer
Type: C include file
Desc: Structures, variables and typedefs required by H.323
control layer
File: jb.x
Sid: jb.x 1.0 - 01/19/2000
Prg: sdg
*********************************************************************21*/
#ifndef __JBX__
#define __JBX__
//#include <vector.h>
//#include "VMutex.h"
using namespace std;
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <semLib.h>
/* include all the module specific files */
/* typedefs */
/* forward type declarations */
/***********************************************************************
Gen Config Structure
***********************************************************************/
typedef struct jbGenCfg
{
Bool cfgDone; /* Flag to say if GenCfg is done */
S16 maxConnections; /* Max number of active conn */
S16 maxSize; /* Max size of buffer in packets
(must be a power of 2) */
} JbGenCfg;
/***********************************************************************
Buffer Config Structure
***********************************************************************/
typedef struct jbJitterCfg
{
/* slm: changed maxLatency to 16 bit to be consistent */
U16 maxLatency; /* Maximum level the Jitter Buffer
is allowed to fill in packets */
U16 maxHoldTime; /* Maximum number of playAttempts to wait
before releasing a packet, represented
as a percentage of the HWM */
U8 minSize; /* Minimum size of the Buffer in packets */
U8 minStableTime; /* Minimum time the jitter needs to be less
than the HWM before the HWM is reduced */
U16 incAmount; /* Used to increase the HWM */
U16 decAmount; /* Used to decrease the HWM */
// TmrCfg longSilenceTimer; /* Used to determine the cause of an underflow */
U16 longSilenceTimer;
} JbJitterCfg;
/***********************************************************************
Buffer Structure
***********************************************************************/
typedef struct jBuf
{
U32 seqNum; /* sequence number of packet. */
U32 len; /* slm: length of data in buffer.
This equals 0 if empty */
Ticks timeStamp; /* timestamp of packet */
Data *buffer; /* pointer to data buffer */
} JBuf;
/***********************************************************************
Jitter Structure
***********************************************************************/
typedef struct jitter
{
U8 p; /* play index in buffer */
U8 q; /* put index in buffer */
U8 maxJitter; /* max jitter in currentStableTime */
U8 currentStableTime; /* time jitter has been less than hwm */
U8 playAttempts; /* number playAttempts in ActiveHold state */
U8 receivePacketCount; /* number of received packets in a row */
U8 playPacketCount; /* number of played packet in a row */
U8 gotFirst; /* got first pkt */
U8 bufferDrop; /* slm: MR4213 flag to indicate dropping buffer */
U8 bufferCreep; /* slm: MR4213 counter to watch for buffer creep */
U16 lastSeqNum; /* last seq# received */
U16 maxLatency; /* max latency in packets */
U16 dropWait; /* slm: MR4213 wait count for stable packets before drop */
U16 maxAlSduFrames; /* slm: MR4213 max frames */
Ticks curTimestamp; /* slm: MR4213 current timestamp */
JBuf *jBuf; /* pointer to the jitter buffer */
JbState state; /* jitter state */
} Jitter;
/***********************************************************************
Connection stats
***********************************************************************/
typedef struct jbConnSts
{
S32 packetsTx; /* Transmitted packets to RTP */
S32 packetsRx; /* Received packets from DSP */
S32 packetsLate; /* This gets incremented when there
isn't room to put a packet before
the q pointer */
S32 packetsDropped; /* Total number of packets dropped */
S32 packetsLost; /* This gets incremented when the buffer
tries to play an empty packet */
S32 packetsRedundant; /* This gets incremented when the
buffer attempts to insert a packet
in a non-empty slot in the buffer */
S32 breaks; /* Total number of speech breaks */
S32 numPackets; /* Current level of jitter buffer */
S32 jitterBufferSize; /* Current High Water Mark */
S32 currentJitter;
} JbConnSts;
/***********************************************************************
Connection key
***********************************************************************/
typedef struct jbConnKey
{
S32 sessionId; /* ID of current session */
// SpId spId; /* Service provider ID of session */
CoderInfo txCodec; /* Tx Codec type */
CoderInfo rxCodec; /* Rx Codec type */
S16 lineNo; /* slm: MR8849 add line number */
} JbConnKey;
/***********************************************************************
Jitter Buffer Stats
***********************************************************************/
typedef struct jbCbSts
{
S32 totalConnections; /* Total connections since init */
S32 activeConnections; /* Current number of connections */
} JbCbSts;
/***********************************************************************
Connection control block
***********************************************************************/
typedef struct jbConnCb
{
// CmHashListEnt conn;
U8 connIndex; /* Index into jbCb connection list */
JbConnKey key; /* Hash list key */
JbConnSts sts; /* Connection stats */
Jitter jitter; /* Buffer Structure */
} JbConnCb;
/***********************************************************************
Management Structure
***********************************************************************/
typedef struct jbCfg
{
ConfigType type; /* type of config request */
union
{
JbGenCfg genCfg; /* General Config Structure */
JbJitterCfg jitterCfg; /* Buffer Config Structure */
} c;
} JbCfg;
typedef struct jbSts
{
StatsType type; /* type of stats requested */
Bool clearConnSts; /* Flag to clear conn stats */
union
{
JbCbSts jbCbSts; /* Control Block Stats */
JbConnSts jbConnSts; /* Connection Stats */
} s;
} JbSts;
/***********************************************************************
JitterBuffer Global Control Block
***********************************************************************/
typedef struct jbCb
{
// CmHashListCp connHlCp; /* Hash list containing all active connections */
// TskInit jbInit; /* Init Structure for jb */
vector<JbConnCb> connHlCp;
JbGenCfg genCfg; /* General config structure */
JbJitterCfg jitCfg; /* Buffer config structure */
JbCbSts sts; /* Jitter Buffer System Stats */
// JbConnKey **conn; /* List of Connection Keys */
// CmTqCp jbTqCp; /* Jitter Buffer Timing Queue Control Point */
// CmTqType jbTq[JB_TQSIZE]; /* Jitter Buffer Timing Queue */
// CmTimer *jbTimers; /* Jitter Buffer Timers */
vector<JbConnKey*> conn;
vector<int> jbTimers;
/* slm: MR8849 now use array of activeConn for multiple lines */
U8 activeConn[JB_MAX_LINENUMS]; /* Index of Active call in Conn Key List */
S16 timerRes;
// VMutex sem;
SEM_ID sem;
/* slm: MR8849 now use array of dspSem for multiple lines */
// VMutex dspSem[JB_MAX_LINENUMS]; /* slm: MR4386 need to protect accesses
// to DSP from multiple writes */
SEM_ID dspSem[JB_MAX_LINENUMS];
} JbCb;
/* slm: MR4213 - FIXME - jb structs MUST MATCH hi structs
** in order for JbReadSocket() to work properly
** Add JbTxSts struct to match HiTxSts struct
** Change JbSap struct to match HiSap Struct
** Change JbConCb struct to match HiConCb struct
** Whenever hi struct changes - due to Trillium patches -
** These structures must be updated to match
** This is not an optimal solution, better way would be
** to include the HI.X file */
/* Transmit statistics */
//typedef struct jbTxSts
//{
// StsCntr numCons;
// StsCntr numTxTcpMsg;
// StsCntr numTxUdpMsg;
// StsCntr numTxbytes;
//#ifdef HI_REL_1_3
// StsCntr numTxRawMsg;
//#endif /* HI_REL_1_3 */
//
//} JbTxSts;
/* SAP based on HiSap */
/* This struct MUST match HiSap structure */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -