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-2008 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 
00078 private: // redefined virtual functions
00079   virtual Boolean isDarwinInjector() const;
00080 
00081 private:
00082   DarwinInjector(UsageEnvironment& env,
00083                  char const* applicationName, int verbosityLevel);
00084       // called only by createNew()
00085 
00086   virtual ~DarwinInjector();
00087 
00088 private:
00089   char const* fApplicationName;
00090   int fVerbosityLevel;
00091   RTSPClient* fRTSPClient;
00092   unsigned fSubstreamSDPSizes;
00093   SubstreamDescriptor* fHeadSubstream;
00094   SubstreamDescriptor* fTailSubstream;
00095   MediaSession* fSession;
00096   unsigned fLastTrackId;
00097 };
00098 
00099 #endif

Generated on Tue Oct 7 15:38:08 2008 for live by  doxygen 1.5.2