SimpleRTPSource.hh 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. // A RTP source for a simple RTP payload format that
  17. // - doesn't have any special headers following the RTP header
  18. // (if necessary, the "offset" parameter can be used to specify a
  19. // special header that we just skip over)
  20. // - doesn't have any special framing apart from the packet data itself
  21. // C++ header
  22. #ifndef _SIMPLE_RTP_SOURCE_HH
  23. #define _SIMPLE_RTP_SOURCE_HH
  24. #ifndef _MULTI_FRAMED_RTP_SOURCE_HH
  25. #include "MultiFramedRTPSource.hh"
  26. #endif
  27. class SimpleRTPSource: public MultiFramedRTPSource {
  28. public:
  29. static SimpleRTPSource* createNew(UsageEnvironment& env, Groupsock* RTPgs,
  30. unsigned char rtpPayloadFormat,
  31. unsigned rtpTimestampFrequency,
  32. char const* mimeTypeString,
  33. unsigned offset = 0,
  34. Boolean doNormalMBitRule = True);
  35. // "doNormalMBitRule" means: If the medium is not audio, use the RTP "M"
  36. // bit on each incoming packet to indicate the last (or only) fragment
  37. // of a frame. Otherwise (i.e., if "doNormalMBitRule" is False, or the medium is "audio"), the "M" bit is ignored.
  38. protected:
  39. SimpleRTPSource(UsageEnvironment& env, Groupsock* RTPgs,
  40. unsigned char rtpPayloadFormat,
  41. unsigned rtpTimestampFrequency,
  42. char const* mimeTypeString, unsigned offset,
  43. Boolean doNormalMBitRule);
  44. // called only by createNew(), or by subclass constructors
  45. virtual ~SimpleRTPSource();
  46. protected:
  47. // redefined virtual functions:
  48. virtual Boolean processSpecialHeader(BufferedPacket* packet,
  49. unsigned& resultSpecialHeaderSize);
  50. virtual char const* MIMEtype() const;
  51. private:
  52. char const* fMIMEtypeString;
  53. unsigned fOffset;
  54. Boolean fUseMBitForFrameEnd;
  55. };
  56. #endif