亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? jb_utl.cpp

?? 基于h323協議的軟phone
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
       if( bufLen % framesize )
        {
            frames++;
            
            /* pad remainder with ff */
//            cmMemset((U8*)putBuffer+bufLen, 0xff, (frames*framesize)-bufLen);
     
            memset((U8*)putBuffer+bufLen, 0xff, (frames*framesize)-bufLen);
            bufLen = frames * framesize;
        }
      //  connCb->jitter.curTimestamp += (frames * JB_10MS_TIMESTAMP);
    }
    /* slm: MR3327 add support for G723 variable bitrates */
    /* check if we have mixed G723 frames in the buffer */
    else if( connCb->key.rxCodec == JB_G723 )
    {
        /*
            The least significant two bits of the first octet in
            the frame determine the frame size and codec type:
            bits  content                      octets/frame
            00    high-rate speech (6.3 kb/s)            24
            01    low-rate speech (5.3 kb/s)             20
            10    SID frame                               4
            11    reserved
        */
        U8 type;
        U32 offset = 0;
        frames = 0;
        while( offset < bufLen )
        {
            type = putBuffer[offset] & 0x3;
            frames++;
            switch( type )
            {
                /* G723 6.3Kbps frame */
                case 0:
                    offset += JB_G723_6_RAW_FRAME_SIZE;
                    break;
                /* G723 5.3Kbps frame */
                case 1:
                    offset += JB_G723_5_RAW_FRAME_SIZE;
                    break;
                /* G723 SID frame */
                case 2:
                    offset += JB_G723_SID_RAW_FRAME_SIZE;
                    break;
                /* Bad header in the packet, skip the data */
                default:
                    offset = bufLen;
                    break;
            }
        }
		
       // connCb->jitter.curTimestamp += (frames * 3 * JB_10MS_TIMESTAMP);
    }
    else
    {
        /* slm: MR8849 convert frames from ms to number of 10ms dsp frames */
        if( connCb->key.rxCodec == JB_G722 )
            frames = frames / JB_G722_MS_PER_FRAME;
        else if( connCb->key.rxCodec == JB_G726_32 )
            frames = frames / JB_G726_32_MS_PER_FRAME;
        else
            frames = frames / JB_G711_MS_PER_FRAME;

        //connCb->jitter.curTimestamp += (frames * JB_10MS_TIMESTAMP);
    }

/* debug JB out */
#ifdef DEBUG_JB
{
unsigned char foo[4];
static int speech = 0;
foo[0] = putBuffer[0] | 0x80;
foo[1] = putBuffer[1] | 0x80;
foo[2] = putBuffer[2] | 0x80;
foo[3] = putBuffer[3] | 0x80;
/* check for speech */
if((speech == 0) && ((foo[0] < 0xf0) && (foo[1] < 0xf0) && (foo[2] < 0xf0) && (foo[3] < 0xf0)))
{
    speech = 1;
    gGpio |= (1 << 8);
    if( isT8300 )
        *((volatile ULONG *)0xE000C014) = gGpio;
}
/* check for silence */
if((speech == 1) && ((foo[0] >= 0xf8) && (foo[1] >= 0xf8) && (foo[2] >= 0xf8) && (foo[3] >= 0xf8)))
{
    speech = 0;
    gGpio &= ~(1 << 8);
    if( isT8300 )
        *((volatile ULONG *)0xE000C014) = gGpio;
}
if( jbdbg_d_index && jbdbg_d_index < MAX_JBDBG )
{
jbdbg_d[jbdbg_d_index-1].frames = frames;
jbdbg_d[jbdbg_d_index-1].length = bufLen;
jbdbg_d[jbdbg_d_index-1].seq = connCb->jitter.jBuf[nextP].seqNum;
jbdbg_d[jbdbg_d_index-1].pkttimestamp = connCb->jitter.jBuf[nextP].timeStamp;
}
}
#endif

	
//    semGive(jbCb.sem);


#if 0/***remove by chen for delay**/
    /* slm: MR8849 now use array of coders for multiple lines */
    if (connCb->connIndex == jbCb.activeConn[connCb->key.lineNo])
    {
	
	
        /* slm: MR4386 Need semaphore to protect DSP writes */
        semTake(jbCb.dspSem[connCb->key.lineNo], WAIT_FOREVER);
//        jbCb.dspSem[connCb->key.lineNo].lock();
	//printf("putbufferbegin = %d\n",tickGet());
	  
     if(dspApiDecoder[connCb->key.lineNo])
            dspApiDecoder[connCb->key.lineNo]->putBuffer(putBuffer, frames, bufLen);
	
     //   if(dspApiDecoder[1])
         //   dspApiDecoder[1]->putBuffer(putBuffer, frames, bufLen,1);
	
	//printf("numpacket =%d\n",connCb->sts.numPackets);
	//printf("frames =%d\n",frames);
	//printf("playnumseq =%d\n",connCb->jitter.jBuf[nextP].seqNum);
//	if(codecIndex != -1 && dspApiDecoder[codecIndex])
//            dspApiDecoder[codecIndex]->putBuffer(putBuffer, frames, bufLen);

        semGive(jbCb.dspSem[connCb->key.lineNo]);

//        jbCb.dspSem[connCb->key.lineNo].unlock();
    }
