PassiveServerMediaSubsession.hh 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 'ServerMediaSubsession' object that represents an existing
  17. // 'RTPSink', rather than one that creates new 'RTPSink's on demand.
  18. // C++ header
  19. #ifndef _PASSIVE_SERVER_MEDIA_SUBSESSION_HH
  20. #define _PASSIVE_SERVER_MEDIA_SUBSESSION_HH
  21. #ifndef _SERVER_MEDIA_SESSION_HH
  22. #include "ServerMediaSession.hh"
  23. #endif
  24. #ifndef _RTP_SINK_HH
  25. #include "RTPSink.hh"
  26. #endif
  27. #ifndef _RTCP_HH
  28. #include "RTCP.hh"
  29. #endif
  30. class PassiveServerMediaSubsession: public ServerMediaSubsession {
  31. public:
  32. static PassiveServerMediaSubsession* createNew(RTPSink& rtpSink,
  33. RTCPInstance* rtcpInstance = NULL);
  34. protected:
  35. PassiveServerMediaSubsession(RTPSink& rtpSink, RTCPInstance* rtcpInstance);
  36. // called only by createNew();
  37. virtual ~PassiveServerMediaSubsession();
  38. virtual Boolean rtcpIsMuxed();
  39. protected: // redefined virtual functions
  40. virtual char const* sdpLines();
  41. virtual void getStreamParameters(unsigned clientSessionId,
  42. netAddressBits clientAddress,
  43. Port const& clientRTPPort,
  44. Port const& clientRTCPPort,
  45. int tcpSocketNum,
  46. unsigned char rtpChannelId,
  47. unsigned char rtcpChannelId,
  48. netAddressBits& destinationAddress,
  49. u_int8_t& destinationTTL,
  50. Boolean& isMulticast,
  51. Port& serverRTPPort,
  52. Port& serverRTCPPort,
  53. void*& streamToken);
  54. virtual void startStream(unsigned clientSessionId, void* streamToken,
  55. TaskFunc* rtcpRRHandler,
  56. void* rtcpRRHandlerClientData,
  57. unsigned short& rtpSeqNum,
  58. unsigned& rtpTimestamp,
  59. ServerRequestAlternativeByteHandler* serverRequestAlternativeByteHandler,
  60. void* serverRequestAlternativeByteHandlerClientData);
  61. virtual float getCurrentNPT(void* streamToken);
  62. virtual void getRTPSinkandRTCP(void* streamToken,
  63. RTPSink const*& rtpSink, RTCPInstance const*& rtcp);
  64. virtual void deleteStream(unsigned clientSessionId, void*& streamToken);
  65. protected:
  66. char* fSDPLines;
  67. private:
  68. RTPSink& fRTPSink;
  69. RTCPInstance* fRTCPInstance;
  70. HashTable* fClientRTCPSourceRecords; // indexed by client session id; used to implement RTCP "RR" handling
  71. };
  72. #endif