[Live-devel] Need your expertise

Ross Finlayson finlayson at live.com
Mon May 30 13:00:17 PDT 2005


>I'm having a problem with the function getNextFrame() and afterGetting(this)
[...]
>       afterGettingFrame1()
>    {
>    //algo that check where to splice in the fTo buffer
>    //then copy data from fTo to fTobis //work

I wasn't really able to follow exactly what you're trying to do, but the 
section above suggests that possibly you're a bit confused about the 
use/purpose of "fTo".

When a "FramedSource" is executing "doGetNextFrame()" (the virtual function 
that implements "getNextFrame()"), then "fTo" is a pointer to an area of 
memory - supplied by the downstream caller - that is to receive the 
data.  The "FramedSource" that's executing "doGetNextFrame()" must copy (or 
arrange to copy) data *to* the memory pointed to by "fTo".  This is usually 
done by code like:

         // suppose that we have the data in an internal buffer "buf", size 
"size"
         if (size <= fMaxSize) {
                 fFrameSize = size;
                 fNumTruncatedBytes = 0;
         } else { // the downstream caller doesn't have enough memory for us
                 fFrameSize = fMaxSize;
                 fNumTruncatedBytes = size - fMaxSize;
         }
         memmove(fTo, buf, fFrameSize);

I.e., if object A calls B->getNextFrame(to, maxSize, ...)
then, in B::doGetNextFrame():
         "fTo" is the "to" pointer that was passed to "B->getNextFrame()"
         "fMaxSize" is the "maxSize" pointer that was passed to 
"B->getNextFrame()"


	Ross Finlayson
	LIVE.COM
	<http://www.live.com/>



More information about the live-devel mailing list