#endif
       connCb->jitter.curTimestamp = connCb->jitter.jBuf[nextP].timeStamp;
       dspBuffer.bufLen = bufLen;
	dspBuffer.frames = frames;
	dspBuffer.putBuffer = putBuffer;
	//printf("putbufferend = %d\n",tickGet());
    RETVALUE(ROK);
#endif	
} /* JbRemovePacket */

/*
*
*       Fun:   JbUpdateJitter
*
*       Desc:  This function is used to update the buffer parameters
*
*       Ret:   ROK on success and RFAILED on failure
*
*       Notes:
*
*       File:  jb_utl.c
*
*/
#ifdef ANSI
PUBLIC S16 JbUpdateJitter
(
JbConnCb *connCb,       /* connection control block */
JbEvent event           /* current event */
)
#else
PUBLIC S16 JbUpdateJitter(connCb, event)
JbConnCb *connCb;       /* connection control block */
JbEvent event;          /* current event */
#endif
{
    U8 currentJitter;
    S32 tempSize;

//    TRC3(JbUpdateJitter)

	/*
	 * MR: 4213
	 * Don't attempt to adjust the jitter buffer until we have
	 * received the first audio packet.  This prevents us from
	 * thinking that PLAY has run dry at the beginning of the call
	 * This way we always start the call with the minimum-sized
	 * jitter buffer
	 *
	 */
	if(connCb->jitter.gotFirst == 1)
    	currentJitter = abs(connCb->jitter.receivePacketCount - connCb->jitter.playPacketCount);
	else
		connCb->jitter.playPacketCount = 0;

    if (event == JB_RECEIVE_PACKET)
    {
        if (connCb->jitter.playPacketCount == 0)
            RETVALUE(ROK);
        connCb->jitter.playPacketCount = 0;
    }
    else
    {
        if (connCb->jitter.receivePacketCount == 0)
            RETVALUE(ROK);
        connCb->jitter.receivePacketCount = 0;
    }

    connCb->jitter.maxJitter = MAX(currentJitter, connCb->jitter.maxJitter);
    /* slm: MR4213
    ** Why is currentJitter being set to MAX().  For one thing, this is redundant with
    ** maxJitter above.  And for another thing, setting it to MAX() means it'll never
    ** report if the currentJitter shrinks.
    ** connCb->sts.currentJitter = MAX(currentJitter, connCb->sts.currentJitter);
    ** Set it to currentJitter instead.
    */
    connCb->sts.currentJitter = currentJitter;
    if (currentJitter > connCb->sts.jitterBufferSize)
    {
        tempSize = MULTPERCENT(currentJitter,jbCb.jitCfg.incAmount);
        if (tempSize < connCb->jitter.maxLatency)
        {
//printf("j>b jit:%u buf:%u t:%u r:%u p:%u\n",currentJitter, connCb->sts.jitterBufferSize, tempSize,connCb->jitter.receivePacketCount,connCb->jitter.playPacketCount);
            connCb->sts.jitterBufferSize = tempSize;
        }
        connCb->jitter.currentStableTime = 0;
        connCb->jitter.bufferCreep = 0;
    }
    else /* current jitter is <= jitter Buffer Size */
    {
        /* Bump stable time only if it hasn't already hit the limit (prevent rollover) */
        if (connCb->jitter.currentStableTime < jbCb.jitCfg.minStableTime)
            connCb->jitter.currentStableTime++;

        if (connCb->jitter.currentStableTime >= jbCb.jitCfg.minStableTime)
        {
            tempSize = MULTPERCENT(connCb->sts.jitterBufferSize, jbCb.jitCfg.decAmount);
            if (( tempSize < connCb->sts.jitterBufferSize ) && ( tempSize >= jbCb.jitCfg.minSize ))
            {
//printf("j<b jit:%u buf:%u t:%u\n", currentJitter, connCb->sts.jitterBufferSize, tempSize);
                connCb->sts.jitterBufferSize = tempSize;
                connCb->jitter.currentStableTime = 0;
                /* MR4213
                ** our jitter has dropped down, so we may need to adjust
                ** the number of packets in our queue in order to maintain
                ** minimal the path delay */
                connCb->jitter.bufferDrop = 2;
                connCb->jitter.bufferCreep = 0;
            }
            /* check for buffer creep */
            /* If we are actively playing packets and the number of packets in the JB is
            ** growing bigger than the jitterbuffer size, it means we are rcving packets
            ** at a slightly higher rate than we are playing them out.  We need to adjust
            ** for this creep by dropping a buffer */
            else if(( event == JB_PLAY_PACKET ) && ( connCb->jitter.state == JB_ACTIVE_PLAY ) &&
                    ( connCb->sts.numPackets > connCb->sts.jitterBufferSize ))
            {
                connCb->jitter.bufferCreep++;
                if( connCb->jitter.bufferCreep > 100 )
                {
                    connCb->jitter.bufferDrop = 1;
                    connCb->jitter.bufferCreep = 0;
                }
            }
        }
    }

    RETVALUE(ROK);
} /* JbUpdateJitter */

