DynamicRTSPServer Class Reference

#include <DynamicRTSPServer.hh>

Inheritance diagram for DynamicRTSPServer:

Inheritance graph
[legend]
Collaboration diagram for DynamicRTSPServer:

Collaboration graph
[legend]

Public Types

typedef void( responseHandlerForREGISTER )(RTSPServer *rtspServer, unsigned requestId, int resultCode, char *resultString)

Public Member Functions

Boolean setHTTPPort (Port httpPort)
void addServerMediaSession (ServerMediaSession *serverMediaSession)
void removeServerMediaSession (ServerMediaSession *serverMediaSession)
void removeServerMediaSession (char const *streamName)
void closeAllClientSessionsForServerMediaSession (ServerMediaSession *serverMediaSession)
void closeAllClientSessionsForServerMediaSession (char const *streamName)
void deleteServerMediaSession (ServerMediaSession *serverMediaSession)
void deleteServerMediaSession (char const *streamName)
unsigned registerStream (ServerMediaSession *serverMediaSession, char const *remoteClientNameOrAddress, portNumBits remoteClientPortNum, responseHandlerForREGISTER *responseHandler, char const *username=NULL, char const *password=NULL, Boolean receiveOurStreamViaTCP=False, char const *proxyURLSuffix=NULL)
char * rtspURL (ServerMediaSession const *serverMediaSession, int clientSocket=-1) const
char * rtspURLPrefix (int clientSocket=-1) const
UserAuthenticationDatabasesetAuthenticationDatabase (UserAuthenticationDatabase *newDB)
void disableStreamingRTPOverTCP ()
Boolean setUpTunnelingOverHTTP (Port httpPort)
portNumBits httpServerPortNum () const
UsageEnvironmentenvir () const
char const * name () const
virtual Boolean isSource () const
virtual Boolean isSink () const
virtual Boolean isRTCPInstance () const
virtual Boolean isRTSPClient () const
virtual Boolean isMediaSession () const
virtual Boolean isServerMediaSession () const
virtual Boolean isDarwinInjector () const

Static Public Member Functions

static DynamicRTSPServercreateNew (UsageEnvironment &env, Port ourPort, UserAuthenticationDatabase *authDatabase, unsigned reclamationTestSeconds=65)
static Boolean lookupByName (UsageEnvironment &env, char const *name, RTSPServer *&resultServer)
static Boolean lookupByName (UsageEnvironment &env, char const *mediumName, Medium *&resultMedium)
static void close (UsageEnvironment &env, char const *mediumName)
static void close (Medium *medium)

Protected Member Functions

 DynamicRTSPServer (UsageEnvironment &env, int ourSocket, Port ourPort, UserAuthenticationDatabase *authDatabase, unsigned reclamationTestSeconds)
virtual ~DynamicRTSPServer ()
virtual ServerMediaSessionlookupServerMediaSession (char const *streamName)
virtual RTSPClientConnection * createNewClientConnection (int clientSocket, struct sockaddr_in clientAddr)
virtual char const * allowedCommandNames ()
virtual Boolean weImplementREGISTER (char const *proxyURLSuffix, char *&responseStr)
virtual void implementCmd_REGISTER (char const *url, char const *urlSuffix, int socketToRemoteServer, Boolean deliverViaTCP, char const *proxyURLSuffix)
virtual UserAuthenticationDatabasegetAuthenticationDatabaseForCommand (char const *cmdName)
virtual Boolean specialClientAccessCheck (int clientSocket, struct sockaddr_in &clientAddr, char const *urlSuffix)
virtual Boolean specialClientUserAccessCheck (int clientSocket, struct sockaddr_in &clientAddr, char const *urlSuffix, char const *username)
virtual RTSPClientSession * createNewClientSession (u_int32_t sessionId)
TaskTokennextTask ()

Static Protected Member Functions

static int setUpOurSocket (UsageEnvironment &env, Port &ourPort)

Protected Attributes

Port fRTSPServerPort

Friends

class MediaLookupTable

Detailed Description

Definition at line 28 of file DynamicRTSPServer.hh.


Member Typedef Documentation

typedef void( RTSPServer::responseHandlerForREGISTER)(RTSPServer *rtspServer, unsigned requestId, int resultCode, char *resultString) [inherited]

Definition at line 105 of file RTSPServer.hh.


Constructor & Destructor Documentation

DynamicRTSPServer::DynamicRTSPServer ( UsageEnvironment env,
int  ourSocket,
Port  ourPort,
UserAuthenticationDatabase authDatabase,
unsigned  reclamationTestSeconds 
) [protected]

Definition at line 35 of file DynamicRTSPServer.cpp.

Referenced by createNew().

00038   : RTSPServerSupportingHTTPStreaming(env, ourSocket, ourPort, authDatabase, reclamationTestSeconds) {
00039 }

DynamicRTSPServer::~DynamicRTSPServer (  )  [protected, virtual]

Definition at line 41 of file DynamicRTSPServer.cpp.

00041                                       {
00042 }


Member Function Documentation

DynamicRTSPServer * DynamicRTSPServer::createNew ( UsageEnvironment env,
Port  ourPort,
UserAuthenticationDatabase authDatabase,
unsigned  reclamationTestSeconds = 65 
) [static]

Reimplemented from RTSPServerSupportingHTTPStreaming.

Definition at line 26 of file DynamicRTSPServer.cpp.

References DynamicRTSPServer(), env, NULL, and RTSPServer::setUpOurSocket().

Referenced by main().

00028                                                               {
00029   int ourSocket = setUpOurSocket(env, ourPort);
00030   if (ourSocket == -1) return NULL;
00031 
00032   return new DynamicRTSPServer(env, ourSocket, ourPort, authDatabase, reclamationTestSeconds);
00033 }

