RTSPClientForDarwinInjector Class Reference

Inheritance diagram for RTSPClientForDarwinInjector:

Inheritance graph
[legend]
Collaboration diagram for RTSPClientForDarwinInjector:

Collaboration graph
[legend]

Public Types

typedef void( responseHandler )(RTSPClient *rtspClient, int resultCode, char *resultString)

Public Member Functions

 RTSPClientForDarwinInjector (UsageEnvironment &env, char const *rtspURL, int verbosityLevel, char const *applicationName, DarwinInjector *ourDarwinInjector)
virtual ~RTSPClientForDarwinInjector ()
unsigned sendDescribeCommand (responseHandler *responseHandler, Authenticator *authenticator=NULL)
unsigned sendOptionsCommand (responseHandler *responseHandler, Authenticator *authenticator=NULL)
unsigned sendAnnounceCommand (char const *sdpDescription, responseHandler *responseHandler, Authenticator *authenticator=NULL)
unsigned sendSetupCommand (MediaSubsession &subsession, responseHandler *responseHandler, Boolean streamOutgoing=False, Boolean streamUsingTCP=False, Boolean forceMulticastOnUnspecified=False, Authenticator *authenticator=NULL)
unsigned sendPlayCommand (MediaSession &session, responseHandler *responseHandler, double start=0.0f, double end=-1.0f, float scale=1.0f, Authenticator *authenticator=NULL)
unsigned sendPlayCommand (MediaSubsession &subsession, responseHandler *responseHandler, double start=0.0f, double end=-1.0f, float scale=1.0f, Authenticator *authenticator=NULL)
unsigned sendPauseCommand (MediaSession &session, responseHandler *responseHandler, Authenticator *authenticator=NULL)
unsigned sendPauseCommand (MediaSubsession &subsession, responseHandler *responseHandler, Authenticator *authenticator=NULL)
unsigned sendRecordCommand (MediaSession &session, responseHandler *responseHandler, Authenticator *authenticator=NULL)
unsigned sendRecordCommand (MediaSubsession &subsession, responseHandler *responseHandler, Authenticator *authenticator=NULL)
unsigned sendTeardownCommand (MediaSession &session, responseHandler *responseHandler, Authenticator *authenticator=NULL)
unsigned sendTeardownCommand (MediaSubsession &subsession, responseHandler *responseHandler, Authenticator *authenticator=NULL)
unsigned sendSetParameterCommand (MediaSession &session, responseHandler *responseHandler, char const *parameterName, char const *parameterValue, Authenticator *authenticator=NULL)
unsigned sendGetParameterCommand (MediaSession &session, responseHandler *responseHandler, char const *parameterName, Authenticator *authenticator=NULL)
Boolean changeResponseHandler (unsigned cseq, responseHandler *newResponseHandler)
int socketNum () const
void setUserAgentString (char const *userAgentName)
unsigned sessionTimeoutParameter () const
char const * url () const
char * describeURL (char const *url, Authenticator *authenticator=NULL, Boolean allowKasennaProtocol=False, int timeout=-1)
char * describeWithPassword (char const *url, char const *username, char const *password, Boolean allowKasennaProtocol=False, int timeout=-1)
char * sendOptionsCmd (char const *url, char *username=NULL, char *password=NULL, Authenticator *authenticator=NULL, int timeout=-1)
Boolean announceSDPDescription (char const *url, char const *sdpDescription, Authenticator *authenticator=NULL, int timeout=-1)
Boolean announceWithPassword (char const *url, char const *sdpDescription, char const *username, char const *password, int timeout=-1)
Boolean setupMediaSubsession (MediaSubsession &subsession, Boolean streamOutgoing=False, Boolean streamUsingTCP=False, Boolean forceMulticastOnUnspecified=False)
Boolean playMediaSession (MediaSession &session, double start=0.0f, double end=-1.0f, float scale=1.0f)
Boolean playMediaSubsession (MediaSubsession &subsession, double start=0.0f, double end=-1.0f, float scale=1.0f, Boolean hackForDSS=False)
Boolean pauseMediaSession (MediaSession &session)
Boolean pauseMediaSubsession (MediaSubsession &subsession)
Boolean recordMediaSubsession (MediaSubsession &subsession)
Boolean setMediaSessionParameter (MediaSession &session, char const *parameterName, char const *parameterValue)
Boolean getMediaSessionParameter (MediaSession &session, char const *parameterName, char *&parameterValue)
Boolean teardownMediaSession (MediaSession &session)
Boolean teardownMediaSubsession (MediaSubsession &subsession)
UsageEnvironmentenvir () const
char const * name () const
virtual Boolean isSource () const
virtual Boolean isSink () const
virtual Boolean isRTCPInstance () const
virtual Boolean isRTSPServer () const
virtual Boolean isMediaSession () const
virtual Boolean isServerMediaSession () const
virtual Boolean isDarwinInjector () const

Static Public Member Functions

