User Tools

Site Tools



FramedFilter - MediaSource

class FramedSource: public MediaSource {
  static Boolean lookupByName(UsageEnvironment& env, char const* sourceName,
                              FramedSource*& resultSource);
  typedef void (afterGettingFunc)(void* clientData, unsigned frameSize,
                                  unsigned numTruncatedBytes,
                                  struct timeval presentationTime,
                                  unsigned durationInMicroseconds);
  typedef void (onCloseFunc)(void* clientData);
  void getNextFrame(unsigned char* to, unsigned maxSize,
                    afterGettingFunc* afterGettingFunc,
                    void* afterGettingClientData,
                    onCloseFunc* onCloseFunc,
                    void* onCloseClientData);
  static void handleClosure(void* clientData);
      // This should be called (on ourself) if the source is discovered
      // to be closed (i.e., no longer readable)
  void stopGettingFrames();
  virtual unsigned maxFrameSize() const;
      // size of the largest possible frame that we may serve, or 0
      // if no such maximum is known (default)
  virtual void doGetNextFrame() = 0;
      // called by getNextFrame()
  Boolean isCurrentlyAwaitingData() const {return fIsCurrentlyAwaitingData;}
  FramedSource(UsageEnvironment& env); // abstract base class
  virtual ~FramedSource();
  static void afterGetting(FramedSource* source);
      // doGetNextFrame() should arrange for this to be called after the
      // frame has been read (*iff* it is read successfully)
  virtual void doStopGettingFrames();
  // The following variables are typically accessed/set by doGetNextFrame()
  unsigned char* fTo; // in
  unsigned fMaxSize; // in
  unsigned fFrameSize; // out
  unsigned fNumTruncatedBytes; // out
  struct timeval fPresentationTime; // out
  unsigned fDurationInMicroseconds; // out
  // redefined virtual functions:
  virtual Boolean isFramedSource() const;
  afterGettingFunc* fAfterGettingFunc;
  void* fAfterGettingClientData;
  onCloseFunc* fOnCloseFunc;
  void* fOnCloseClientData;
  Boolean fIsCurrentlyAwaitingData;
live555/framedsource.txt · Last modified: 2009/12/10 12:03 by deva