MPEG4VideoFileServerMediaSubsession.hh 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**********
  2. This library is free software; you can redistribute it and/or modify it under
  3. the terms of the GNU Lesser General Public License as published by the
  4. Free Software Foundation; either version 3 of the License, or (at your
  5. option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
  6. This library is distributed in the hope that it will be useful, but WITHOUT
  7. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
  9. more details.
  10. You should have received a copy of the GNU Lesser General Public License
  11. along with this library; if not, write to the Free Software Foundation, Inc.,
  12. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  13. **********/
  14. // "liveMedia"
  15. // Copyright (c) 1996-2019 Live Networks, Inc. All rights reserved.
  16. // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s
  17. // on demand, from a MPEG-4 video file.
  18. // C++ header
  19. #ifndef _MPEG4_VIDEO_FILE_SERVER_MEDIA_SUBSESSION_HH
  20. #define _MPEG4_VIDEO_FILE_SERVER_MEDIA_SUBSESSION_HH
  21. #ifndef _FILE_SERVER_MEDIA_SUBSESSION_HH
  22. #include "FileServerMediaSubsession.hh"
  23. #endif
  24. class MPEG4VideoFileServerMediaSubsession: public FileServerMediaSubsession{
  25. public:
  26. static MPEG4VideoFileServerMediaSubsession*
  27. createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource);
  28. // Used to implement "getAuxSDPLine()":
  29. void checkForAuxSDPLine1();
  30. void afterPlayingDummy1();
  31. protected:
  32. MPEG4VideoFileServerMediaSubsession(UsageEnvironment& env,
  33. char const* fileName, Boolean reuseFirstSource);
  34. // called only by createNew();
  35. virtual ~MPEG4VideoFileServerMediaSubsession();
  36. void setDoneFlag() { fDoneFlag = ~0; }
  37. protected: // redefined virtual functions
  38. virtual char const* getAuxSDPLine(RTPSink* rtpSink,
  39. FramedSource* inputSource);
  40. virtual FramedSource* createNewStreamSource(unsigned clientSessionId,
  41. unsigned& estBitrate);
  42. virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock,
  43. unsigned char rtpPayloadTypeIfDynamic,
  44. FramedSource* inputSource);
  45. private:
  46. char* fAuxSDPLine;
  47. char fDoneFlag; // used when setting up "fAuxSDPLine"
  48. RTPSink* fDummyRTPSink; // ditto
  49. };
  50. #endif