H264or5VideoRTPSink.hh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. // RTP sink for H.264 or H.265 video
  17. // C++ header
  18. #ifndef _H264_OR_5_VIDEO_RTP_SINK_HH
  19. #define _H264_OR_5_VIDEO_RTP_SINK_HH
  20. #ifndef _VIDEO_RTP_SINK_HH
  21. #include "VideoRTPSink.hh"
  22. #endif
  23. #ifndef _FRAMED_FILTER_HH
  24. #include "FramedFilter.hh"
  25. #endif
  26. class H264or5VideoRTPSink: public VideoRTPSink {
  27. protected:
  28. H264or5VideoRTPSink(int hNumber, // 264 or 265
  29. UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat,
  30. u_int8_t const* vps = NULL, unsigned vpsSize = 0,
  31. u_int8_t const* sps = NULL, unsigned spsSize = 0,
  32. u_int8_t const* pps = NULL, unsigned ppsSize = 0);
  33. // we're an abstrace base class
  34. virtual ~H264or5VideoRTPSink();
  35. private: // redefined virtual functions:
  36. virtual Boolean continuePlaying();
  37. virtual void doSpecialFrameHandling(unsigned fragmentationOffset,
  38. unsigned char* frameStart,
  39. unsigned numBytesInFrame,
  40. struct timeval framePresentationTime,
  41. unsigned numRemainingBytes);
  42. virtual Boolean frameCanAppearAfterPacketStart(unsigned char const* frameStart,
  43. unsigned numBytesInFrame) const;
  44. protected:
  45. int fHNumber;
  46. FramedFilter* fOurFragmenter;
  47. char* fFmtpSDPLine;
  48. u_int8_t* fVPS; unsigned fVPSSize;
  49. u_int8_t* fSPS; unsigned fSPSSize;
  50. u_int8_t* fPPS; unsigned fPPSSize;
  51. };
  52. #endif