static RTSPClientcreateNew (UsageEnvironment &env, char const *rtspURL, int verbosityLevel=0, char const *applicationName=NULL, portNumBits tunnelOverHTTPPortNum=0)
static RTSPClientcreateNew (UsageEnvironment &env, int verbosityLevel=0, char const *applicationName=NULL, portNumBits tunnelOverHTTPPortNum=0)
static Boolean lookupByName (UsageEnvironment &env, char const *sourceName, RTSPClient *&resultClient)
static Boolean lookupByName (UsageEnvironment &env, char const *mediumName, Medium *&resultMedium)
static Boolean parseRTSPURL (UsageEnvironment &env, char const *url, char *&username, char *&password, NetAddress &address, portNumBits &portNum, char const **urlSuffix=NULL)
static Boolean parseRTSPURLUsernamePassword (char const *url, char *&username, char *&password)
static void close (UsageEnvironment &env, char const *mediumName)
static void close (Medium *medium)

Data Fields

DarwinInjectorfOurDarwinInjector

Static Public Attributes

static unsigned responseBufferSize = 20000

Protected Member Functions

void setBaseURL (char const *url)
TaskTokennextTask ()

Friends

class MediaLookupTable

Detailed Description

Definition at line 104 of file DarwinInjector.cpp.


Member Typedef Documentation

typedef void( RTSPClient::responseHandler)(RTSPClient *rtspClient, int resultCode, char *resultString) [inherited]

Definition at line 46 of file RTSPClient.hh.


Constructor & Destructor Documentation

RTSPClientForDarwinInjector::RTSPClientForDarwinInjector ( UsageEnvironment env,
char const *  rtspURL,
int  verbosityLevel,
char const *  applicationName,
DarwinInjector ourDarwinInjector 
) [inline]

Definition at line 106 of file DarwinInjector.cpp.

00108     : RTSPClient(env, rtspURL, verbosityLevel, applicationName, 0),
00109       fOurDarwinInjector(ourDarwinInjector) {}

virtual RTSPClientForDarwinInjector::~RTSPClientForDarwinInjector (  )  [inline, virtual]

Definition at line 110 of file DarwinInjector.cpp.

00110 {}


Member Function Documentation

RTSPClient * RTSPClient::createNew ( UsageEnvironment env,
char const *  rtspURL,
int  verbosityLevel = 0,
char const *  applicationName = NULL,
portNumBits  tunnelOverHTTPPortNum = 0 
) [static, inherited]

Reimplemented in ourRTSPClient.

Definition at line 30 of file RTSPClient.cpp.

References env, and RTSPClient::RTSPClient().

Referenced by createClient().

00033                                                                      {
00034   return new RTSPClient(env, rtspURL,
00035                         verbosityLevel, applicationName, tunnelOverHTTPPortNum);
00036 }

static RTSPClient* RTSPClient::createNew ( UsageEnvironment env,
int  verbosityLevel = 0,
char const *  applicationName = NULL,
portNumBits  tunnelOverHTTPPortNum = 0 
) [static, inherited]

unsigned RTSPClient::sendDescribeCommand ( responseHandler responseHandler,
Authenticator authenticator = NULL 
) [inherited]

Definition at line 38 of file RTSPClient.cpp.

References RTSPClient::fCSeq, RTSPClient::fCurrentAuthenticator, NULL, and RTSPClient::sendRequest().

Referenced by getSDPDescription(), and openURL().

00038                                                                                                        {
00039   if (authenticator != NULL) fCurrentAuthenticator = *authenticator;
00040   return sendRequest(new RequestRecord(++fCSeq, "DESCRIBE", responseHandler));
00041 }

unsigned RTSPClient::sendOptionsCommand ( responseHandler responseHandler,
Authenticator authenticator = NULL 
) [inherited]

Definition at line 43 of file RTSPClient.cpp.

References RTSPClient::fCSeq, RTSPClient::fCurrentAuthenticator, NULL, and RTSPClient::sendRequest().

Referenced by getOptions().

00043                                                                                                       {
00044   if (authenticator != NULL) fCurrentAuthenticator = *authenticator;
00045   return sendRequest(new RequestRecord(++fCSeq, "OPTIONS", responseHandler));
00046 }

unsigned RTSPClient::sendAnnounceCommand ( char const *  sdpDescription,
responseHandler responseHandler,
Authenticator authenticator = NULL 
) [inherited]

Definition at line 48 of file RTSPClient.cpp.

References False, RTSPClient::fCSeq, RTSPClient::fCurrentAuthenticator, NULL, and RTSPClient::sendRequest().

Referenced by DarwinInjector::setDestination().

00048                                                                                                                                    {
00049   if (authenticator != NULL) fCurrentAuthenticator = *authenticator;
00050   return sendRequest(new RequestRecord(++fCSeq, "ANNOUNCE", responseHandler, NULL, NULL, False, 0.0, 0.0, 0.0, sdpDescription));
00051 }

unsigned RTSPClient::sendSetupCommand ( MediaSubsession subsession,
responseHandler responseHandler,
Boolean  streamOutgoing = False,
Boolean  streamUsingTCP = False,
Boolean  forceMulticastOnUnspecified = False,
Authenticator authenticator = NULL 
) [inherited]

Definition at line 53 of file RTSPClient.cpp.

