MPEG4VideoStreamFramer.hh 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 filter that breaks up an MPEG-4 video elementary stream into
  17. // frames for:
  18. // - Visual Object Sequence (VS) Header + Visual Object (VO) Header
  19. // + Video Object Layer (VOL) Header
  20. // - Group of VOP (GOV) Header
  21. // - VOP frame
  22. // C++ header
  23. #ifndef _MPEG4_VIDEO_STREAM_FRAMER_HH
  24. #define _MPEG4_VIDEO_STREAM_FRAMER_HH
  25. #ifndef _MPEG_VIDEO_STREAM_FRAMER_HH
  26. #include "MPEGVideoStreamFramer.hh"
  27. #endif
  28. class MPEG4VideoStreamFramer: public MPEGVideoStreamFramer {
  29. public:
  30. static MPEG4VideoStreamFramer*
  31. createNew(UsageEnvironment& env, FramedSource* inputSource);
  32. u_int8_t profile_and_level_indication() const {
  33. return fProfileAndLevelIndication;
  34. }
  35. unsigned char* getConfigBytes(unsigned& numBytes) const;
  36. void setConfigInfo(u_int8_t profileAndLevelIndication, char const* configStr);
  37. // Assigns the "profile_and_level_indication" number, and the 'config' bytes.
  38. // If this function is not called, then this data is only assigned later, when it appears in the input stream.
  39. protected:
  40. MPEG4VideoStreamFramer(UsageEnvironment& env,
  41. FramedSource* inputSource,
  42. Boolean createParser = True);
  43. // called only by createNew(), or by subclass constructors
  44. virtual ~MPEG4VideoStreamFramer();
  45. void startNewConfig();
  46. void appendToNewConfig(unsigned char* newConfigBytes,
  47. unsigned numNewBytes);
  48. void completeNewConfig();
  49. private:
  50. // redefined virtual functions:
  51. virtual Boolean isMPEG4VideoStreamFramer() const;
  52. protected:
  53. u_int8_t fProfileAndLevelIndication;
  54. unsigned char* fConfigBytes;
  55. unsigned fNumConfigBytes;
  56. private:
  57. unsigned char* fNewConfigBytes;
  58. unsigned fNumNewConfigBytes;
  59. friend class MPEG4VideoStreamParser; // hack
  60. };
  61. #endif