[Live-devel] Problem in live555 DelayQueue::synchronize()

laimaoli at 126.com laimaoli at 126.com
Thu May 29 01:38:03 PDT 2014


Hi,I have a problem, such as the following, I had change the code about "read the file" ,and replace   this place as "get a frame data from the camera"。Could you help me ,or give me some advices。
I had trouble this question about 2weeks .
code as 

void H264FramedLiveSource::getNextFrame1() 
{ 
    int pos = 0; 
    fFrameSize = 0; 
    bool bflag =false; 


    while(1) 
    { 
        while(1) 
        { 
            if(pEncodeOperater != NULL && pEncodeOperater->nVedioID == 1) 
            { 
                pEncodeOperater->encode_getframe(); 
                vbuf = pEncodeOperater->enc->virt_bsbuf_addr + pEncodeOperater->outinfo->bitstreamBuffer - pEncodeOperater->enc->phy_bsbuf_addr; 
                fFrameSize = pEncodeOperater->outinfo->bitstreamSize; 
                if(nCount  == 0) 
                { // sps first frame 
                    memcpy(fTo,(char *)pEncHead[0]+sizeof(int),*(int*)pEncHead[0]); 
                     memcpy(fTo+(*(int*)pEncHead[0]),(char *)pEncHead[1]+sizeof(int),*(int*)pEncHead[1]); 
                    fFrameSize += (*(int*)pEncHead[0]) + (*(int*)pEncHead[1]); 
                     bflag = true; 
                } 

                if( fFrameSize > fMaxSize) 
                { 
                       fNumTruncatedBytes = fFrameSize - fMaxSize; 
                        fFrameSize = fMaxSize; 
                } 
                else 
                { 
                    fNumTruncatedBytes = 0; 
                } 

                if(bflag == true) 
                { 
                    memmove(fTo +(*(int*)pEncHead[0]) + (*(int*)pEncHead[1]),(void *)vbuf,fFrameSize - (*(int*)pEncHead[0]) + (*(int*)pEncHead[1])); 
                    bflag = false; 
                } 
                else 
                { 
                    memmove(fTo ,(void *)vbuf,fFrameSize); 
                } 
                
                gettimeofday(&fPresentationTime, NULL); 
                afterGetting(this); 
        } 
    } 
}


_Debug as following:
70 fFrameSize 2083-- -fMaxSize 116501 fNumTruncatedBytes:0 

71 fFrameSize 2102-- -fMaxSize 116501 fNumTruncatedBytes:0 

72 fFrameSize 2334-- -fMaxSize 116501 fNumTruncatedBytes:0 

73 fFrameSize 1944-- -fMaxSize 109982 fNumTruncatedBytes:0 

74 fFrameSize 2115-- -fMaxSize 109982 fNumTruncatedBytes:0 

75 fFrameSize 2220-- -fMaxSize 109982 fNumTruncatedBytes:0 

76 fFrameSize 2668-- -fMaxSize 103703 fNumTruncatedBytes:0 

77 fFrameSize 2334-- -fMaxSize 103703 fNumTruncatedBytes:0 

78 fFrameSize 1690-- -fMaxSize 149997 fNumTruncatedBytes:0 

79 fFrameSize 1835-- -fMaxSize 149997 fNumTruncatedBytes:0 

80 fFrameSize 2810-- -fMaxSize 149997 fNumTruncatedBytes:0 

81 fFrameSize 2254-- -fMaxSize 143662 fNumTruncatedBytes:0 


Program received signal SIGSEGV, Segmentation fault. 
0x0005a81c in DelayQueue::synchronize() () 
(gdb) p 0x0005a81c 
$1 = 370716 





Email:laimaoli at fosiao.com
Iphone:18823320170
Name:Maoli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20140529/930e7daa/attachment-0001.html>


More information about the live-devel mailing list