ServerMediaSession * DynamicRTSPServer::lookupServerMediaSession ( char const *  streamName  )  [protected, virtual]

Reimplemented from RTSPServer.

Definition at line 48 of file DynamicRTSPServer.cpp.

References RTSPServer::addServerMediaSession(), createNewSMS(), Medium::envir(), RTSPServer::lookupServerMediaSession(), NULL, RTSPServer::removeServerMediaSession(), and sms.

00048                                                                   {
00049   // First, check whether the specified "streamName" exists as a local file:
00050   FILE* fid = fopen(streamName, "rb");
00051   Boolean fileExists = fid != NULL;
00052 
00053   // Next, check whether we already have a "ServerMediaSession" for this file:
00054   ServerMediaSession* sms = RTSPServer::lookupServerMediaSession(streamName);
00055   Boolean smsExists = sms != NULL;
00056 
00057   // Handle the four possibilities for "fileExists" and "smsExists":
00058   if (!fileExists) {
00059     if (smsExists) {
00060       // "sms" was created for a file that no longer exists. Remove it:
00061       removeServerMediaSession(sms);
00062     }
00063     return NULL;
00064   } else {
00065     if (!smsExists) {
00066       // Create a new "ServerMediaSession" object for streaming from the named file.
00067       sms = createNewSMS(envir(), streamName, fid);
00068       addServerMediaSession(sms);
00069     }
00070     fclose(fid);
00071     return sms;
00072   }
00073 }

Boolean RTSPServerSupportingHTTPStreaming::setHTTPPort ( Port  httpPort  )  [inline, inherited]

Definition at line 40 of file RTSPServerSupportingHTTPStreaming.hh.

References RTSPServer::setUpTunnelingOverHTTP().

00040 { return setUpTunnelingOverHTTP(httpPort); }

RTSPServer::RTSPClientConnection * RTSPServerSupportingHTTPStreaming::createNewClientConnection ( int  clientSocket,
struct sockaddr_in  clientAddr 
) [protected, virtual, inherited]

Reimplemented from RTSPServer.

Definition at line 47 of file RTSPServerSupportingHTTPStreaming.cpp.

00047                                                                                                             {
00048   return new RTSPClientConnectionSupportingHTTPStreaming(*this, clientSocket, clientAddr);
00049 }

Boolean RTSPServer::lookupByName ( UsageEnvironment env,
char const *  name,
RTSPServer *&  resultServer 
) [static, inherited]

Definition at line 40 of file RTSPServer.cpp.

References env, False, Medium::isRTSPServer(), Medium::lookupByName(), NULL, and True.

00042                                                             {
00043   resultServer = NULL; // unless we succeed
00044   
00045   Medium* medium;
00046   if (!Medium::lookupByName(env, name, medium)) return False;
00047   
00048   if (!medium->isRTSPServer()) {
00049     env.setResultMsg(name, " is not a RTSP server");
00050     return False;
00051   }
00052   
00053   resultServer = (RTSPServer*)medium;
00054   return True;
00055 }

Boolean Medium::lookupByName ( UsageEnvironment env,
char const *  mediumName,
Medium *&  resultMedium 
) [static, inherited]

Definition at line 41 of file Media.cpp.

References env, False, MediaLookupTable::lookup(), NULL, MediaLookupTable::ourMedia(), UsageEnvironment::setResultMsg(), and True.

Referenced by ServerMediaSession::lookupByName(), RTSPServer::lookupByName(), RTSPClient::lookupByName(), RTCPInstance::lookupByName(), MediaSource::lookupByName(), MediaSink::lookupByName(), MediaSession::lookupByName(), and DarwinInjector::lookupByName().

00042                                                          {
00043   resultMedium = MediaLookupTable::ourMedia(env)->lookup(mediumName);
00044   if (resultMedium == NULL) {
00045     env.setResultMsg("Medium ", mediumName, " does not exist");
00046     return False;
00047   }
00048 
00049   return True;
00050 }

void RTSPServer::addServerMediaSession ( ServerMediaSession serverMediaSession  )  [inherited]

Definition at line 57 of file RTSPServer.cpp.

References HashTable::Add(), RTSPServer::fServerMediaSessions, NULL, RTSPServer::removeServerMediaSession(), and ServerMediaSession::streamName().

Referenced by RTSPServerWithREGISTERProxying::implementCmd_REGISTER(), lookupServerMediaSession(), main(), onMatroskaFileCreation(), and onOggFileCreation().

00057                                                                              {
00058   if (serverMediaSession == NULL) return;
00059   
00060   char const* sessionName = serverMediaSession->streamName();
00061   if (sessionName == NULL) sessionName = "";
00062   removeServerMediaSession(sessionName); // in case an existing "ServerMediaSession" with this name already exists
00063   
00064   fServerMediaSessions->Add(sessionName, (void*)serverMediaSession);
00065 }

void RTSPServer::removeServerMediaSession ( ServerMediaSession serverMediaSession  )  [inherited]

Definition at line 71 of file RTSPServer.cpp.

References Medium::close(), ServerMediaSession::deleteWhenUnreferenced(), RTSPServer::fServerMediaSessions, NULL, ServerMediaSession::referenceCount(), HashTable::Remove(), ServerMediaSession::streamName(), and True.

Referenced by RTSPServer::addServerMediaSession(), RTSPServer::deleteServerMediaSession(), lookupServerMediaSession(), RTSPServer::removeServerMediaSession(), RTSPServer::RTSPClientSession::~RTSPClientSession(), and RTSPServer::~RTSPServer().

