[Live-devel] misbehavior after delivering H.264 frame

Steve Jiekak devaureshy at gmail.com
Tue Aug 4 07:34:07 PDT 2009


Hi got some strange behavior when I try to stream H.264 .

I have my implementation of device source class, which directly read entire
frames from
a socket, and feed the H264VideoSink. I have already made a similar class
for MPEG1 ,
and it was working fine...

Here the afterGettingframe of the H264FUAFragmenter misbehave such that when
there is the call
to doNextFrame at the end of the function.. it points nowhere and it
crashes...I have noticed there are always
2 similar executions with both the real source and the fragmenter objects
after the call to afterGetting(this) in device source

PS: this happens since the first call

Here is a trace with gdb :


Breakpoint 1, H264VideoRTPSink::continuePlaying (this=0x8926578) at
H264VideoRTPSink.cpp:74
74      if (fOurFragmenter == NULL) {
(gdb) n
59      UsageEnvironment& envir() const {return fEnviron;}
(gdb)
76                           ourMaxPacketSize() - 12/*RTP hdr size*/);
(gdb)
59      UsageEnvironment& envir() const {return fEnviron;}
(gdb)
76                           ourMaxPacketSize() - 12/*RTP hdr size*/);
(gdb)
77        fSource = fOurFragmenter;
(gdb) print fOurFragmenter
$1 = (H264FUAFragmenter *) 0x893b6d8   // this is the address of the
fragmenter constructed...
(gdb) n
81      return MultiFramedRTPSink::continuePlaying();
(gdb) c
Continuing.
packet 0 of size 12
DATA::: received: 3744, expected: 3744

Breakpoint 2, DeviceSource::deliverFrame (this=0x89355c8) at
DeviceSource.cpp:201 //this is the address Device object
201    void DeviceSource::deliverFrame() {
(gdb) n
203      if (!isCurrentlyAwaitingData()) return; // we're not ready for the
data yet
(gdb)
205       if(Ntrashed != 0){
(gdb)
210          fFrameSize = Nreceived;
(gdb)
218         gettimeofday(&fPresentationTime, NULL);
(gdb)
52      return __builtin___memcpy_chk (__dest, __src, __len, __bos0
(__dest));
(gdb)
220        fDurationInMicroseconds = DeviceSource::defaultFrameDuration;
(gdb)
52      return __builtin___memcpy_chk (__dest, __src, __len, __bos0
(__dest));
(gdb)
224      FramedSource::afterGetting(this);
(gdb) s
226    }
(gdb)
DeviceSource::deliverFrame (this=0x893b6d8) at DeviceSource.cpp:224 //???
224      FramedSource::afterGetting(this);
(gdb)
FramedSource::afterGetting (source=0x89355c8) at FramedSource.cpp:81 //now
we have the right address again
81    void FramedSource::afterGetting(FramedSource* source) {
(gdb)
87      if (source->fAfterGettingFunc != NULL) {
(gdb)
82      source->fIsCurrentlyAwaitingData = False;
(gdb)
87      if (source->fAfterGettingFunc != NULL) {
(gdb)
91                       source->fDurationInMicroseconds);
(gdb)
H264FUAFragmenter::afterGettingFrame (clientData=0x893b6d8, frameSize=3744,
numTruncatedBytes=0, presentationTime=
      {tv_sec = 1249394529, tv_usec = 926474}, durationInMicroseconds=40) at
H264VideoRTPSink.cpp:226
226    }
(gdb)
H264FUAFragmenter::afterGettingFrame (clientData=0x89355c8,
frameSize=143898457, numTruncatedBytes=60000,
    presentationTime={tv_sec = 134630672, tv_usec = 143898328},
durationInMicroseconds=134523216)
    at H264VideoRTPSink.cpp:225
225                     durationInMicroseconds); //the parameters seems to
be garbage to me..
(gdb)
H264FUAFragmenter::afterGettingFrame1 (this=0x893b6d8, frameSize=3744,
numTruncatedBytes=0, presentationTime=
      {tv_sec = 1249394529, tv_usec = 926474}, durationInMicroseconds=40) at
H264VideoRTPSink.cpp:231
231                           unsigned durationInMicroseconds) {
(gdb)
232      fNumValidDataBytes += frameSize;
(gdb)
233      fSaveNumTruncatedBytes = numTruncatedBytes;
(gdb)
234      fPresentationTime = presentationTime;
(gdb)
235      fDurationInMicroseconds = durationInMicroseconds;
(gdb)
238      doGetNextFrame();
(gdb)
239    }
(gdb)
H264FUAFragmenter::afterGettingFrame1 (this=0x89355c8, frameSize=143898457,
numTruncatedBytes=60000,
    presentationTime={tv_sec = 134630672, tv_usec = 143898328},
durationInMicroseconds=134523216)
    at H264VideoRTPSink.cpp:238
238      doGetNextFrame();
(gdb)

Program received signal SIGSEGV, Segmentation fault.
H264FUAFragmenter::afterGettingFrame1 (this=0x89355c8, frameSize=143898457,
numTruncatedBytes=60000,
    presentationTime={tv_sec = 134630672, tv_usec = 143898328},
durationInMicroseconds=134523216)
    at H264VideoRTPSink.cpp:238
238      doGetNextFrame();
(gdb) where
#0  H264FUAFragmenter::afterGettingFrame1 (this=0x89355c8,
frameSize=143898457, numTruncatedBytes=60000,
    presentationTime={tv_sec = 134630672, tv_usec = 143898328},
durationInMicroseconds=134523216)
    at H264VideoRTPSink.cpp:238
#1  0x08064eef in H264FUAFragmenter::doGetNextFrame (this=0x89355c8) at
H264VideoRTPSink.cpp:150
#2  0x0806e06d in MultiFramedRTPSink::packFrame (this=0x8926578) at
MultiFramedRTPSink.cpp:215
#3  0x0806e589 in MultiFramedRTPSink::continuePlaying (this=0x8926578) at
MultiFramedRTPSink.cpp:151
#4  0x08049e4c in play () at H264RTPSender.cpp:97
#5  0x08049fee in main () at H264RTPSender.cpp:68
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20090804/827925c5/attachment.html>


More information about the live-devel mailing list