References RTSPClient::fCSeq, RTSPClient::fCurrentAuthenticator, RTSPClient::fTunnelOverHTTPPortNum, NULL, RTSPClient::sendRequest(), subsession, and True.

Referenced by DarwinInjector::setDestination(), setupNextSubsession(), and setupSubsession().

00055                                                                     {
00056   if (fTunnelOverHTTPPortNum != 0) streamUsingTCP = True; // RTSP-over-HTTP tunneling uses TCP (by definition)
00057   if (authenticator != NULL) fCurrentAuthenticator = *authenticator;
00058 
00059   u_int32_t booleanFlags = 0;
00060   if (streamUsingTCP) booleanFlags |= 0x1;
00061   if (streamOutgoing) booleanFlags |= 0x2;
00062   if (forceMulticastOnUnspecified) booleanFlags |= 0x4;
00063   return sendRequest(new RequestRecord(++fCSeq, "SETUP", responseHandler, NULL, &subsession, booleanFlags));
00064 }

unsigned RTSPClient::sendPlayCommand ( MediaSession session,
responseHandler responseHandler,
double  start = 0.0f,
double  end = -1.0f,
float  scale = 1.0f,
Authenticator authenticator = NULL 
) [inherited]

Definition at line 66 of file RTSPClient.cpp.

References RTSPClient::fCSeq, RTSPClient::fCurrentAuthenticator, NULL, RTSPClient::sendRequest(), and session.

Referenced by DarwinInjector::setDestination(), setupNextSubsession(), and startPlayingSession().

00068                                                                    {
00069   if (authenticator != NULL) fCurrentAuthenticator = *authenticator;
00070   return sendRequest(new RequestRecord(++fCSeq, "PLAY", responseHandler, &session, NULL, 0, start, end, scale));
00071 }

unsigned RTSPClient::sendPlayCommand ( MediaSubsession subsession,
responseHandler responseHandler,
double  start = 0.0f,
double  end = -1.0f,
float  scale = 1.0f,
Authenticator authenticator = NULL 
) [inherited]

Definition at line 73 of file RTSPClient.cpp.

References RTSPClient::fCSeq, RTSPClient::fCurrentAuthenticator, NULL, RTSPClient::sendRequest(), and subsession.

00075                                                                    {
00076   if (authenticator != NULL) fCurrentAuthenticator = *authenticator;
00077   return sendRequest(new RequestRecord(++fCSeq, "PLAY", responseHandler, NULL, &subsession, 0, start, end, scale));
00078 }

unsigned RTSPClient::sendPauseCommand ( MediaSession session,
responseHandler responseHandler,
Authenticator authenticator = NULL 
) [inherited]

Definition at line 80 of file RTSPClient.cpp.

References RTSPClient::fCSeq, RTSPClient::fCurrentAuthenticator, NULL, RTSPClient::sendRequest(), and session.

00080                                                                                                                            {
00081   if (authenticator != NULL) fCurrentAuthenticator = *authenticator;
00082   return sendRequest(new RequestRecord(++fCSeq, "PAUSE", responseHandler, &session));
00083 }

unsigned RTSPClient::sendPauseCommand ( MediaSubsession subsession,
responseHandler responseHandler,
Authenticator authenticator = NULL 
) [inherited]

Definition at line 85 of file RTSPClient.cpp.

References RTSPClient::fCSeq, RTSPClient::fCurrentAuthenticator, NULL, RTSPClient::sendRequest(), and subsession.

00085                                                                                                                                  {
00086   if (authenticator != NULL) fCurrentAuthenticator = *authenticator;
00087   return sendRequest(new RequestRecord(++fCSeq, "PAUSE", responseHandler, NULL, &subsession));
00088 }

unsigned RTSPClient::sendRecordCommand ( MediaSession session,
responseHandler responseHandler,
Authenticator authenticator = NULL 
) [inherited]

Definition at line 90 of file RTSPClient.cpp.

References RTSPClient::fCSeq, RTSPClient::fCurrentAuthenticator, NULL, RTSPClient::sendRequest(), and session.

00090                                                                                                                             {
00091   if (authenticator != NULL) fCurrentAuthenticator = *authenticator;
00092   return sendRequest(new RequestRecord(++fCSeq, "RECORD", responseHandler, &session));
00093 }

unsigned RTSPClient::sendRecordCommand ( MediaSubsession subsession,
responseHandler responseHandler,
Authenticator authenticator = NULL 
) [inherited]

Definition at line 95 of file RTSPClient.cpp.

References RTSPClient::fCSeq, RTSPClient::fCurrentAuthenticator, NULL, RTSPClient::sendRequest(), and subsession.

00095                                                                                                                                   {
00096   if (authenticator != NULL) fCurrentAuthenticator = *authenticator;
00097   return sendRequest(new RequestRecord(++fCSeq, "RECORD", responseHandler, NULL, &subsession));
00098 }

unsigned RTSPClient::sendTeardownCommand ( MediaSession session,
responseHandler responseHandler,
Authenticator authenticator = NULL 
) [inherited]

Definition at line 100 of file RTSPClient.cpp.

References RTSPClient::fCSeq, RTSPClient::fCurrentAuthenticator, NULL, RTSPClient::sendRequest(), and session.

