[Live-devel] RTP over TCP with iPhone

Dmitrij Velkin d.velkin at ids-imaging.de
Thu Jun 30 00:04:51 PDT 2011


Yes I use FileSink as model:

class MyMediaSink:public MediaSink
{
public:
    MyMediaSink(UsageEnvironment &env):MediaSink(env){buffer = new uint8_t[fileSinkBufferSize];}
    virtual ~MyMediaSink(){}
protected:
    
    Boolean continuePlaying()
    {    
        
        if (NULL == fSource)
        {
            return False;
        }
        
        buffer = NULL;
        fSource->getNextFrame(buffer, fileSinkBufferSize, afterGettingFrame, this, onSourceClosure, this);
        
        return True;
    }
    
    static void afterGettingFrame(void* clientData, unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)
    {
        MyMediaSink* sink = (MyMediaSink*)clientData;
        sink->afterGettingFrame1(frameSize, presentationTime);
    }
    
    void afterGettingFrame1(unsigned frameSize,
                            struct timeval presentationTime) 
    {
        AddData(buffer, frameSize, presentationTime);
        
        // Then try getting the next frame:
        continuePlaying();
    }
    
    void AddData(uint8_t* pData, uint32_t nDataSize, struct timeval presentationTime)
    {
        if(pData == NULL)
        {
            printf("NO DATA");
        }
    }
    
private:
    uint8_t *buffer;
};


if I implement it in this way i never get into "afterGettingFrame". What am I doing wrong?


thanks!




Am 30.06.2011 um 08:06 schrieb Ross Finlayson:

>>        Boolean continuePlaying(){/*CODE will come soon*/ return true;}
> 
> I'm not sure what your question is, but once your "MyMediaSink" class should work once you implement the "continuePlaying()" function (etc.).  I suggest that you use the "FileSink" code as a model.
> -- 
> 
> Ross Finlayson
> Live Networks, Inc.
> http://www.live555.com/
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20110630/b9566b38/attachment.html>


More information about the live-devel mailing list