H264VideoRTPSink.hh 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 video (RFC 3984)
  17. // C++ header
  18. #ifndef _H264_VIDEO_RTP_SINK_HH
  19. #define _H264_VIDEO_RTP_SINK_HH
  20. #ifndef _H264_OR_5_VIDEO_RTP_SINK_HH
  21. #include "H264or5VideoRTPSink.hh"
  22. #endif
  23. class H264VideoRTPSink: public H264or5VideoRTPSink {
  24. public:
  25. static H264VideoRTPSink*
  26. createNew(UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat);
  27. static H264VideoRTPSink*
  28. createNew(UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat,
  29. u_int8_t const* sps, unsigned spsSize, u_int8_t const* pps, unsigned ppsSize);
  30. // an optional variant of "createNew()", useful if we know, in advance,
  31. // the stream's SPS and PPS NAL units.
  32. // This avoids us having to 'pre-read' from the input source in order to get these values.
  33. static H264VideoRTPSink*
  34. createNew(UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat,
  35. char const* sPropParameterSetsStr);
  36. // an optional variant of "createNew()", useful if we know, in advance,
  37. // the stream's SPS and PPS NAL units.
  38. // This avoids us having to 'pre-read' from the input source in order to get these values.
  39. protected:
  40. H264VideoRTPSink(UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat,
  41. u_int8_t const* sps = NULL, unsigned spsSize = 0,
  42. u_int8_t const* pps = NULL, unsigned ppsSize = 0);
  43. // called only by createNew()
  44. virtual ~H264VideoRTPSink();
  45. protected: // redefined virtual functions:
  46. virtual char const* auxSDPLine();
  47. private: // redefined virtual functions:
  48. virtual Boolean sourceIsCompatibleWithUs(MediaSource& source);
  49. };
  50. #endif