00071                                                                                 {
00072   if (serverMediaSession == NULL) return;
00073   
00074   fServerMediaSessions->Remove(serverMediaSession->streamName());
00075   if (serverMediaSession->referenceCount() == 0) {
00076     Medium::close(serverMediaSession);
00077   } else {
00078     serverMediaSession->deleteWhenUnreferenced() = True;
00079   }
00080 }

void RTSPServer::removeServerMediaSession ( char const *  streamName  )  [inherited]

Definition at line 82 of file RTSPServer.cpp.

References RTSPServer::fServerMediaSessions, HashTable::Lookup(), and RTSPServer::removeServerMediaSession().

void RTSPServer::closeAllClientSessionsForServerMediaSession ( ServerMediaSession serverMediaSession  )  [inherited]

Definition at line 86 of file RTSPServer.cpp.

References HashTable::Iterator::create(), RTSPServer::fClientSessions, RTSPServer::RTSPClientSession::fOurServerMediaSession, iter, MediaSubsessionIterator::next(), and NULL.

Referenced by RTSPServer::closeAllClientSessionsForServerMediaSession(), RTSPServer::deleteServerMediaSession(), and ProxyServerMediaSession::resetDESCRIBEState().

00086                                                                                                    {
00087   if (serverMediaSession == NULL) return;
00088   
00089   HashTable::Iterator* iter = HashTable::Iterator::create(*fClientSessions);
00090   RTSPServer::RTSPClientSession* clientSession;
00091   char const* key; // dummy
00092   while ((clientSession = (RTSPServer::RTSPClientSession*)(iter->next(key))) != NULL) {
00093     if (clientSession->fOurServerMediaSession == serverMediaSession) {
00094       delete clientSession;
00095     }
00096   }
00097   delete iter;
00098 }

void RTSPServer::closeAllClientSessionsForServerMediaSession ( char const *  streamName  )  [inherited]

Definition at line 100 of file RTSPServer.cpp.

References RTSPServer::closeAllClientSessionsForServerMediaSession(), RTSPServer::fServerMediaSessions, and HashTable::Lookup().

void RTSPServer::deleteServerMediaSession ( ServerMediaSession serverMediaSession  )  [inherited]

Definition at line 104 of file RTSPServer.cpp.

References RTSPServer::closeAllClientSessionsForServerMediaSession(), NULL, and RTSPServer::removeServerMediaSession().

Referenced by RTSPServer::deleteServerMediaSession().

00104                                                                                 {
00105   if (serverMediaSession == NULL) return;
00106   
00107   closeAllClientSessionsForServerMediaSession(serverMediaSession);
00108   removeServerMediaSession(serverMediaSession);
00109 }

void RTSPServer::deleteServerMediaSession ( char const *  streamName  )  [inherited]

Definition at line 111 of file RTSPServer.cpp.

References RTSPServer::deleteServerMediaSession(), RTSPServer::fServerMediaSessions, and HashTable::Lookup().

unsigned RTSPServer::registerStream ( ServerMediaSession serverMediaSession,
char const *  remoteClientNameOrAddress,
portNumBits  remoteClientPortNum,
responseHandlerForREGISTER responseHandler,
char const *  username = NULL,
char const *  password = NULL,
Boolean  receiveOurStreamViaTCP = False,
char const *  proxyURLSuffix = NULL 
) [inherited]

Definition at line 177 of file RTSPServer.cpp.

References RTSPServer::fRegisterRequestCounter, NULL, RTSPServer::RegisterRequestRecord, and RTSPServer::rtspURL().

00181                                                                                                 {
00182   // Create a new "RegisterRequestRecord" that will send the "REGISTER" command.
00183   // (This object will automatically get deleted after we get a response to the "REGISTER" command, or if we're deleted.)
00184   Authenticator* authenticator = NULL;
00185   if (username != NULL) {
00186     if (password == NULL) password = "";
00187     authenticator = new Authenticator(username, password);
00188   }
00189   unsigned requestId = ++fRegisterRequestCounter;
00190   new RegisterRequestRecord(*this, requestId,
00191                             remoteClientNameOrAddress, remoteClientPortNum, rtspURL(serverMediaSession),
00192                             responseHandler, authenticator,
00193                             receiveOurStreamViaTCP, proxyURLSuffix);
00194   
00195   delete authenticator; // we can do this here because it was copied to the "RegisterRequestRecord"
00196   return requestId;
00197 }

char * RTSPServer::rtspURL ( ServerMediaSession const *  serverMediaSession,
int  clientSocket = -1 
) const [inherited]

Definition at line 200 of file RTSPServer.cpp.

References RTSPServer::rtspURLPrefix(), and ServerMediaSession::streamName().

Referenced by announceStream(), RTSPServer::RTSPClientConnection::handleCmd_DESCRIBE(), RTSPServer::RTSPClientSession::handleCmd_PLAY(), RTSPServerWithREGISTERProxying::implementCmd_REGISTER(), main(), onMatroskaFileCreation(), onOggFileCreation(), and RTSPServer::registerStream().

00200                                                                               {
00201   char* urlPrefix = rtspURLPrefix(clientSocket);
00202   char const* sessionName = serverMediaSession->streamName();
00203   
00204   char* resultURL = new char[strlen(urlPrefix) + strlen(sessionName) + 1];
00205   sprintf(resultURL, "%s%s", urlPrefix, sessionName);
00206   
00207   delete[] urlPrefix;
00208   return resultURL;
00209 }

char * RTSPServer::rtspURLPrefix ( int  clientSocket = -1  )  const [inherited]

Definition at line 211 of file RTSPServer.cpp.