Referenced by shutdownStream(), tearDownSession(), and DarwinInjector::~DarwinInjector().

00100                                                                                                                               {
00101   if (authenticator != NULL) fCurrentAuthenticator = *authenticator;
00102   return sendRequest(new RequestRecord(++fCSeq, "TEARDOWN", responseHandler, &session));
00103 }

unsigned RTSPClient::sendTeardownCommand ( MediaSubsession subsession,
responseHandler responseHandler,
Authenticator authenticator = NULL 
) [inherited]

Definition at line 105 of file RTSPClient.cpp.

References RTSPClient::fCSeq, RTSPClient::fCurrentAuthenticator, NULL, RTSPClient::sendRequest(), and subsession.

00105                                                                                                                                     {
00106   if (authenticator != NULL) fCurrentAuthenticator = *authenticator;
00107   return sendRequest(new RequestRecord(++fCSeq, "TEARDOWN", responseHandler, NULL, &subsession));
00108 }

unsigned RTSPClient::sendSetParameterCommand ( MediaSession session,
responseHandler responseHandler,
char const *  parameterName,
char const *  parameterValue,
Authenticator authenticator = NULL 
) [inherited]

Definition at line 110 of file RTSPClient.cpp.

References False, RTSPClient::fCSeq, RTSPClient::fCurrentAuthenticator, NULL, RTSPClient::sendRequest(), and session.

00112                                                                            {
00113   if (authenticator != NULL) fCurrentAuthenticator = *authenticator;
00114   char* paramString = new char[strlen(parameterName) + strlen(parameterValue) + 10];
00115   sprintf(paramString, "%s: %s\r\n", parameterName, parameterValue);
00116   unsigned result = sendRequest(new RequestRecord(++fCSeq, "SET_PARAMETER", responseHandler, &session, NULL, False, 0.0, 0.0, 0.0, paramString));
00117   delete[] paramString;
00118   return result;
00119 }

unsigned RTSPClient::sendGetParameterCommand ( MediaSession session,
responseHandler responseHandler,
char const *  parameterName,
Authenticator authenticator = NULL 
) [inherited]

Definition at line 121 of file RTSPClient.cpp.

References False, RTSPClient::fCSeq, RTSPClient::fCurrentAuthenticator, NULL, RTSPClient::sendRequest(), and session.

00122                                                                            {
00123   if (authenticator != NULL) fCurrentAuthenticator = *authenticator;
00124 
00125   // We assume that:
00126   //    parameterName is NULL means: Send no body in the request.
00127   //    parameterName is "" means: Send only \r\n in the request body.  
00128   //    parameterName is non-empty means: Send "<parameterName>\r\n" as the request body.  
00129   unsigned parameterNameLen = parameterName == NULL ? 0 : strlen(parameterName);
00130   char* paramString = new char[parameterNameLen + 3]; // the 3 is for \r\n + the '\0' byte
00131   if (parameterName == NULL) {
00132     paramString[0] = '\0';
00133   } else {
00134     sprintf(paramString, "%s\r\n", parameterName);
00135   }
00136   unsigned result = sendRequest(new RequestRecord(++fCSeq, "GET_PARAMETER", responseHandler, &session, NULL, False, 0.0, 0.0, 0.0, paramString));
00137   delete[] paramString;
00138   return result;
00139 }

Boolean RTSPClient::changeResponseHandler ( unsigned  cseq,
responseHandler newResponseHandler 
) [inherited]

Definition at line 141 of file RTSPClient.cpp.

References False, RTSPClient::RequestQueue::findByCSeq(), RTSPClient::fRequestsAwaitingConnection, RTSPClient::fRequestsAwaitingHTTPTunneling, RTSPClient::fRequestsAwaitingResponse, RTSPClient::RequestRecord::handler(), NULL, and True.

00141                                                                                             { 
00142   // Look for the matching request record in each of our 'pending requests' queues:
00143   RequestRecord* request;
00144   if ((request = fRequestsAwaitingConnection.findByCSeq(cseq)) != NULL
00145       || (request = fRequestsAwaitingHTTPTunneling.findByCSeq(cseq)) != NULL
00146       || (request = fRequestsAwaitingResponse.findByCSeq(cseq)) != NULL) {
00147     request->handler() = newResponseHandler;
00148     return True;
00149   }
00150 
00151   return False;
00152 }

int RTSPClient::socketNum (  )  const [inline, inherited]

Definition at line 140 of file RTSPClient.hh.

References RTSPClient::fInputSocketNum.

Referenced by DarwinInjector::setDestination().

00140 { return fInputSocketNum; }

Boolean RTSPClient::lookupByName ( UsageEnvironment env,
char const *  sourceName,
RTSPClient *&  resultClient 
) [static, inherited]

Definition at line 154 of file RTSPClient.cpp.

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

00156                                                             {
00157   resultClient = NULL; // unless we succeed
00158 
00159   Medium* medium;
00160   if (!Medium::lookupByName(env, instanceName, medium)) return False;
00161 
00162   if (!medium->isRTSPClient()) {
00163     env.setResultMsg(instanceName, " is not a RTSP client");
00164     return False;
00165   }
00166 
00167   resultClient = (RTSPClient*)medium;
00168   return True;
00169 }

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 }

