#ifndef NULLSINK_H
#define NULLSINK_H

#include <MediaSink.hh>

class CNULLSink: public MediaSink {
public:
    static CNULLSink* createNew(UsageEnvironment& env);
protected:
    CNULLSink(UsageEnvironment& env);
    // called only by createNew()
    virtual ~CNULLSink();

private: // redefined virtual functions:
    virtual Boolean continuePlaying();

private:
    void continuePlaying1();

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

    static void sendNext(void* firstArg);

private:
    unsigned fMaxPayloadSize;
    unsigned char* fOutputBuffer;
    struct timeval fNextSendTime;
};

#endif // NULLSINK_H