References Medium::envir(), RTSPServer::fRTSPServerPort, Port::num(), ourIPAddress(), ReceivingInterfaceAddr, SOCKLEN_T, and strDup().

Referenced by main(), and RTSPServer::rtspURL().

00211                                                       {
00212   struct sockaddr_in ourAddress;
00213   if (clientSocket < 0) {
00214     // Use our default IP address in the URL:
00215     ourAddress.sin_addr.s_addr = ReceivingInterfaceAddr != 0
00216       ? ReceivingInterfaceAddr
00217       : ourIPAddress(envir()); // hack
00218   } else {
00219     SOCKLEN_T namelen = sizeof ourAddress;
00220     getsockname(clientSocket, (struct sockaddr*)&ourAddress, &namelen);
00221   }
00222   
00223   char urlBuffer[100]; // more than big enough for "rtsp://<ip-address>:<port>/"
00224   
00225   portNumBits portNumHostOrder = ntohs(fRTSPServerPort.num());
00226   if (portNumHostOrder == 554 /* the default port number */) {
00227     sprintf(urlBuffer, "rtsp://%s/", AddressString(ourAddress).val());
00228   } else {
00229     sprintf(urlBuffer, "rtsp://%s:%hu/",
00230             AddressString(ourAddress).val(), portNumHostOrder);
00231   }
00232   
00233   return strDup(urlBuffer);
00234 }

UserAuthenticationDatabase * RTSPServer::setAuthenticationDatabase ( UserAuthenticationDatabase newDB  )  [inherited]

Definition at line 236 of file RTSPServer.cpp.

References RTSPServer::fAuthDB.

00236                                                                                                    {
00237   UserAuthenticationDatabase* oldDB = fAuthDB;
00238   fAuthDB = newDB;
00239   
00240   return oldDB;
00241 }

void RTSPServer::disableStreamingRTPOverTCP (  )  [inline, inherited]

Definition at line 139 of file RTSPServer.hh.

References RTSPServer::fAllowStreamingRTPOverTCP, and False.

00139                                     {
00140     fAllowStreamingRTPOverTCP = False;
00141   }

Boolean RTSPServer::setUpTunnelingOverHTTP ( Port  httpPort  )  [inherited]

Definition at line 243 of file RTSPServer.cpp.

References Medium::envir(), False, RTSPServer::fHTTPServerPort, RTSPServer::fHTTPServerSocket, RTSPServer::incomingConnectionHandlerHTTP(), RTSPServer::setUpOurSocket(), UsageEnvironment::taskScheduler(), True, and TaskScheduler::turnOnBackgroundReadHandling().

Referenced by main(), and RTSPServerSupportingHTTPStreaming::setHTTPPort().

00243                                                         {
00244   fHTTPServerSocket = setUpOurSocket(envir(), httpPort);
00245   if (fHTTPServerSocket >= 0) {
00246     fHTTPServerPort = httpPort;
00247     envir().taskScheduler().turnOnBackgroundReadHandling(fHTTPServerSocket,
00248                                                          (TaskScheduler::BackgroundHandlerProc*)&incomingConnectionHandlerHTTP, this);
00249     return True;
00250   }
00251   
00252   return False;
00253 }

portNumBits RTSPServer::httpServerPortNum (  )  const [inherited]

Definition at line 255 of file RTSPServer.cpp.

References RTSPServer::fHTTPServerPort, and Port::num().

Referenced by main().

00255                                                 {
00256   return ntohs(fHTTPServerPort.num());
00257 }

int RTSPServer::setUpOurSocket ( UsageEnvironment env,
Port ourPort 
) [static, protected, inherited]

Definition at line 261 of file RTSPServer.cpp.

References closeSocket, env, getSourcePort(), increaseSendBufferTo(), LISTEN_BACKLOG_SIZE, Port::num(), UsageEnvironment::setResultErrMsg(), and setupStreamSocket().

Referenced by createNew(), RTSPServerSupportingHTTPStreaming::createNew(), RTSPServer::createNew(), and RTSPServer::setUpTunnelingOverHTTP().

00261                                                                    {
00262   int ourSocket = -1;
00263   
00264   do {
00265     // The following statement is enabled by default.
00266     // Don't disable it (by defining ALLOW_RTSP_SERVER_PORT_REUSE) unless you know what you're doing.
00267 #ifndef ALLOW_RTSP_SERVER_PORT_REUSE
00268     NoReuse dummy(env); // Don't use this socket if there's already a local server using it
00269 #endif
00270     
00271     ourSocket = setupStreamSocket(env, ourPort);
00272     if (ourSocket < 0) break;
00273     
00274     // Make sure we have a big send buffer:
00275     if (!increaseSendBufferTo(env, ourSocket, 50*1024)) break;
00276     
00277     // Allow multiple simultaneous connections:
00278     if (listen(ourSocket, LISTEN_BACKLOG_SIZE) < 0) {
00279       env.setResultErrMsg("listen() failed: ");
00280       break;
00281     }
00282     
00283     if (ourPort.num() == 0) {
00284       // bind() will have chosen a port for us; return it also:
00285       if (!getSourcePort(env, ourSocket, ourPort)) break;
00286     }
00287     
00288     return ourSocket;
00289   } while (0);
00290   
00291   if (ourSocket != -1) ::closeSocket(ourSocket);
00292   return -1;
00293 }

char const * RTSPServer::allowedCommandNames (  )  [protected, virtual, inherited]

Reimplemented in HandlerServerForREGISTERCommand, and RTSPServerWithREGISTERProxying.

Definition at line 295 of file RTSPServer.cpp.

