RawVideoRTPSource.hh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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-2020 Live Networks, Inc. All rights reserved.
  16. // Raw Video RTP Sources (RFC 4175)
  17. // C++ header
  18. #ifndef _RAW_VIDEO_RTP_SOURCE_HH
  19. #define _RAW_VIDEO_RTP_SOURCE_HH
  20. #ifndef _MULTI_FRAMED_RTP_SOURCE_HH
  21. #include "MultiFramedRTPSource.hh"
  22. #endif
  23. class RawVideoRTPSource: public MultiFramedRTPSource {
  24. public:
  25. static RawVideoRTPSource* createNew(UsageEnvironment& env, Groupsock* RTPgs,
  26. unsigned char rtpPayloadFormat,
  27. unsigned rtpTimestampFrequency);
  28. u_int16_t currentLineNumber() const; // of the most recently-read/processed scan line
  29. u_int8_t currentLineFieldId() const; // of the most recently-read/processed scan line (0 or 1)
  30. u_int16_t currentOffsetWithinLine() const; // of the most recently-read/processed scan line
  31. protected:
  32. RawVideoRTPSource(UsageEnvironment& env, Groupsock* RTPgs,
  33. unsigned char rtpPayloadFormat,
  34. unsigned rtpTimestampFrequency = 90000);
  35. // called only by createNew()
  36. virtual ~RawVideoRTPSource();
  37. protected:
  38. // redefined virtual functions:
  39. virtual Boolean processSpecialHeader(BufferedPacket* packet,
  40. unsigned& resultSpecialHeaderSize);
  41. virtual char const* MIMEtype() const;
  42. private:
  43. unsigned fNumLines; // in the most recently read packet
  44. unsigned fNextLine; // index of the next AU Header to read
  45. struct LineHeader* fLineHeaders;
  46. friend class RawVideoBufferedPacket;
  47. };
  48. #endif