Boolean RTSPClient::parseRTSPURL ( UsageEnvironment env,
char const *  url,
char *&  username,
char *&  password,
NetAddress address,
portNumBits portNum,
char const **  urlSuffix = NULL 
) [static, inherited]

Definition at line 171 of file RTSPClient.cpp.

References _strncasecmp, env, False, NetAddressList::firstAddress(), NULL, NetAddressList::numAddresses(), UsageEnvironment::setResultMsg(), and True.

Referenced by RTSPClient::openConnection(), and RTSPClient::sendRequest().

00175                                                          {
00176   do {
00177     // Parse the URL as "rtsp://[<username>[:<password>]@]<server-address-or-name>[:<port>][/<stream-name>]"
00178     char const* prefix = "rtsp://";
00179     unsigned const prefixLength = 7;
00180     if (_strncasecmp(url, prefix, prefixLength) != 0) {
00181       env.setResultMsg("URL is not of the form \"", prefix, "\"");
00182       break;
00183     }
00184 
00185     unsigned const parseBufferSize = 100;
00186     char parseBuffer[parseBufferSize];
00187     char const* from = &url[prefixLength];
00188 
00189     // Check whether "<username>[:<password>]@" occurs next.
00190     // We do this by checking whether '@' appears before the end of the URL, or before the first '/'.
00191     username = password = NULL; // default return values
00192     char const* colonPasswordStart = NULL;
00193     char const* p;
00194     for (p = from; *p != '\0' && *p != '/'; ++p) {
00195       if (*p == ':' && colonPasswordStart == NULL) {
00196         colonPasswordStart = p;
00197       } else if (*p == '@') {
00198         // We found <username> (and perhaps <password>).  Copy them into newly-allocated result strings:
00199         if (colonPasswordStart == NULL) colonPasswordStart = p;
00200 
00201         char const* usernameStart = from;
00202         unsigned usernameLen = colonPasswordStart - usernameStart;
00203         username = new char[usernameLen + 1] ; // allow for the trailing '\0'
00204         for (unsigned i = 0; i < usernameLen; ++i) username[i] = usernameStart[i];
00205         username[usernameLen] = '\0';
00206 
00207         char const* passwordStart = colonPasswordStart;
00208         if (passwordStart < p) ++passwordStart; // skip over the ':'
00209         unsigned passwordLen = p - passwordStart;
00210         password = new char[passwordLen + 1]; // allow for the trailing '\0'
00211         for (unsigned j = 0; j < passwordLen; ++j) password[j] = passwordStart[j];
00212         password[passwordLen] = '\0';
00213 
00214         from = p + 1; // skip over the '@'
00215         break;
00216       }
00217     }
00218 
00219     // Next, parse <server-address-or-name>
00220     char* to = &parseBuffer[0];
00221     unsigned i;
00222     for (i = 0; i < parseBufferSize; ++i) {
00223       if (*from == '\0' || *from == ':' || *from == '/') {
00224         // We've completed parsing the address
00225         *to = '\0';
00226         break;
00227       }
00228       *to++ = *from++;
00229     }
00230     if (i == parseBufferSize) {
00231       env.setResultMsg("URL is too long");
00232       break;
00233     }
00234 
00235     NetAddressList addresses(parseBuffer);
00236     if (addresses.numAddresses() == 0) {
00237       env.setResultMsg("Failed to find network address for \"",
00238                        parseBuffer, "\"");
00239       break;
00240     }
00241     address = *(addresses.firstAddress());
00242 
00243     portNum = 554; // default value
00244     char nextChar = *from;
00245     if (nextChar == ':') {
00246       int portNumInt;
00247       if (sscanf(++from, "%d", &portNumInt) != 1) {
00248         env.setResultMsg("No port number follows ':'");
00249         break;
00250       }
00251       if (portNumInt < 1 || portNumInt > 65535) {
00252         env.setResultMsg("Bad port number");
00253         break;
00254       }
00255       portNum = (portNumBits)portNumInt;
00256       while (*from >= '0' && *from <= '9') ++from; // skip over port number
00257     }
00258 
00259     // The remainder of the URL is the suffix:
00260     if (urlSuffix != NULL) *urlSuffix = from;
00261 
00262     return True;
00263   } while (0);
00264 
00265   return False;
00266 }

void RTSPClient::setUserAgentString ( char const *  userAgentName  )  [inherited]

Definition at line 268 of file RTSPClient.cpp.

References RTSPClient::fUserAgentHeaderStr, RTSPClient::fUserAgentHeaderStrLen, and NULL.

Referenced by RTSPClient::RTSPClient().

00268                                                              {
00269   if (userAgentName == NULL) return;
00270 
00271   // Change the existing user agent header string:
00272   char const* const formatStr = "User-Agent: %s\r\n";
00273   unsigned const headerSize = strlen(formatStr) + strlen(userAgentName);
00274   delete[] fUserAgentHeaderStr;
00275   fUserAgentHeaderStr = new char[headerSize];
00276   sprintf(fUserAgentHeaderStr, formatStr, userAgentName);
00277   fUserAgentHeaderStrLen = strlen(fUserAgentHeaderStr);
00278 }

