liveMedia/include/DarwinInjector.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-2012 Live Networks, Inc.  All rights reserved.
00018 // An object that redirects one or more RTP/RTCP streams - forming a single
00019 // multimedia session - into a 'Darwin Streaming Server' (for subsequent
00020 // reflection to potentially arbitrarily many remote RTSP clients).
00021 // C++ header
00022 
00023 #ifndef _DARWIN_INJECTOR_HH
00024 #define _DARWIN_INJECTOR_HH
00025 
00026 #ifndef _RTSP_CLIENT_HH
00027 #include <RTSPClient.hh>
00028 #endif
00029 
00030 #ifndef _RTCP_HH
00031 #include <RTCP.hh>
00032 #endif
00033 
00034 /*
00035 To use a "DarwinInjector":
00036   1/ Create RTP sinks and RTCP instances for each audio or video subsession.
00037        Note: These can use 0.0.0.0 for the address, and 0 for the port number,
00038        of each 'groupsock')
00039   2/ Call "addStream()" for each.
00040   3/ Call "setDestination()" to specify the remote Darwin Streaming Server.
00041      Note: You must have 'write' permission on the Darwin Streaming Server.
00042        This can be set up using a "qtaccess" file in the server's 'movies'
00043        directory.  For example, the following "qtaccess" file allows anyone to
00044        play streams from the server, but allows only valid users to
00045        inject streams *into* the server:
00046            <Limit WRITE>
00047            require valid-user
00048            </Limit>
00049            require any-user
00050      Use the "remoteUserName" and "remotePassword" parameters to
00051      "setDestination()", as appropriate.
00052   4/ Call "startPlaying" on each RTP sink (from the corresponding 'source').
00053 */
00054 
00055 class SubstreamDescriptor; // forward
00056 
00057 class DarwinInjector: public Medium {
00058 public:
00059   static DarwinInjector* createNew(UsageEnvironment& env,
00060                                    char const* applicationName = "DarwinInjector",
00061                                    int verbosityLevel = 0);
00062 
00063   static Boolean lookupByName(UsageEnvironment& env, char const* name,
00064                               DarwinInjector*& result);
00065 
00066   void addStream(RTPSink* rtpSink, RTCPInstance* rtcpInstance);
00067 
00068   Boolean setDestination(char const* remoteRTSPServerNameOrAddress,
00069                          char const* remoteFileName,
00070                          char const* sessionName = "",
00071                          char const* sessionInfo = "",
00072                          portNumBits remoteRTSPServerPortNumber = 554,
00073                          char const* remoteUserName = "",
00074                          char const* remotePassword = "",
00075                          char const* sessionAuthor = "",
00076                          char const* sessionCopyright = "",
00077                          int timeout = -1);
00078 
00079 private: // redefined virtual functions
00080   virtual Boolean isDarwinInjector() const;
00081 
00082 private:
00083   DarwinInjector(UsageEnvironment& env,
00084                  char const* applicationName, int verbosityLevel);
00085       // called only by createNew()
00086 
00087   virtual ~DarwinInjector();
00088 
00089   static void genericResponseHandler(RTSPClient* rtspClient, int responseCode, char* responseString);
00090   void genericResponseHandler1(int responseCode, char* responseString);
00091 
00092 private:
00093   char const* fApplicationName;
00094   int fVerbosityLevel;
00095   RTSPClient* fRTSPClient;
00096   unsigned fSubstreamSDPSizes;
00097   SubstreamDescriptor* fHeadSubstream;
00098   SubstreamDescriptor* fTailSubstream;
00099   MediaSession* fSession;
00100   unsigned fLastTrackId;
00101   char fWatchVariable;
00102   int fResultCode;
00103   char* fResultString;
00104 };
00105 
00106 #endif

Generated on Thu May 10 20:25:11 2012 for live by  doxygen 1.5.2