QuickTimeGenericRTPSource.hh 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 Sources containing generic QuickTime stream data, as defined in
  17. // <http://developer.apple.com/quicktime/icefloe/dispatch026.html>
  18. // C++ header
  19. #ifndef _QUICKTIME_GENERIC_RTP_SOURCE_HH
  20. #define _QUICKTIME_GENERIC_RTP_SOURCE_HH
  21. #ifndef _MULTI_FRAMED_RTP_SOURCE_HH
  22. #include "MultiFramedRTPSource.hh"
  23. #endif
  24. class QuickTimeGenericRTPSource: public MultiFramedRTPSource {
  25. public:
  26. static QuickTimeGenericRTPSource*
  27. createNew(UsageEnvironment& env, Groupsock* RTPgs,
  28. unsigned char rtpPayloadFormat, unsigned rtpTimestampFrequency,
  29. char const* mimeTypeString);
  30. // QuickTime-specific information, set from the QuickTime header
  31. // in each packet. This, along with the data following the header,
  32. // is used by receivers.
  33. struct QTState {
  34. char PCK;
  35. unsigned timescale;
  36. char* sdAtom;
  37. unsigned sdAtomSize;
  38. unsigned short width, height;
  39. // later add other state as needed #####
  40. } qtState;
  41. protected:
  42. virtual ~QuickTimeGenericRTPSource();
  43. private:
  44. QuickTimeGenericRTPSource(UsageEnvironment& env, Groupsock* RTPgs,
  45. unsigned char rtpPayloadFormat,
  46. unsigned rtpTimestampFrequency,
  47. char const* mimeTypeString);
  48. // called only by createNew()
  49. private:
  50. // redefined virtual functions:
  51. virtual Boolean processSpecialHeader(BufferedPacket* packet,
  52. unsigned& resultSpecialHeaderSize);
  53. virtual char const* MIMEtype() const;
  54. private:
  55. char const* fMIMEtypeString;
  56. };
  57. #endif