unsigned RTSPClient::sessionTimeoutParameter (  )  const [inline, inherited]

Definition at line 154 of file RTSPClient.hh.

References RTSPClient::fSessionTimeoutParameter.

00154 { return fSessionTimeoutParameter; }

char const* RTSPClient::url (  )  const [inline, inherited]

Definition at line 156 of file RTSPClient.hh.

References RTSPClient::fBaseURL.

Referenced by operator<<(), and RTSPClient::sessionURL().

00156 { return fBaseURL; }

void RTSPClient::setBaseURL ( char const *  url  )  [protected, inherited]

Definition at line 353 of file RTSPClient.cpp.

References RTSPClient::fBaseURL, and strDup().

Referenced by RTSPClient::handleResponseBytes(), RTSPClient::reset(), and RTSPClient::RTSPClient().

00353                                            {
00354   delete[] fBaseURL; fBaseURL = strDup(url);
00355 }

char* RTSPClient::describeURL ( char const *  url,
Authenticator authenticator = NULL,
Boolean  allowKasennaProtocol = False,
int  timeout = -1 
) [inherited]

char* RTSPClient::describeWithPassword ( char const *  url,
char const *  username,
char const *  password,
Boolean  allowKasennaProtocol = False,
int  timeout = -1 
) [inherited]

char* RTSPClient::sendOptionsCmd ( char const *  url,
char *  username = NULL,
char *  password = NULL,
Authenticator authenticator = NULL,
int  timeout = -1 
) [inherited]

Boolean RTSPClient::announceSDPDescription ( char const *  url,
char const *  sdpDescription,
Authenticator authenticator = NULL,
int  timeout = -1 
) [inherited]

Boolean RTSPClient::announceWithPassword ( char const *  url,
char const *  sdpDescription,
char const *  username,
char const *  password,
int  timeout = -1 
) [inherited]

Boolean RTSPClient::setupMediaSubsession ( MediaSubsession subsession,
Boolean  streamOutgoing = False,
Boolean  streamUsingTCP = False,
Boolean  forceMulticastOnUnspecified = False 
) [inherited]

Boolean RTSPClient::playMediaSession ( MediaSession session,
double  start = 0.0f,
double  end = -1.0f,
float  scale = 1.0f 
) [inherited]

Boolean RTSPClient::playMediaSubsession ( MediaSubsession subsession,
double  start = 0.0f,
double  end = -1.0f,
float  scale = 1.0f,
Boolean  hackForDSS = False 
) [inherited]

Boolean RTSPClient::pauseMediaSession ( MediaSession session  )  [inherited]

Boolean RTSPClient::pauseMediaSubsession ( MediaSubsession subsession  )  [inherited]

Boolean RTSPClient::recordMediaSubsession ( MediaSubsession subsession  )  [inherited]

Boolean RTSPClient::setMediaSessionParameter ( MediaSession session,
char const *  parameterName,
char const *  parameterValue 
) [inherited]

Boolean RTSPClient::getMediaSessionParameter ( MediaSession session,
char const *  parameterName,
char *&  parameterValue 
) [inherited]

Boolean RTSPClient::teardownMediaSession ( MediaSession session  )  [inherited]

Boolean RTSPClient::teardownMediaSubsession ( MediaSubsession subsession  )  [inherited]

