MPEG4GenericRTPSink.hh 2.5 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. // MPEG4-GENERIC ("audio", "video", or "application") RTP stream sinks
  17. // C++ header
  18. #ifndef _MPEG4_GENERIC_RTP_SINK_HH
  19. #define _MPEG4_GENERIC_RTP_SINK_HH
  20. #ifndef _MULTI_FRAMED_RTP_SINK_HH
  21. #include "MultiFramedRTPSink.hh"
  22. #endif
  23. class MPEG4GenericRTPSink: public MultiFramedRTPSink {
  24. public:
  25. static MPEG4GenericRTPSink*
  26. createNew(UsageEnvironment& env, Groupsock* RTPgs,
  27. u_int8_t rtpPayloadFormat, u_int32_t rtpTimestampFrequency,
  28. char const* sdpMediaTypeString, char const* mpeg4Mode,
  29. char const* configString,
  30. unsigned numChannels = 1);
  31. protected:
  32. MPEG4GenericRTPSink(UsageEnvironment& env, Groupsock* RTPgs,
  33. u_int8_t rtpPayloadFormat,
  34. u_int32_t rtpTimestampFrequency,
  35. char const* sdpMediaTypeString,
  36. char const* mpeg4Mode, char const* configString,
  37. unsigned numChannels);
  38. // called only by createNew()
  39. virtual ~MPEG4GenericRTPSink();
  40. private: // redefined virtual functions:
  41. virtual
  42. Boolean frameCanAppearAfterPacketStart(unsigned char const* frameStart,
  43. unsigned numBytesInFrame) const;
  44. virtual void doSpecialFrameHandling(unsigned fragmentationOffset,
  45. unsigned char* frameStart,
  46. unsigned numBytesInFrame,
  47. struct timeval framePresentationTime,
  48. unsigned numRemainingBytes);
  49. virtual unsigned specialHeaderSize() const;
  50. virtual char const* sdpMediaType() const;
  51. virtual char const* auxSDPLine(); // for the "a=fmtp:" SDP line
  52. private:
  53. char const* fSDPMediaTypeString;
  54. char const* fMPEG4Mode;
  55. char const* fConfigString;
  56. char* fFmtpSDPLine;
  57. };
  58. #endif