/*
*
*       Fun:   jbAddPacket
*
*       Desc:  This function add a packet to the buffer
*
*       Ret:   ROK on success and RFAILED on failure
*
*       Notes:
*
*       File:  jb_utl.c
*
*/
#ifdef ANSI
PRIVATE S16 jbAddPacket
(
U16 seq,                /* Sequence number of packet */
U32 timeStamp,          /* Timestamp of packet */
CoderInfo rxCodec,      /* Receive Codec */
Data *dBuf,             /* Source Data to insert */
JBuf *dest,             /* Dest Jitter Buffer */
U32  frameSize          /* size of the frame to send */
)
#else
PRIVATE S16 jbAddPacket(seq, timeStamp, rxCodec, dBuf, dest, frameSize)
U16 seq;                /* Sequence number of packet */
U32 timeStamp;          /* Timestamp of packet */
CoderInfo rxCodec;      /* Receive Codec */
Data *dBuf;             /* Source Data to insert */
JBuf *dest;             /* Dest Jitter Buffer */
U32  frameSize;         /* size of the frame to send */
#endif
{
    S16 i;

//    TRC3(jbAddPacket)

    if ((!dest) || (!dBuf))
    {
          RETVALUE(RFAILED);
    }

    dest->seqNum = seq;
    dest->timeStamp = timeStamp;
    /* slm: save the data buffer size */
    dest->len = frameSize;

//    cmMemcpy((U8*)dest->buffer, (U8*)dBuf, frameSize);
	memcpy((U8*)dest->buffer, (U8*)dBuf, frameSize);

    RETVALUE(ROK);
} /* jbAddPacket */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久亚洲一区二区三区青草| 色菇凉天天综合网| www.综合网.com| 在线播放欧美女士性生活| 国产午夜精品福利| 日日摸夜夜添夜夜添亚洲女人| 国产aⅴ综合色| 欧美va亚洲va| 亚洲成在人线在线播放| 成人影视亚洲图片在线| 欧美电视剧在线看免费| 一区二区三区在线视频免费| 国产精品资源站在线| 欧美精品久久久久久久多人混战| 欧美激情一区二区在线| 韩国v欧美v亚洲v日本v| 日韩欧美国产电影| 香蕉成人啪国产精品视频综合网| 一本久道久久综合中文字幕 | 欧美mv日韩mv国产| 亚洲一区免费观看| 97精品久久久午夜一区二区三区| 2021中文字幕一区亚洲| 捆绑紧缚一区二区三区视频| 欧美日韩精品一区二区在线播放| 亚洲欧美激情插| proumb性欧美在线观看| 亚洲国产精品国自产拍av| 国产精品一二三区在线| 久久一夜天堂av一区二区三区| 日本va欧美va瓶| 日韩一区二区三| 日韩一区精品字幕| 91精品国产91久久久久久一区二区 | 国产高清成人在线| 精品国产乱码久久久久久浪潮| 亚洲v精品v日韩v欧美v专区| 欧美区一区二区三区| 天堂成人免费av电影一区| 在线成人免费观看| 日韩精品久久理论片| 欧美一二三区在线| 狠狠色丁香久久婷婷综合_中| 久久久久久久综合色一本| 国产福利精品一区| 国产精品久久久爽爽爽麻豆色哟哟| 成人ar影院免费观看视频| 亚洲欧洲精品一区二区三区不卡 | 亚洲欧洲一区二区三区| 91麻豆国产精品久久| 亚洲九九爱视频| 欧美浪妇xxxx高跟鞋交| 蜜桃精品视频在线观看| 国产午夜亚洲精品理论片色戒| 国产成人免费在线| 日韩理论在线观看| 欧美亚洲一区三区| 麻豆精品在线播放| 中文一区二区在线观看| 91久久精品网| 国产91精品精华液一区二区三区| 综合在线观看色| 91麻豆精品国产91久久久使用方法| 老汉av免费一区二区三区| 国产亚洲午夜高清国产拍精品| 色综合天天综合在线视频| 肉丝袜脚交视频一区二区| 久久久久久免费毛片精品| 91成人在线观看喷潮| 久久99这里只有精品| 国产精品久久久久久久裸模| 91精品在线观看入口| 成人午夜电影久久影院| 天堂蜜桃91精品| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 欧美日韩国产电影| 国产精品一线二线三线精华| 一区二区三区av电影| 欧美va亚洲va香蕉在线| 在线观看av一区| 国产精品1区二区.| 日韩成人一区二区三区在线观看| 欧美极品aⅴ影院| 欧美一区二区三区视频在线观看 | 国产欧美1区2区3区| 欧美三级日本三级少妇99| 国产成人综合网| 日韩vs国产vs欧美| 亚洲女同女同女同女同女同69| 精品剧情在线观看| 欧美高清视频不卡网| 99国产精品国产精品久久| 国产乱子伦一区二区三区国色天香| 亚洲激情一二三区| 国产精品美女一区二区三区 | 麻豆成人久久精品二区三区小说| 亚洲欧美经典视频| 国产精品午夜电影| 亚洲欧洲精品一区二区三区不卡 | 国产专区欧美精品| 日本成人中文字幕| 亚洲午夜久久久久| 亚洲免费观看视频| 国产精品色哟哟网站| 国产亚洲精品7777| 精品国一区二区三区| 欧美一区二区三区视频在线观看| 欧美亚洲一区二区三区四区| 色婷婷综合久久久中文字幕| 成人丝袜高跟foot| 国产激情91久久精品导航 | 在线成人午夜影院| 欧美三级韩国三级日本三斤| 色哟哟欧美精品| 色哦色哦哦色天天综合| 91在线丨porny丨国产| youjizz国产精品| 91在线观看地址| 色婷婷综合久色| 欧美视频在线播放| 欧美乱熟臀69xxxxxx| 欧美嫩在线观看| 欧美一级黄色录像| 久久综合狠狠综合| 国产精品三级av在线播放| 中文在线资源观看网站视频免费不卡| 久久久久久久久久久黄色| 国产丝袜美腿一区二区三区| 国产欧美一区二区精品性色 | 日韩欧美视频一区| www激情久久| 欧美激情一区二区三区| 国产精品传媒在线| 亚洲国产婷婷综合在线精品| 日韩二区三区四区| 国产一区二区三区在线观看精品| 国产福利一区在线| 色综合久久综合| 欧美日韩国产大片| 久久噜噜亚洲综合| 亚洲色图视频网| 日韩在线a电影| 欧美专区在线观看一区| 欧美一三区三区四区免费在线看| 欧美精品一区二区三区很污很色的 | 国产一区二区三区四区在线观看| 国产69精品久久99不卡| 日本精品一区二区三区四区的功能| 欧美性大战久久久久久久蜜臀| 欧美一级国产精品| 国产精品久久久久7777按摩| 亚洲成av人片一区二区三区| 极品尤物av久久免费看| av电影一区二区| 欧美一区二区三区在线看| 欧美国产在线观看| 天涯成人国产亚洲精品一区av| 国产精品系列在线播放| 欧美在线一二三| 久久久777精品电影网影网| 亚洲综合激情网| 国产成人在线视频网址| 欧美人与禽zozo性伦| 国产情人综合久久777777| 偷偷要91色婷婷| 99久久久无码国产精品| 精品欧美黑人一区二区三区| 亚洲欧美日韩国产手机在线| 国产乱国产乱300精品| 在线观看区一区二| 欧美国产日韩亚洲一区| 毛片av一区二区三区| 欧美视频在线播放| 综合色中文字幕| 91精品久久久久久久91蜜桃| 亚洲色图在线视频| 粉嫩av亚洲一区二区图片| 3751色影院一区二区三区| 亚洲人成网站色在线观看| 粉嫩欧美一区二区三区高清影视| 在线不卡中文字幕播放| 一区二区三区影院| av亚洲精华国产精华精华| 久久精品日韩一区二区三区| 免费高清在线视频一区·| 欧美色窝79yyyycom| 亚洲丝袜另类动漫二区| 国产成人在线网站| 2020日本不卡一区二区视频| 日韩电影在线一区| 欧美日本精品一区二区三区| 亚洲福利视频导航| 欧美综合在线视频| 亚洲一区二区影院| 欧美主播一区二区三区| 亚洲美女一区二区三区| 99在线热播精品免费| 国产精品久久久久久久久免费桃花| 国产高清亚洲一区| 国产精品久久看|