static Boolean RTSPClient::parseRTSPURLUsernamePassword ( char const *  url,
char *&  username,
char *&  password 
) [static, inherited]

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(), continueAfterTEARDOWN(), WAVAudioFileSource::createNew(), QuickTimeFileSink::createNew(), QCELPAudioRTPSource::createNew(), MP3HTTPSource::createNew(), MP3FileSource::createNew(), AVIFileSink::createNew(), AMRAudioRTPSource::createNew(), WAVAudioFileServerMediaSubsession::createNewStreamSource(), MPEG1or2DemuxedServerMediaSubsession::createNewStreamSource(), MediaSubsession::deInitiate(), RTSPServerSupportingHTTPStreaming::RTSPClientSessionSupportingHTTPStreaming::handleHTTPCmd_StreamingGET(), MediaSubsession::initiate(), MPEG1or2ProgramStreamFileDuration(), MPEG1or2Demux::noteElementaryStreamDeletion(), ByteStreamMultiFileSource::onSourceClosure1(), StreamState::reclaim(), RTSPServer::removeServerMediaSession(), OnDemandServerMediaSubsession::sdpLines(), shutdownStream(), T140TextRTPSink::stopPlaying(), H264VideoRTPSink::stopPlaying(), subsessionAfterPlaying(), ClientTrickPlayState::updateStateOnScaleChange(), AMRDeinterleaver::~AMRDeinterleaver(), ByteStreamMultiFileSource::~ByteStreamMultiFileSource(), DarwinInjector::~DarwinInjector(), FramedFilter::~FramedFilter(), InputESSourceRecord::~InputESSourceRecord(), MatroskaFileParser::~MatroskaFileParser(), MatroskaFileServerDemux::~MatroskaFileServerDemux(), MPEG1or2Demux::~MPEG1or2Demux(), MPEG1or2FileServerDemux::~MPEG1or2FileServerDemux(), MPEG2TransportFileServerMediaSubsession::~MPEG2TransportFileServerMediaSubsession(), MPEG2TransportStreamFromPESSource::~MPEG2TransportStreamFromPESSource(), RTSPServerSupportingHTTPStreaming::RTSPClientSessionSupportingHTTPStreaming::~RTSPClientSessionSupportingHTTPStreaming(), ServerMediaSession::~ServerMediaSession(), ServerMediaSubsession::~ServerMediaSubsession(), StreamClientState::~StreamClientState(), and StreamReplicator::~StreamReplicator().

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(), T140IdleFilter::afterGettingFrame(), MultiFramedRTPSink::afterGettingFrame1(), InputESSourceRecord::afterGettingFrame1(), MPEG2TransportStreamFramer::afterGettingFrame1(), MPEG2IFrameIndexFromTransportStream::afterGettingFrame1(), H264VideoStreamDiscreteFramer::afterGettingFrame1(), BasicUDPSink::afterGettingFrame1(), MPEG4VideoFileServerMediaSubsession::afterPlayingDummy1(), H264VideoFileServerMediaSubsession::afterPlayingDummy1(), MPEG4VideoStreamParser::analyzeVOLHeader(), announceStream(), RTSPServer::RTSPClientSession::changeClientInputSocket(), MPEG4VideoFileServerMediaSubsession::checkForAuxSDPLine1(), H264VideoFileServerMediaSubsession::checkForAuxSDPLine1(), Medium::close(), MPEG2IFrameIndexFromTransportStream::compactParseBuffer(), RTSPClient::connectionHandler1(), RTSPClient::connectToServer(), T140TextRTPSink::continuePlaying(), QuickTimeFileSink::continuePlaying(), H264VideoRTPSink::continuePlaying(), AVIFileSink::continuePlaying(), VP8VideoMatroskaFileServerMediaSubsession::createNewRTPSink(), VorbisAudioMatroskaFileServerMediaSubsession::createNewRTPSink(), T140TextMatroskaFileServerMediaSubsession::createNewRTPSink(), MPEG4VideoFileServerMediaSubsession::createNewRTPSink(), MPEG2TransportUDPServerMediaSubsession::createNewRTPSink(), MPEG2TransportFileServerMediaSubsession::createNewRTPSink(), MPEG1or2VideoFileServerMediaSubsession::createNewRTPSink(), MPEG1or2DemuxedServerMediaSubsession::createNewRTPSink(), MP3AudioFileServerMediaSubsession::createNewRTPSink(), H264VideoFileServerMediaSubsession::createNewRTPSink(), H263plusVideoFileServerMediaSubsession::createNewRTPSink(), DVVideoFileServerMediaSubsession::createNewRTPSink(), AMRAudioFileServerMediaSubsession::createNewRTPSink(), ADTSAudioFileServerMediaSubsession::createNewRTPSink(), AC3AudioMatroskaFileServerMediaSubsession::createNewRTPSink(), AC3AudioFileServerMediaSubsession::createNewRTPSink(), AACAudioMatroskaFileServerMediaSubsession::createNewRTPSink(), MPEG4VideoFileServerMediaSubsession::createNewStreamSource(), MPEG2TransportUDPServerMediaSubsession::createNewStreamSource(), MPEG2TransportFileServerMediaSubsession::createNewStreamSource(), MPEG1or2VideoFileServerMediaSubsession::createNewStreamSource(), MPEG1or2DemuxedServerMediaSubsession::createNewStreamSource(), MP3AudioFileServerMediaSubsession::createNewStreamSource(), H264VideoMatroskaFileServerMediaSubsession::createNewStreamSource(), H264VideoFileServerMediaSubsession::createNewStreamSource(), H263plusVideoFileServerMediaSubsession::createNewStreamSource(), DVVideoFileServerMediaSubsession::createNewStreamSource(), AMRAudioFileServerMediaSubsession::createNewStreamSource(), ADTSAudioFileServerMediaSubsession::createNewStreamSource(), AC3AudioFileServerMediaSubsession::createNewStreamSource(), AMRDeinterleavingBuffer::deliverIncomingFrame(), MPEG2IFrameIndexFromTransportStream::deliverIndexRecord(), SegmentQueue::dequeue(), DeviceSource::DeviceSource(), WAVAudioFileSource::doGetNextFrame(), T140IdleFilter::doGetNextFrame(), MPEG2IFrameIndexFromTransportStream::doGetNextFrame(), MP3FileSource::doGetNextFrame(), H264FUAFragmenter::doGetNextFrame(), ByteStreamMultiFileSource::doGetNextFrame(), ByteStreamFileSource::doGetNextFrame(), BasicUDPSource::doGetNextFrame(), AMRAudioFileSource::doGetNextFrame(), ADTSAudioFileSource::doGetNextFrame(), MultiFramedRTPSource::doGetNextFrame1(), MP3FileSource::doGetNextFrame1(), ADUFromMP3Source::doGetNextFrame1(), SIPClient::doInviteStateMachine(), ByteStreamFileSource::doReadFromFile(), MPEG1or2VideoRTPSink::doSpecialFrameHandling(), MP3ADURTPSink::doSpecialFrameHandling(), H263plusVideoRTPSink::doSpecialFrameHandling(), T140IdleFilter::doStopGettingFrames(), ByteStreamFileSource::doStopGettingFrames(), BasicUDPSource::doStopGettingFrames(), SegmentQueue::enqueueNewSegment(), StreamParser::ensureValidBytes1(), MediaSubsession::env(), SubsessionIOState::envir(), RTSPServer::RTSPClientSession::envir(), RTPInterface::envir(), AVISubsessionIOState::envir(), ServerMediaSession::generateSDPDescription(), RTPSource::getAttributes(), MP3FileSource::getAttributes(), MP3ADUTranscoder::getAttributes(), MediaSource::getAttributes(), MPEG4VideoFileServerMediaSubsession::getAuxSDPLine(), H264VideoFileServerMediaSubsession::getAuxSDPLine(), getMPEG1or2TimeCode(), FramedSource::getNextFrame(), getOptions(), DVVideoStreamFramer::getProfile(), SIPClient::getResponse(), SIPClient::getResponseCode(), getSDPDescription(), OnDemandServerMediaSubsession::getStreamParameters(), RTSPClient::handleGET_PARAMETERResponse(), RTSPServerSupportingHTTPStreaming::RTSPClientSessionSupportingHTTPStreaming::handleHTTPCmd_StreamingGET(), RTSPClient::handleIncomingRequest(), RTSPClient::handlePLAYResponse(), RTSPClient::handleRequestError(), RTSPClient::handleResponseBytes(), RTSPClient::handleSETUPResponse(), RTSPServer::incomingConnectionHandler(), RTSPClient::incomingDataHandler1(), RTCPInstance::incomingReportHandler1(), MP3FileSource::initializeStream(), MediaSession::initializeWithSDP(), MediaSession::initiateByMediaType(), SIPClient::invite1(), DynamicRTSPServer::lookupServerMediaSession(), MatroskaDemux::MatroskaDemux(), MatroskaFile::MatroskaFile(), MPEG4GenericRTPSource::MPEG4GenericRTPSource(), MatroskaDemux::newDemuxedTrack(), MPEG1or2FileServerDemux::newElementaryStream(), MPEG1or2Demux::newElementaryStream(), MPEG4GenericBufferedPacket::nextEnclosedFrameSize(), AMRBufferedPacket::nextEnclosedFrameSize(), 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(), RTSPClient::resetTCPSockets(), RTSPClient::responseHandlerForHTTP_GET1(), RTSPServer::rtspURLPrefix(), RTCPInstance::schedule(), OnDemandServerMediaSubsession::sdpLines(), SIPClient::sendACK(), SIPClient::sendBYE(), SIPClient::sendINVITE(), MultiFramedRTPSink::sendPacketIfNecessary(), SIPClient::sendRequest(), RTSPClient::sendRequest(), DarwinInjector::setDestination(), 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(), tearDownSession(), SIPClient::timerAHandler(), SIPClient::timerBHandler(), SIPClient::timerDHandler(), ClientTrickPlayState::updateStateOnScaleChange(), MPEG2TransportStreamFramer::updateTSPacketDurationEstimate(), BasicUDPSource::~BasicUDPSource(), ByteStreamFileSource::~ByteStreamFileSource(), DeviceSource::~DeviceSource(), RTSPServer::~RTSPServer(), StreamClientState::~StreamClientState(), and T140IdleFilter::~T140IdleFilter().

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::isRTSPServer (  )  const [virtual, inherited]