Referenced by RTSPServerWithREGISTERProxying::allowedCommandNames(), RTSPServer::RTSPClientConnection::handleCmd_bad(), RTSPServer::RTSPClientConnection::handleCmd_notSupported(), and RTSPServer::RTSPClientConnection::handleCmd_OPTIONS().

00295                                             {
00296   return "OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER";
00297 }

Boolean RTSPServer::weImplementREGISTER ( char const *  proxyURLSuffix,
char *&  responseStr 
) [protected, virtual, inherited]

Reimplemented in HandlerServerForREGISTERCommand, and RTSPServerWithREGISTERProxying.

Definition at line 299 of file RTSPServer.cpp.

References False, and NULL.

00299                                                                                           {
00300   // By default, servers do not implement our custom "REGISTER" command:
00301   responseStr = NULL;
00302   return False;
00303 }

void RTSPServer::implementCmd_REGISTER ( char const *  url,
char const *  urlSuffix,
int  socketToRemoteServer,
Boolean  deliverViaTCP,
char const *  proxyURLSuffix 
) [protected, virtual, inherited]

Reimplemented in HandlerServerForREGISTERCommand, and RTSPServerWithREGISTERProxying.

Definition at line 305 of file RTSPServer.cpp.

Referenced by RTSPServer::RTSPClientConnection::continueHandlingREGISTER1().

00306                                                                                                   {
00307   // By default, this function is a 'noop'
00308 }

UserAuthenticationDatabase * RTSPServer::getAuthenticationDatabaseForCommand ( char const *  cmdName  )  [protected, virtual, inherited]

Reimplemented in RTSPServerWithREGISTERProxying.

Definition at line 310 of file RTSPServer.cpp.

References RTSPServer::fAuthDB.

Referenced by RTSPServerWithREGISTERProxying::getAuthenticationDatabaseForCommand().

00310                                                                                                    {
00311   // default implementation
00312   return fAuthDB;
00313 }

Boolean RTSPServer::specialClientAccessCheck ( int  clientSocket,
struct sockaddr_in &  clientAddr,
char const *  urlSuffix 
) [protected, virtual, inherited]

Definition at line 315 of file RTSPServer.cpp.

References True.

00315                                                                                                                                 {
00316   // default implementation
00317   return True;
00318 }

Boolean RTSPServer::specialClientUserAccessCheck ( int  clientSocket,
struct sockaddr_in &  clientAddr,
char const *  urlSuffix,
char const *  username 
) [protected, virtual, inherited]

Definition at line 320 of file RTSPServer.cpp.

References True.

00321                                                                                                        {
00322   // default implementation; no further access restrictions:
00323   return True;
00324 }

RTSPServer::RTSPClientSession * RTSPServer::createNewClientSession ( u_int32_t  sessionId  )  [protected, virtual, inherited]

Definition at line 2075 of file RTSPServer.cpp.

References RTSPServer::RTSPClientSession.

Referenced by RTSPServer::RTSPClientConnection::handleRequestBytes().

02075                                                       {
02076   return new RTSPClientSession(*this, sessionId);
02077 }

void Medium::close ( UsageEnvironment env,
char const *  mediumName 
) [static, inherited]

Definition at line 52 of file Media.cpp.

References env, MediaLookupTable::ourMedia(), and MediaLookupTable::remove().

Referenced by afterPlaying(), Medium::close(), closeMediaSinks(), OnDemandServerMediaSubsession::closeStreamSource(), continueAfterClientCreation0(), continueAfterTEARDOWN(), WAVAudioFileSource::createNew(), QuickTimeFileSink::createNew(), QCELPAudioRTPSource::createNew(), MP3FileSource::createNew(), AVIFileSink::createNew(), AMRAudioRTPSource::createNew(), WAVAudioFileServerMediaSubsession::createNewStreamSource(), MPEG1or2DemuxedServerMediaSubsession::createNewStreamSource(), MediaSubsession::deInitiate(), ServerMediaSession::deleteAllSubsessions(), RTSPServerSupportingHTTPStreaming::RTSPClientConnectionSupportingHTTPStreaming::handleHTTPCmd_StreamingGET(), MPEG1or2ProgramStreamFileDuration(), MPEG1or2Demux::noteElementaryStreamDeletion(), ByteStreamMultiFileSource::onSourceClosure1(), StreamState::reclaim(), registerResponseHandler(), RTSPServer::removeServerMediaSession(), ProxyServerMediaSession::resetDESCRIBEState(), OnDemandServerMediaSubsession::sdpLines(), shutdownStream(), subsessionAfterPlaying(), ClientTrickPlayState::updateStateOnScaleChange(), AMRDeinterleaver::~AMRDeinterleaver(), ByteStreamMultiFileSource::~ByteStreamMultiFileSource(), DarwinInjector::~DarwinInjector(), FramedFilter::~FramedFilter(), H264or5VideoRTPSink::~H264or5VideoRTPSink(), InputESSourceRecord::~InputESSourceRecord(), MatroskaFileParser::~MatroskaFileParser(), MatroskaFileServerDemux::~MatroskaFileServerDemux(), MPEG1or2Demux::~MPEG1or2Demux(), MPEG1or2FileServerDemux::~MPEG1or2FileServerDemux(), MPEG2TransportFileServerMediaSubsession::~MPEG2TransportFileServerMediaSubsession(), MPEG2TransportStreamFromPESSource::~MPEG2TransportStreamFromPESSource(), OggFileParser::~OggFileParser(), OggFileServerDemux::~OggFileServerDemux(), ProxyServerMediaSession::~ProxyServerMediaSession(), RTSPServerSupportingHTTPStreaming::RTSPClientConnectionSupportingHTTPStreaming::~RTSPClientConnectionSupportingHTTPStreaming(), ServerMediaSubsession::~ServerMediaSubsession(), StreamClientState::~StreamClientState(), StreamReplicator::~StreamReplicator(), and T140TextRTPSink::~T140TextRTPSink().

