liveMedia/include/RTSPServerSupportingHTTPStreaming.hh

Go to the documentation of this file.
00001 /**********
00002 This library is free software; you can redistribute it and/or modify it under
00003 the terms of the GNU Lesser General Public License as published by the
00004 Free Software Foundation; either version 2.1 of the License, or (at your
00005 option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
00006 
00007 This library is distributed in the hope that it will be useful, but WITHOUT
00008 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00009 FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
00010 more details.
00011 
00012 You should have received a copy of the GNU Lesser General Public License
00013 along with this library; if not, write to the Free Software Foundation, Inc.,
00014 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
00015 **********/
00016 // "liveMedia"
00017 // Copyright (c) 1996-2014 Live Networks, Inc.  All rights reserved.
00018 // A server that supports both RTSP, and HTTP streaming (using Apple's "HTTP Live Streaming" protocol)
00019 // C++ header
00020 
00021 #ifndef _RTSP_SERVER_SUPPORTING_HTTP_STREAMING_HH
00022 #define _RTSP_SERVER_SUPPORTING_HTTP_STREAMING_HH
00023 
00024 #ifndef _RTSP_SERVER_HH
00025 #include "RTSPServer.hh"
00026 #endif
00027 #ifndef _BYTE_STREAM_MEMORY_BUFFER_SOURCE_HH
00028 #include "ByteStreamMemoryBufferSource.hh"
00029 #endif
00030 #ifndef _TCP_STREAM_SINK_HH
00031 #include "TCPStreamSink.hh"
00032 #endif
00033 
00034 class RTSPServerSupportingHTTPStreaming: public RTSPServer {
00035 public:
00036   static RTSPServerSupportingHTTPStreaming* createNew(UsageEnvironment& env, Port rtspPort = 554,
00037                                                       UserAuthenticationDatabase* authDatabase = NULL,
00038                                                       unsigned reclamationTestSeconds = 65);
00039 
00040   Boolean setHTTPPort(Port httpPort) { return setUpTunnelingOverHTTP(httpPort); }
00041 
00042 protected:
00043   RTSPServerSupportingHTTPStreaming(UsageEnvironment& env,
00044                                     int ourSocket, Port ourPort,
00045                                     UserAuthenticationDatabase* authDatabase,
00046                                     unsigned reclamationTestSeconds);
00047       // called only by createNew();
00048   virtual ~RTSPServerSupportingHTTPStreaming();
00049 
00050 protected: // redefined virtual functions
00051   virtual RTSPClientConnection* createNewClientConnection(int clientSocket, struct sockaddr_in clientAddr);
00052 
00053 public: // should be protected, but some old compilers complain otherwise
00054   class RTSPClientConnectionSupportingHTTPStreaming: public RTSPServer::RTSPClientConnection {
00055   public:
00056     RTSPClientConnectionSupportingHTTPStreaming(RTSPServer& ourServer, int clientSocket, struct sockaddr_in clientAddr);
00057     virtual ~RTSPClientConnectionSupportingHTTPStreaming();
00058 
00059   protected: // redefined virtual functions
00060     virtual void handleHTTPCmd_StreamingGET(char const* urlSuffix, char const* fullRequestStr);
00061 
00062   protected:
00063     static void afterStreaming(void* clientData);
00064 
00065   private:
00066     u_int32_t fClientSessionId;
00067     ByteStreamMemoryBufferSource* fPlaylistSource;
00068     TCPStreamSink* fTCPSink;
00069   };
00070 };
00071 
00072 #endif

Generated on Fri Sep 12 12:30:23 2014 for live by  doxygen 1.5.2