Reimplemented in RTSPServer.

Definition at line 78 of file Media.cpp.

References False.

Referenced by RTSPServer::lookupByName().

00078                                    {
00079   return False; // default implementation
00080 }

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(), H264VideoFileServerMediaSubsession::afterPlayingDummy1(), MPEG4VideoFileServerMediaSubsession::checkForAuxSDPLine1(), H264VideoFileServerMediaSubsession::checkForAuxSDPLine1(), WAVAudioFileSource::doGetNextFrame(), MP3FileSource::doGetNextFrame(), AMRAudioFileSource::doGetNextFrame(), ADTSAudioFileSource::doGetNextFrame(), MultiFramedRTPSource::doGetNextFrame1(), ByteStreamFileSource::doReadFromFile(), 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

DarwinInjector* RTSPClientForDarwinInjector::fOurDarwinInjector

Definition at line 111 of file DarwinInjector.cpp.

unsigned RTSPClient::responseBufferSize = 20000 [static, inherited]

Definition at line 158 of file RTSPClient.hh.

Referenced by RTSPClient::handleResponseBytes(), RTSPClient::handleSETUPResponse(), RTSPClient::resetResponseBuffer(), and RTSPClient::RTSPClient().


The documentation for this class was generated from the following file:
Generated on Thu Feb 2 23:55:52 2012 for live by  doxygen 1.5.2