00052                                                           {
00053   MediaLookupTable::ourMedia(env)->remove(name);
00054 }

void Medium::close ( Medium medium  )  [static, inherited]

Definition at line 56 of file Media.cpp.

References Medium::close(), Medium::envir(), Medium::name(), and NULL.

00056                                  {
00057   if (medium == NULL) return;
00058 
00059   close(medium->envir(), medium->name());
00060 }

UsageEnvironment& Medium::envir (  )  const [inline, inherited]

Definition at line 59 of file Media.hh.

References Medium::fEnviron.

Referenced by QuickTimeFileSink::addArbitraryString(), FileSink::addData(), RTCPInstance::addStreamSocket(), MPEG2IFrameIndexFromTransportStream::addToTail(), StreamParser::afterGettingBytes1(), DummySink::afterGettingFrame(), TCPStreamSink::afterGettingFrame(), T140IdleFilter::afterGettingFrame(), FileSink::afterGettingFrame(), MultiFramedRTPSink::afterGettingFrame1(), InputESSourceRecord::afterGettingFrame1(), MPEG2TransportStreamFramer::afterGettingFrame1(), MPEG2IFrameIndexFromTransportStream::afterGettingFrame1(), H264or5VideoStreamDiscreteFramer::afterGettingFrame1(), BasicUDPSink::afterGettingFrame1(), MPEG4VideoFileServerMediaSubsession::afterPlayingDummy1(), H265VideoFileServerMediaSubsession::afterPlayingDummy1(), H264VideoFileServerMediaSubsession::afterPlayingDummy1(), MPEG4VideoStreamParser::analyzeVOLHeader(), announceStream(), RTSPServer::RTSPClientConnection::changeClientInputSocket(), MPEG4VideoFileServerMediaSubsession::checkForAuxSDPLine1(), H265VideoFileServerMediaSubsession::checkForAuxSDPLine1(), H264VideoFileServerMediaSubsession::checkForAuxSDPLine1(), Medium::close(), ProxyServerMediaSubsession::closeStreamSource(), MPEG2IFrameIndexFromTransportStream::compactParseBuffer(), RTSPClient::connectionHandler1(), RTSPClient::connectToServer(), ProxyServerMediaSession::continueAfterDESCRIBE(), ProxyRTSPClient::continueAfterLivenessCommand(), ProxyRTSPClient::continueAfterSETUP(), T140TextRTPSink::continuePlaying(), QuickTimeFileSink::continuePlaying(), H264or5VideoRTPSink::continuePlaying(), AVIFileSink::continuePlaying(), ProxyServerMediaSubsession::createNewRTPSink(), MPEG4VideoFileServerMediaSubsession::createNewRTPSink(), MPEG2TransportUDPServerMediaSubsession::createNewRTPSink(), MPEG2TransportFileServerMediaSubsession::createNewRTPSink(), MPEG1or2VideoFileServerMediaSubsession::createNewRTPSink(), MPEG1or2DemuxedServerMediaSubsession::createNewRTPSink(), MP3AudioFileServerMediaSubsession::createNewRTPSink(), H265VideoFileServerMediaSubsession::createNewRTPSink(), H264VideoFileServerMediaSubsession::createNewRTPSink(), H263plusVideoFileServerMediaSubsession::createNewRTPSink(), DVVideoFileServerMediaSubsession::createNewRTPSink(), AMRAudioFileServerMediaSubsession::createNewRTPSink(), ADTSAudioFileServerMediaSubsession::createNewRTPSink(), AC3AudioFileServerMediaSubsession::createNewRTPSink(), HandlerServerForREGISTERCommand::createNewRTSPClient(), ProxyServerMediaSubsession::createNewStreamSource(), MPEG4VideoFileServerMediaSubsession::createNewStreamSource(), MPEG2TransportUDPServerMediaSubsession::createNewStreamSource(), MPEG2TransportFileServerMediaSubsession::createNewStreamSource(), MPEG1or2VideoFileServerMediaSubsession::createNewStreamSource(), MPEG1or2DemuxedServerMediaSubsession::createNewStreamSource(), MP3AudioFileServerMediaSubsession::createNewStreamSource(), H265VideoFileServerMediaSubsession::createNewStreamSource(), H264VideoFileServerMediaSubsession::createNewStreamSource(), H263plusVideoFileServerMediaSubsession::createNewStreamSource(), DVVideoFileServerMediaSubsession::createNewStreamSource(), AMRAudioFileServerMediaSubsession::createNewStreamSource(), ADTSAudioFileServerMediaSubsession::createNewStreamSource(), AC3AudioFileServerMediaSubsession::createNewStreamSource(), OggFile::createRTPSinkForTrackNumber(), MatroskaFile::createRTPSinkForTrackNumber(), MatroskaFile::createSourceForStreaming(), AMRDeinterleavingBuffer::deliverIncomingFrame(), MPEG2IFrameIndexFromTransportStream::deliverIndexRecord(), SegmentQueue::dequeue(), DeviceSource::DeviceSource(), WAVAudioFileSource::doGetNextFrame(), T140IdleFilter::doGetNextFrame(), MPEG2TransportStreamMultiplexor::doGetNextFrame(), MPEG2IFrameIndexFromTransportStream::doGetNextFrame(), MP3FileSource::doGetNextFrame(), H264or5Fragmenter::doGetNextFrame(), ByteStreamMultiFileSource::doGetNextFrame(), ByteStreamFileSource::doGetNextFrame(), BasicUDPSource::doGetNextFrame(), AMRAudioFileSource::doGetNextFrame(), ADTSAudioFileSource::doGetNextFrame(), MultiFramedRTPSource::doGetNextFrame1(), MP3FileSource::doGetNextFrame1(), ADUFromMP3Source::doGetNextFrame1(), SIPClient::doInviteStateMachine(), WAVAudioFileSource::doReadFromFile(), ByteStreamFileSource::doReadFromFile(), MPEG1or2VideoRTPSink::doSpecialFrameHandling(), MP3ADURTPSink::doSpecialFrameHandling(), H263plusVideoRTPSink::doSpecialFrameHandling(), WAVAudioFileSource::doStopGettingFrames(), T140IdleFilter::doStopGettingFrames(), MultiFramedRTPSource::doStopGettingFrames(), FramedSource::doStopGettingFrames(), ByteStreamFileSource::doStopGettingFrames(), BasicUDPSource::doStopGettingFrames(), SegmentQueue::enqueueNewSegment(), StreamParser::ensureValidBytes1(), MediaSubsession::env(), SubsessionIOState::envir(), RTSPServer::RTSPClientSession::envir(), RTSPServer::RTSPClientConnection::envir(), RTPInterface::envir(), AVISubsessionIOState::envir(), ServerMediaSession::generateSDPDescription(), RTPSource::getAttributes(), MP3FileSource::getAttributes(), MP3ADUTranscoder::getAttributes(), MediaSource::getAttributes(), MPEG4VideoFileServerMediaSubsession::getAuxSDPLine(), H265VideoFileServerMediaSubsession::getAuxSDPLine(), H264VideoFileServerMediaSubsession::getAuxSDPLine(), getMPEG1or2TimeCode(), FramedSource::getNextFrame(), getOptions(), DVVideoStreamFramer::getProfile(), SIPClient::getResponse(), SIPClient::getResponseCode(), getSDPDescription(), OnDemandServerMediaSubsession::getStreamParameters(), RTSPClient::handleAlternativeRequestByte1(), RTSPServer::RTSPClientConnection::handleCmd_REGISTER(), RTSPClient::handleGET_PARAMETERResponse(), RTSPServerSupportingHTTPStreaming::RTSPClientConnectionSupportingHTTPStreaming::handleHTTPCmd_StreamingGET(), RTSPClient::handleIncomingRequest(), RTSPClient::handlePLAYResponse(), RTSPClient::handleRequestError(), RTSPClient::handleResponseBytes(), RTSPClient::handleSETUPResponse(), RTSPServerWithREGISTERProxying::implementCmd_REGISTER(), RTSPServer::incomingConnectionHandler(), RTSPClient::incomingDataHandler1(), RTCPInstance::incomingReportHandler1(), MP3FileSource::initializeStream(), MediaSession::initializeWithSDP(), MediaSession::initiateByMediaType(), SIPClient::invite1(), lookupServerMediaSession(), MatroskaDemux::MatroskaDemux(), MatroskaFile::MatroskaFile(), MPEG4GenericRTPSource::MPEG4GenericRTPSource(), MultiFramedRTPSource::networkReadHandler1(), OggDemux::newDemuxedTrack(), OggDemux::newDemuxedTrackByTrackNumber(), MatroskaDemux::newDemuxedTrackByTrackNumber(), MPEG1or2FileServerDemux::newElementaryStream(), MPEG1or2Demux::newElementaryStream(), MPEG4GenericBufferedPacket::nextEnclosedFrameSize(), AMRBufferedPacket::nextEnclosedFrameSize(), OggDemux::OggDemux(), OggFile::OggFile(), T140IdleFilter::onSourceClosure(), MediaSink::onSourceClosure(), RTSPClient::openConnection(), MPEG2TransportStreamIndexFile::openFid(), MPEG2IFrameIndexFromTransportStream::parseFrame(), AC3AudioStreamParser::parseFrame(), MPEGProgramStreamParser::parsePackHeader(), MPEGProgramStreamParser::parsePESPacket(), SIPClient::parseResponseCode(), MediaSession::parseSDPLine(), MPEG1or2VideoStreamParser::parseSlice(), MatroskaFileParser::parseStartOfFile(), MPEGProgramStreamParser::parseSystemHeader(), MPEG4VideoStreamParser::parseVideoObjectLayer(), MPEG4VideoStreamParser::parseVideoObjectPlane(), MPEG4VideoStreamParser::parseVisualObject(), TCPStreamSink::processBuffer(), SIPClient::processURL(), AC3AudioStreamParser::readAndSaveAFrame(), MPEG1or2Demux::registerReadInterest(), RTCPInstance::reschedule(), RTSPClient::resendCommand(), ProxyRTSPClient::reset(), RTSPClient::resetTCPSockets(), RTSPClient::responseHandlerForHTTP_GET1(), RTSPClient::RTSPClient(), RTSPServer::rtspURLPrefix(), RTCPInstance::schedule(), ProxyRTSPClient::scheduleDESCRIBECommand(), ProxyRTSPClient::scheduleLivenessCommand(), OnDemandServerMediaSubsession::sdpLines(), SIPClient::sendACK(), SIPClient::sendBYE(), RTSPClient::sendDummyUDPPackets(), SIPClient::sendINVITE(), MultiFramedRTPSink::sendPacketIfNecessary(), SIPClient::sendRequest(), RTSPClient::sendRequest(), DarwinInjector::setDestination(), RTSPClient::setRequestFields(), RTSPClient::setupHTTPTunneling1(), setupNextSubsession(), RTSPServer::setUpTunnelingOverHTTP(), QuickTimeFileSink::setWord(), AVIFileSink::setWord(), QuickTimeFileSink::setWord64(), shutdownStream(), SIPClient::SIPClient(), TCPStreamSink::socketWritableHandler1(), AMRAudioRTPSink::sourceIsCompatibleWithUs(), QuickTimeFileSink::startPlaying(), StreamState::startPlaying(), MediaSink::startPlaying(), AVIFileSink::startPlaying(), startPlayingSession(), PassiveServerMediaSubsession::startStream(), MediaSink::stopPlaying(), ProxyServerMediaSubsession::subsessionByeHandler(), tearDownSession(), SIPClient::timerAHandler(), SIPClient::timerBHandler(), SIPClient::timerDHandler(), ClientTrickPlayState::updateStateOnScaleChange(), MPEG2TransportStreamFramer::updateTSPacketDurationEstimate(), BasicUDPSource::~BasicUDPSource(), ByteStreamFileSource::~ByteStreamFileSource(), DeviceSource::~DeviceSource(), ProxyServerMediaSession::~ProxyServerMediaSession(), ProxyServerMediaSubsession::~ProxyServerMediaSubsession(), RTSPClient::~RTSPClient(), RTSPServer::~RTSPServer(), StreamClientState::~StreamClientState(), T140IdleFilter::~T140IdleFilter(), TCPStreamSink::~TCPStreamSink(), and WAVAudioFileSource::~WAVAudioFileSource().

