MPEG4LATMAudioRTPSink.hh 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 MPEG-4 audio, using LATM multiplexing (RFC 3016)
  17. // (Note that the initial 'size' field is assumed to be present at the start of
  18. // each frame.)
  19. // C++ header
  20. #ifndef _MPEG4_LATM_AUDIO_RTP_SINK_HH
  21. #define _MPEG4_LATM_AUDIO_RTP_SINK_HH
  22. #ifndef _AUDIO_RTP_SINK_HH
  23. #include "AudioRTPSink.hh"
  24. #endif
  25. class MPEG4LATMAudioRTPSink: public AudioRTPSink {
  26. public:
  27. static MPEG4LATMAudioRTPSink* createNew(UsageEnvironment& env,
  28. Groupsock* RTPgs,
  29. unsigned char rtpPayloadFormat,
  30. u_int32_t rtpTimestampFrequency,
  31. char const* streamMuxConfigString,
  32. unsigned numChannels,
  33. Boolean allowMultipleFramesPerPacket = False);
  34. protected:
  35. MPEG4LATMAudioRTPSink(UsageEnvironment& env, Groupsock* RTPgs,
  36. unsigned char rtpPayloadFormat,
  37. u_int32_t rtpTimestampFrequency,
  38. char const* streamMuxConfigString,
  39. unsigned numChannels,
  40. Boolean allowMultipleFramesPerPacket);
  41. // called only by createNew()
  42. virtual ~MPEG4LATMAudioRTPSink();
  43. private: // redefined virtual functions:
  44. virtual void doSpecialFrameHandling(unsigned fragmentationOffset,
  45. unsigned char* frameStart,
  46. unsigned numBytesInFrame,
  47. struct timeval framePresentationTime,
  48. unsigned numRemainingBytes);
  49. virtual Boolean
  50. frameCanAppearAfterPacketStart(unsigned char const* frameStart,
  51. unsigned numBytesInFrame) const;
  52. virtual char const* auxSDPLine(); // for the "a=fmtp:" SDP line
  53. private:
  54. char const* fStreamMuxConfigString;
  55. char* fFmtpSDPLine;
  56. Boolean fAllowMultipleFramesPerPacket;
  57. };
  58. #endif