[Live-devel] Contents of fReceiveBuffer Always NULL

George Campbell George.Campbell at vmsuk.com
Fri Feb 3 08:59:18 PST 2012


Hi,

 

I'm fairly new to using Live 555, so apologies if my question is a
stupid one, I've read through the FAQ and looked for an answer to this
through the live-devel mailing list but I've so far come up with
nothing.

 

I've subclassed Mediasink for use with an Iphone app I'm developing,
I've based my class on the testRTSPClient.cpp, and have created an
Objective-C wrapper class around it.

 

I've added lines to send as much debugging information to the debug
console as I can, and I can see that my application sends all of the
correct describe, setup and play requests, I can see that the correct
replies are returned by my RTSP server device,and  I can also see that
my application is receiving frames from the RTSP server, as I've
inserted the code from the original testRTSPClient.cpp in the
afterGettingFrame method that displays information about the size of the
received frame size and presentation time, however my video decoding
routine had been failing, stating that no frame has been found, I've
walked my way back through my code and I've found that NULL data is
being passed into by decoder, tracing it back further I've found that
when I inspect the contents of my receive buffer(invoked from within
continuePlaying() by fSource->getNextFrame(fReceiveBuffer, bufferSize,
afterGettingFrame,this, onSourceCloseure, this)) I find that the
contents are always listed as "0\000", even though the debugging info
indicates that a valid frame was received.

 

The main code within my subclass is as follows, I've removed all the
code that calls my decoder for the moment until I figure out why
fReceiveBuffer is always empty: 

 

void afterGettingFrame(unsigned frameSize, unsigned numTruncatedBytes,
struct timeval presentationTime, unsigned durationInMicroseconds)

{

            if (fStreamId != NULL) envir() << "Stream \"" << fStreamId
<< "\"; ";

            envir() << fSubsession.mediumName() << "/" <<
fSubsession.codecName() << ":\tReceived " << frameSize << " bytes";

            if (numTruncatedBytes > 0) envir() << " (with " <<
numTruncatedBytes << " bytes truncated)";

            envir() << "Packet Data:" << fReceiveBuffer;

            char uSecsStr[6+1];

            sprintf(uSecsStr, "%06u",
(unsigned)presentationTime.tv_usec);

            envir() << ".\tPresentation time: " <<
(unsigned)presentationTime.tv_sec << "." << uSecsStr;

            if (fSubsession.rtpSource() != NULL &&
!fSubsession.rtpSource()->hasBeenSynchronizedUsingRTCP()) 

            {

                envir() << "!"; // mark the debugging output to indicate
that this presentation time is not RTCP-synchronized

            }

            envir() << "\n";

            continuePlaying();

}

 

static void afterGettingFrame(void* clientData, unsigned frameSize,
unsigned numTruncatedBytes, struct timeval presentationTime, unsigned
durationInMicroseconds)

{

        RTSPSubsessionMediaSink* sink =
(RTSPSubsessionMediaSink*)clientData;

        sink->afterGettingFrame(frameSize, numTruncatedBytes,
presentationTime, durationInMicroseconds);

}

 

virtual Boolean continuePlaying()

{

if (fSource == NULL) return False 

                 fSource->getNextFrame(fReceiveBuffer,
VMSiOS_MEDIA_SINK_RECEIVE_BUFFER_SIZE, afterGettingFrame, this,
onSourceClosure, this);

            return True;

};

 

Have I missed something obvious?

 

George Campbell

Product Development Manager

Visual Management Systems Limited (VMS)

0141 763 2690

07971 992 459

www.vmsuk.com <http://www.vmsuk.com/> 

   

 

Disclaimer:  Nothing in this email shall bind Visual Management Systems
Ltd in any contract or obligation unless expressly stated otherwise.
This e-mail is for the intended addressee only. If you believe you have
received it in error then please delete it and notify the sender by
return e-mail. In case of doubt about the correctness or completeness of
this e-mail please contact the sender. Visual Management Systems Ltd
make every effort to virus check any files available for downloading on
their website or sent as attachments via email. Visual Management
Systems Ltd accept no responsibility whatsoever for any loss or damage
that may arise from the receipt of such material. We therefore recommend
that all recipients check all received material with their own virus
check software.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120203/c9586eae/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 7596 bytes
Desc: image001.png
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120203/c9586eae/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 4645 bytes
Desc: image002.png
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120203/c9586eae/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 239 bytes
Desc: image003.gif
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120203/c9586eae/attachment-0001.gif>


More information about the live-devel mailing list