00059 {return fEnviron;}

char const* Medium::name (  )  const [inline, inherited]

Definition at line 61 of file Media.hh.

References Medium::fMediumName.

Referenced by QuickTimeFileSink::addAtom_hdlr2(), Medium::close(), MP3ADUTranscoder::createNew(), MP3FromADUSource::createNew(), ADUFromMP3Source::createNew(), and MP3FileSource::initializeStream().

00061 {return fMediumName;}

Boolean Medium::isSource (  )  const [virtual, inherited]

Reimplemented in MediaSource.

Definition at line 62 of file Media.cpp.

References False.

Referenced by MediaSource::lookupByName().

00062                                {
00063   return False; // default implementation
00064 }

Boolean Medium::isSink (  )  const [virtual, inherited]

Reimplemented in MediaSink.

Definition at line 66 of file Media.cpp.

References False.

Referenced by MediaSink::lookupByName().

00066                              {
00067   return False; // default implementation
00068 }

Boolean Medium::isRTCPInstance (  )  const [virtual, inherited]

Reimplemented in RTCPInstance.

Definition at line 70 of file Media.cpp.

References False.

Referenced by RTCPInstance::lookupByName().

00070                                      {
00071   return False; // default implementation
00072 }

Boolean Medium::isRTSPClient (  )  const [virtual, inherited]

