TheoraVideoRTPSink.hh 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 Theora video
  17. // C++ header
  18. #ifndef _THEORA_VIDEO_RTP_SINK_HH
  19. #define _THEORA_VIDEO_RTP_SINK_HH
  20. #ifndef _VIDEO_RTP_SINK_HH
  21. #include "VideoRTPSink.hh"
  22. #endif
  23. class TheoraVideoRTPSink: public VideoRTPSink {
  24. public:
  25. static TheoraVideoRTPSink*
  26. createNew(UsageEnvironment& env, Groupsock* RTPgs, u_int8_t rtpPayloadFormat,
  27. // The following headers provide the 'configuration' information, for the SDP description:
  28. u_int8_t* identificationHeader, unsigned identificationHeaderSize,
  29. u_int8_t* commentHeader, unsigned commentHeaderSize,
  30. u_int8_t* setupHeader, unsigned setupHeaderSize,
  31. u_int32_t identField = 0xFACADE);
  32. static TheoraVideoRTPSink*
  33. createNew(UsageEnvironment& env, Groupsock* RTPgs, u_int8_t rtpPayloadFormat,
  34. char const* configStr);
  35. // an optional variant of "createNew()" that takes a Base-64-encoded 'configuration' string,
  36. // rather than the raw configuration headers as parameter.
  37. protected:
  38. TheoraVideoRTPSink(UsageEnvironment& env, Groupsock* RTPgs,
  39. u_int8_t rtpPayloadFormat,
  40. u_int8_t* identificationHeader, unsigned identificationHeaderSize,
  41. u_int8_t* commentHeader, unsigned commentHeaderSize,
  42. u_int8_t* setupHeader, unsigned setupHeaderSize,
  43. u_int32_t identField);
  44. // called only by createNew()
  45. virtual ~TheoraVideoRTPSink();
  46. private: // redefined virtual functions:
  47. virtual char const* auxSDPLine(); // for the "a=fmtp:" SDP line
  48. virtual void doSpecialFrameHandling(unsigned fragmentationOffset,
  49. unsigned char* frameStart,
  50. unsigned numBytesInFrame,
  51. struct timeval framePresentationTime,
  52. unsigned numRemainingBytes);
  53. virtual Boolean frameCanAppearAfterPacketStart(unsigned char const* frameStart,
  54. unsigned numBytesInFrame) const;
  55. virtual unsigned specialHeaderSize() const;
  56. private:
  57. u_int32_t fIdent; // "Ident" field used by this stream. (Only the low 24 bits of this are used.)
  58. char* fFmtpSDPLine;
  59. };
  60. #endif