H264VideoRTPSource.hh 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. // H.264 Video RTP Sources
  17. // C++ header
  18. #ifndef _H264_VIDEO_RTP_SOURCE_HH
  19. #define _H264_VIDEO_RTP_SOURCE_HH
  20. #ifndef _MULTI_FRAMED_RTP_SOURCE_HH
  21. #include "MultiFramedRTPSource.hh"
  22. #endif
  23. class H264VideoRTPSource: public MultiFramedRTPSource {
  24. public:
  25. static H264VideoRTPSource*
  26. createNew(UsageEnvironment& env, Groupsock* RTPgs,
  27. unsigned char rtpPayloadFormat,
  28. unsigned rtpTimestampFrequency = 90000);
  29. protected:
  30. H264VideoRTPSource(UsageEnvironment& env, Groupsock* RTPgs,
  31. unsigned char rtpPayloadFormat,
  32. unsigned rtpTimestampFrequency);
  33. // called only by createNew()
  34. virtual ~H264VideoRTPSource();
  35. protected:
  36. // redefined virtual functions:
  37. virtual Boolean processSpecialHeader(BufferedPacket* packet,
  38. unsigned& resultSpecialHeaderSize);
  39. virtual char const* MIMEtype() const;
  40. private:
  41. friend class H264BufferedPacket;
  42. unsigned char fCurPacketNALUnitType;
  43. };
  44. class SPropRecord {
  45. public:
  46. ~SPropRecord() { delete[] sPropBytes; }
  47. unsigned sPropLength; // in bytes
  48. unsigned char* sPropBytes;
  49. };
  50. SPropRecord* parseSPropParameterSets(char const* sPropParameterSetsStr,
  51. // result parameter:
  52. unsigned& numSPropRecords);
  53. // Returns the binary value of each 'parameter set' specified in a
  54. // "sprop-parameter-sets" string (in the SDP description for a H.264/RTP stream).
  55. // The value is returned as an array (length "numSPropRecords") of "SPropRecord"s.
  56. // This array is dynamically allocated by this routine, and must be delete[]d by the caller.
  57. #endif