Reimplemented in RTSPClient.

Definition at line 74 of file Media.cpp.

References False.

Referenced by RTSPClient::lookupByName().

00074                                    {
00075   return False; // default implementation
00076 }

Boolean Medium::isMediaSession (  )  const [virtual, inherited]

Reimplemented in MediaSession.

Definition at line 82 of file Media.cpp.

References False.

Referenced by MediaSession::lookupByName().

00082                                      {
00083   return False; // default implementation
00084 }

Boolean Medium::isServerMediaSession (  )  const [virtual, inherited]

Reimplemented in ServerMediaSession.

Definition at line 86 of file Media.cpp.

References False.

Referenced by ServerMediaSession::lookupByName().

00086                                            {
00087   return False; // default implementation
00088 }

Boolean Medium::isDarwinInjector (  )  const [virtual, inherited]

Reimplemented in DarwinInjector.

Definition at line 90 of file Media.cpp.

References False.

Referenced by DarwinInjector::lookupByName().

00090                                        {
00091   return False; // default implementation
00092 }

TaskToken& Medium::nextTask (  )  [inline, protected, inherited]

Definition at line 78 of file Media.hh.

References Medium::fNextTask.

Referenced by BasicUDPSink::afterGettingFrame1(), MPEG4VideoFileServerMediaSubsession::afterPlayingDummy1(), H265VideoFileServerMediaSubsession::afterPlayingDummy1(), H264VideoFileServerMediaSubsession::afterPlayingDummy1(), MPEG4VideoFileServerMediaSubsession::checkForAuxSDPLine1(), H265VideoFileServerMediaSubsession::checkForAuxSDPLine1(), H264VideoFileServerMediaSubsession::checkForAuxSDPLine1(), MP3FileSource::doGetNextFrame(), AMRAudioFileSource::doGetNextFrame(), ADTSAudioFileSource::doGetNextFrame(), MultiFramedRTPSource::doGetNextFrame1(), WAVAudioFileSource::doReadFromFile(), ByteStreamFileSource::doReadFromFile(), WAVAudioFileSource::doStopGettingFrames(), MultiFramedRTPSource::doStopGettingFrames(), FramedSource::doStopGettingFrames(), ByteStreamFileSource::doStopGettingFrames(), MediaSink::onSourceClosure(), RTCPInstance::reschedule(), RTCPInstance::schedule(), MultiFramedRTPSink::sendPacketIfNecessary(), and MediaSink::stopPlaying().

00078                         {
00079         return fNextTask;
00080   }


Friends And Related Function Documentation

friend class MediaLookupTable [friend, inherited]

Definition at line 74 of file Media.hh.


Field Documentation

Port RTSPServer::fRTSPServerPort [protected, inherited]

Definition at line 353 of file RTSPServer.hh.

Referenced by RTSPServer::rtspURLPrefix(), and HandlerServerForREGISTERCommand::serverPortNum().


The documentation for this class was generated from the following files:
Generated on Wed Apr 23 16:16:00 2014 for live by  doxygen 1.5.2