MPEG2TransportUDPServerMediaSubsession.hh 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 creates new, unicast, "RTPSink"s
  17. // on demand, from an incoming UDP (or RTP/UDP) MPEG-2 Transport Stream
  18. // C++ header
  19. #ifndef _MPEG2_TRANSPORT_UDP_SERVER_MEDIA_SUBSESSION_HH
  20. #define _MPEG2_TRANSPORT_UDP_SERVER_MEDIA_SUBSESSION_HH
  21. #ifndef _ON_DEMAND_SERVER_MEDIA_SUBSESSION_HH
  22. #include "OnDemandServerMediaSubsession.hh"
  23. #endif
  24. class MPEG2TransportUDPServerMediaSubsession: public OnDemandServerMediaSubsession {
  25. public:
  26. static MPEG2TransportUDPServerMediaSubsession*
  27. createNew(UsageEnvironment& env,
  28. char const* inputAddressStr, // An IP multicast address, or use "0.0.0.0" or NULL for unicast input
  29. Port const& inputPort,
  30. Boolean inputStreamIsRawUDP = False); // otherwise (default) the input stream is RTP/UDP
  31. protected:
  32. MPEG2TransportUDPServerMediaSubsession(UsageEnvironment& env,
  33. char const* inputAddressStr, Port const& inputPort, Boolean inputStreamIsRawUDP);
  34. // called only by createNew();
  35. virtual ~MPEG2TransportUDPServerMediaSubsession();
  36. protected: // redefined virtual functions
  37. virtual FramedSource* createNewStreamSource(unsigned clientSessionId,
  38. unsigned& estBitrate);
  39. virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock,
  40. unsigned char rtpPayloadTypeIfDynamic,
  41. FramedSource* inputSource);
  42. protected:
  43. char const* fInputAddressStr;
  44. Port fInputPort;
  45. Groupsock* fInputGroupsock;
  46. Boolean fInputStreamIsRawUDP;
  47. };
  48. #endif