live
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes
RTSPClient Class Reference

#include <RTSPClient.hh>

Inheritance diagram for RTSPClient:
Inheritance graph
[legend]
Collaboration diagram for RTSPClient:
Collaboration graph
[legend]

Data Structures

class  RequestQueue
 
class  RequestRecord
 

Public Types

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

Public Member Functions

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 sendPlayCommand (MediaSession &session, responseHandler *responseHandler, char const *absStartTime, char const *absEndTime=NULL, float scale=1.0f, Authenticator *authenticator=NULL)
 
unsigned sendPlayCommand (MediaSubsession &subsession, responseHandler *responseHandler, char const *absStartTime, char const *absEndTime=NULL, 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)
 
void sendDummyUDPPackets (MediaSession &session, unsigned numDummyPackets=2)
 
void sendDummyUDPPackets (MediaSubsession &subsession, unsigned numDummyPackets=2)
 
void setSpeed (MediaSession &session, float speed=1.0f)
 
Boolean changeResponseHandler (unsigned cseq, responseHandler *newResponseHandler)
 
int socketNum () const
 
void setUserAgentString (char const *userAgentName)
 
void disallowBasicAuthentication ()
 
unsigned sessionTimeoutParameter () const
 
char const * url () const
 
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
 

Static Public Member Functions

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

Data Fields

u_int16_t desiredMaxIncomingPacketSize
 

Static Public Attributes

static unsigned responseBufferSize
 

Protected Member Functions

 RTSPClient (UsageEnvironment &env, char const *rtspURL, int verbosityLevel, char const *applicationName, portNumBits tunnelOverHTTPPortNum, int socketNumToServer)
 
virtual ~RTSPClient ()
 
void reset ()
 
void setBaseURL (char const *url)
 
int grabSocket ()
 
virtual unsigned sendRequest (RequestRecord *request)
 
virtual Boolean setRequestFields (RequestRecord *request, char *&cmdURL, Boolean &cmdURLWasAllocated, char const *&protocolStr, char *&extraHeaders, Boolean &extraHeadersWereAllocated)
 
virtual int connectToServer (int socketNum, portNumBits remotePortNum)
 
TaskTokennextTask ()
 

Protected Attributes

int fVerbosityLevel
 
unsigned fCSeq
 
Authenticator fCurrentAuthenticator
 
Boolean fAllowBasicAuthentication
 
netAddressBits fServerAddress
 

Private Member Functions

virtual Boolean isRTSPClient () const
 
void resetTCPSockets ()
 
void resetResponseBuffer ()
 
int openConnection ()
 
char * createAuthenticatorString (char const *cmd, char const *url)
 
char * createBlocksizeString (Boolean streamUsingTCP)
 
void handleRequestError (RequestRecord *request)
 
Boolean parseResponseCode (char const *line, unsigned &responseCode, char const *&responseString)
 
void handleIncomingRequest ()
 
Boolean parseTransportParams (char const *paramsStr, char *&serverAddressStr, portNumBits &serverPortNum, unsigned char &rtpChannelId, unsigned char &rtcpChannelId)
 
Boolean parseScaleParam (char const *paramStr, float &scale)
 
Boolean parseSpeedParam (char const *paramStr, float &speed)
 
Boolean parseRTPInfoParams (char const *&paramStr, u_int16_t &seqNum, u_int32_t &timestamp)
 
Boolean handleSETUPResponse (MediaSubsession &subsession, char const *sessionParamsStr, char const *transportParamsStr, Boolean streamUsingTCP)
 
Boolean handlePLAYResponse (MediaSession &session, MediaSubsession &subsession, char const *scaleParamsStr, const char *speedParamsStr, char const *rangeParamsStr, char const *rtpInfoParamsStr)
 
Boolean handleTEARDOWNResponse (MediaSession &session, MediaSubsession &subsession)
 
Boolean handleGET_PARAMETERResponse (char const *parameterName, char *&resultValueString, char *resultValueStringEnd)
 
Boolean handleAuthenticationFailure (char const *wwwAuthenticateParamsStr)
 
Boolean resendCommand (RequestRecord *request)
 
char const * sessionURL (MediaSession const &session) const
 
void handleAlternativeRequestByte1 (u_int8_t requestByte)
 
void constructSubsessionURL (MediaSubsession const &subsession, char const *&prefix, char const *&separator, char const *&suffix)
 
Boolean setupHTTPTunneling1 ()
 
void responseHandlerForHTTP_GET1 (int responseCode, char *responseString)
 
Boolean setupHTTPTunneling2 ()
 
void connectionHandler1 ()
 
void incomingDataHandler1 ()
 
void handleResponseBytes (int newBytesRead)
 

Static Private Member Functions

static Boolean checkForHeader (char const *line, char const *headerName, unsigned headerNameLength, char const *&headerParams)
 
static void handleAlternativeRequestByte (void *, u_int8_t requestByte)
 
static void responseHandlerForHTTP_GET (RTSPClient *rtspClient, int responseCode, char *responseString)
 
static void connectionHandler (void *, int)
 
static void incomingDataHandler (void *, int)
 

Private Attributes

portNumBits fTunnelOverHTTPPortNum
 
char * fUserAgentHeaderStr
 
unsigned fUserAgentHeaderStrLen
 
int fInputSocketNum
 
int fOutputSocketNum
 
char * fBaseURL
 
unsigned char fTCPStreamIdCount
 
char * fLastSessionId
 
unsigned fSessionTimeoutParameter
 
char * fResponseBuffer
 
unsigned fResponseBytesAlreadySeen
 
unsigned fResponseBufferBytesLeft
 
RequestQueue fRequestsAwaitingConnection
 
RequestQueue fRequestsAwaitingHTTPTunneling
 
RequestQueue fRequestsAwaitingResponse
 
char fSessionCookie [33]
 
unsigned fSessionCookieCounter
 
Boolean fHTTPTunnelingConnectionIsPending
 

Detailed Description

Definition at line 39 of file RTSPClient.hh.

Member Typedef Documentation

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

Definition at line 52 of file RTSPClient.hh.

Constructor & Destructor Documentation

RTSPClient::RTSPClient ( UsageEnvironment env,
char const *  rtspURL,
int  verbosityLevel,
char const *  applicationName,
portNumBits  tunnelOverHTTPPortNum,
int  socketNumToServer 
)
protected
virtual RTSPClient::~RTSPClient ( )
protectedvirtual

Member Function Documentation

Boolean RTSPClient::changeResponseHandler ( unsigned  cseq,
responseHandler newResponseHandler 
)
static Boolean RTSPClient::checkForHeader ( char const *  line,
char const *  headerName,
unsigned  headerNameLength,
char const *&  headerParams 
)
staticprivate
static void Medium::close ( UsageEnvironment env,
char const *  mediumName 
)
staticinherited
static void Medium::close ( Medium medium)
staticinherited
static void RTSPClient::connectionHandler ( void *  ,
int   
)
staticprivate
void RTSPClient::connectionHandler1 ( )
private
virtual int RTSPClient::connectToServer ( int  socketNum,
portNumBits  remotePortNum 
)
protectedvirtual

Reimplemented in ProxyRTSPClient.

void RTSPClient::constructSubsessionURL ( MediaSubsession const &  subsession,
char const *&  prefix,
char const *&  separator,
char const *&  suffix 
)
private
char* RTSPClient::createAuthenticatorString ( char const *  cmd,
char const *  url 
)
private
char* RTSPClient::createBlocksizeString ( Boolean  streamUsingTCP)
private
static RTSPClient* RTSPClient::createNew ( UsageEnvironment env,
char const *  rtspURL,
int  verbosityLevel = 0,
char const *  applicationName = NULL,
portNumBits  tunnelOverHTTPPortNum = 0,
int  socketNumToServer = -1 
)
static
void RTSPClient::disallowBasicAuthentication ( )
inline

Definition at line 182 of file RTSPClient.hh.

References fAllowBasicAuthentication, and False.

const Boolean False
Definition: Boolean.hh:28
Boolean fAllowBasicAuthentication
Definition: RTSPClient.hh:328
UsageEnvironment& Medium::envir ( ) const
inlineinherited
int RTSPClient::grabSocket ( )
protected
static void RTSPClient::handleAlternativeRequestByte ( void *  ,
u_int8_t  requestByte 
)
staticprivate
void RTSPClient::handleAlternativeRequestByte1 ( u_int8_t  requestByte)
private
Boolean RTSPClient::handleAuthenticationFailure ( char const *  wwwAuthenticateParamsStr)
private
Boolean RTSPClient::handleGET_PARAMETERResponse ( char const *  parameterName,
char *&  resultValueString,
char *  resultValueStringEnd 
)
private
void RTSPClient::handleIncomingRequest ( )
private
Boolean RTSPClient::handlePLAYResponse ( MediaSession session,
MediaSubsession subsession,
char const *  scaleParamsStr,
const char *  speedParamsStr,
char const *  rangeParamsStr,
char const *  rtpInfoParamsStr 
)
private
void RTSPClient::handleRequestError ( RequestRecord request)
private
void RTSPClient::handleResponseBytes ( int  newBytesRead)
private
Boolean RTSPClient::handleSETUPResponse ( MediaSubsession subsession,
char const *  sessionParamsStr,
char const *  transportParamsStr,
Boolean  streamUsingTCP 
)
private
Boolean RTSPClient::handleTEARDOWNResponse ( MediaSession session,
MediaSubsession subsession 
)
private
static void RTSPClient::incomingDataHandler ( void *  ,
int   
)
staticprivate
void RTSPClient::incomingDataHandler1 ( )
private
virtual Boolean Medium::isMediaSession ( ) const
virtualinherited

Reimplemented in MediaSession.

virtual Boolean Medium::isRTCPInstance ( ) const
virtualinherited

Reimplemented in RTCPInstance.

virtual Boolean RTSPClient::isRTSPClient ( ) const
privatevirtual

Reimplemented from Medium.

virtual Boolean Medium::isRTSPServer ( ) const
virtualinherited

Reimplemented in RTSPServer.

virtual Boolean Medium::isServerMediaSession ( ) const
virtualinherited

Reimplemented in ServerMediaSession.

virtual Boolean Medium::isSink ( ) const
virtualinherited

Reimplemented in MediaSink.

virtual Boolean Medium::isSource ( ) const
virtualinherited

Reimplemented in MediaSource.

static Boolean Medium::lookupByName ( UsageEnvironment env,
char const *  mediumName,
Medium *&  resultMedium 
)
staticinherited
static Boolean RTSPClient::lookupByName ( UsageEnvironment env,
char const *  sourceName,
RTSPClient *&  resultClient 
)
static
char const* Medium::name ( ) const
inlineinherited

Definition at line 61 of file Media.hh.

References Medium::fMediumName.

61 {return fMediumName;}
char fMediumName[mediumNameMaxLen]
Definition: Media.hh:83
TaskToken& Medium::nextTask ( )
inlineprotectedinherited

Definition at line 77 of file Media.hh.

References Medium::fNextTask.

77  {
78  return fNextTask;
79  }
TaskToken fNextTask
Definition: Media.hh:84
int RTSPClient::openConnection ( )
private
Boolean RTSPClient::parseResponseCode ( char const *  line,
unsigned &  responseCode,
char const *&  responseString 
)
private
Boolean RTSPClient::parseRTPInfoParams ( char const *&  paramStr,
u_int16_t &  seqNum,
u_int32_t &  timestamp 
)
private
static Boolean RTSPClient::parseRTSPURL ( UsageEnvironment env,
char const *  url,
char *&  username,
char *&  password,
NetAddress address,
portNumBits portNum,
char const **  urlSuffix = NULL 
)
static
Boolean RTSPClient::parseScaleParam ( char const *  paramStr,
float &  scale 
)
private
Boolean RTSPClient::parseSpeedParam ( char const *  paramStr,
float &  speed 
)
private
Boolean RTSPClient::parseTransportParams ( char const *  paramsStr,
char *&  serverAddressStr,
portNumBits serverPortNum,
unsigned char &  rtpChannelId,
unsigned char &  rtcpChannelId 
)
private
Boolean RTSPClient::resendCommand ( RequestRecord request)
private
void RTSPClient::reset ( )
protected
void RTSPClient::resetResponseBuffer ( )
private
void RTSPClient::resetTCPSockets ( )
private
static void RTSPClient::responseHandlerForHTTP_GET ( RTSPClient rtspClient,
int  responseCode,
char *  responseString 
)
staticprivate
void RTSPClient::responseHandlerForHTTP_GET1 ( int  responseCode,
char *  responseString 
)
private
unsigned RTSPClient::sendAnnounceCommand ( char const *  sdpDescription,
responseHandler responseHandler,
Authenticator authenticator = NULL 
)
unsigned RTSPClient::sendDescribeCommand ( responseHandler responseHandler,
Authenticator authenticator = NULL 
)
void RTSPClient::sendDummyUDPPackets ( MediaSession session,
unsigned  numDummyPackets = 2 
)
void RTSPClient::sendDummyUDPPackets ( MediaSubsession subsession,
unsigned  numDummyPackets = 2 
)
unsigned RTSPClient::sendGetParameterCommand ( MediaSession session,
responseHandler responseHandler,
char const *  parameterName,
Authenticator authenticator = NULL 
)
unsigned RTSPClient::sendOptionsCommand ( responseHandler responseHandler,
Authenticator authenticator = NULL 
)
unsigned RTSPClient::sendPauseCommand ( MediaSession session,
responseHandler responseHandler,
Authenticator authenticator = NULL 
)
unsigned RTSPClient::sendPauseCommand ( MediaSubsession subsession,
responseHandler responseHandler,
Authenticator authenticator = NULL 
)
unsigned RTSPClient::sendPlayCommand ( MediaSession session,
responseHandler responseHandler,
double  start = 0.0f,
double  end = -1.0f,
float  scale = 1.0f,
Authenticator authenticator = NULL 
)
unsigned RTSPClient::sendPlayCommand ( MediaSubsession subsession,
responseHandler responseHandler,
double  start = 0.0f,
double  end = -1.0f,
float  scale = 1.0f,
Authenticator authenticator = NULL 
)
unsigned RTSPClient::sendPlayCommand ( MediaSession session,
responseHandler responseHandler,
char const *  absStartTime,
char const *  absEndTime = NULL,
float  scale = 1.0f,
Authenticator authenticator = NULL 
)
unsigned RTSPClient::sendPlayCommand ( MediaSubsession subsession,
responseHandler responseHandler,
char const *  absStartTime,
char const *  absEndTime = NULL,
float  scale = 1.0f,
Authenticator authenticator = NULL 
)
unsigned RTSPClient::sendRecordCommand ( MediaSession session,
responseHandler responseHandler,
Authenticator authenticator = NULL 
)
unsigned RTSPClient::sendRecordCommand ( MediaSubsession subsession,
responseHandler responseHandler,
Authenticator authenticator = NULL 
)
virtual unsigned RTSPClient::sendRequest ( RequestRecord request)
protectedvirtual
unsigned RTSPClient::sendSetParameterCommand ( MediaSession session,
responseHandler responseHandler,
char const *  parameterName,
char const *  parameterValue,
Authenticator authenticator = NULL 
)
unsigned RTSPClient::sendSetupCommand ( MediaSubsession subsession,
responseHandler responseHandler,
Boolean  streamOutgoing = False,
Boolean  streamUsingTCP = False,
Boolean  forceMulticastOnUnspecified = False,
Authenticator authenticator = NULL 
)
unsigned RTSPClient::sendTeardownCommand ( MediaSession session,
responseHandler responseHandler,
Authenticator authenticator = NULL 
)
unsigned RTSPClient::sendTeardownCommand ( MediaSubsession subsession,
responseHandler responseHandler,
Authenticator authenticator = NULL 
)
unsigned RTSPClient::sessionTimeoutParameter ( ) const
inline

Definition at line 186 of file RTSPClient.hh.

References fSessionTimeoutParameter.

186 { return fSessionTimeoutParameter; }
unsigned fSessionTimeoutParameter
Definition: RTSPClient.hh:339
char const* RTSPClient::sessionURL ( MediaSession const &  session) const
private
void RTSPClient::setBaseURL ( char const *  url)
protected
virtual Boolean RTSPClient::setRequestFields ( RequestRecord request,
char *&  cmdURL,
Boolean cmdURLWasAllocated,
char const *&  protocolStr,
char *&  extraHeaders,
Boolean extraHeadersWereAllocated 
)
protectedvirtual

Reimplemented in RTSPDeregisterSender, and RTSPRegisterSender.

void RTSPClient::setSpeed ( MediaSession session,
float  speed = 1.0f 
)
Boolean RTSPClient::setupHTTPTunneling1 ( )
private
Boolean RTSPClient::setupHTTPTunneling2 ( )
private
void RTSPClient::setUserAgentString ( char const *  userAgentName)
int RTSPClient::socketNum ( ) const
inline

Definition at line 168 of file RTSPClient.hh.

References fInputSocketNum.

168 { return fInputSocketNum; }
int fInputSocketNum
Definition: RTSPClient.hh:335
char const* RTSPClient::url ( ) const
inline

Definition at line 188 of file RTSPClient.hh.

References fBaseURL.

188 { return fBaseURL; }
char * fBaseURL
Definition: RTSPClient.hh:336

Field Documentation

u_int16_t RTSPClient::desiredMaxIncomingPacketSize

Definition at line 320 of file RTSPClient.hh.

Boolean RTSPClient::fAllowBasicAuthentication
protected

Definition at line 328 of file RTSPClient.hh.

Referenced by disallowBasicAuthentication().

char* RTSPClient::fBaseURL
private

Definition at line 336 of file RTSPClient.hh.

Referenced by url().

unsigned RTSPClient::fCSeq
protected

Definition at line 326 of file RTSPClient.hh.

Authenticator RTSPClient::fCurrentAuthenticator
protected

Definition at line 327 of file RTSPClient.hh.

Boolean RTSPClient::fHTTPTunnelingConnectionIsPending
private

Definition at line 347 of file RTSPClient.hh.

int RTSPClient::fInputSocketNum
private

Definition at line 335 of file RTSPClient.hh.

Referenced by socketNum().

char* RTSPClient::fLastSessionId
private

Definition at line 338 of file RTSPClient.hh.

int RTSPClient::fOutputSocketNum
private

Definition at line 335 of file RTSPClient.hh.

RequestQueue RTSPClient::fRequestsAwaitingConnection
private

Definition at line 342 of file RTSPClient.hh.

RequestQueue RTSPClient::fRequestsAwaitingHTTPTunneling
private

Definition at line 342 of file RTSPClient.hh.

RequestQueue RTSPClient::fRequestsAwaitingResponse
private

Definition at line 342 of file RTSPClient.hh.

char* RTSPClient::fResponseBuffer
private

Definition at line 340 of file RTSPClient.hh.

unsigned RTSPClient::fResponseBufferBytesLeft
private

Definition at line 341 of file RTSPClient.hh.

unsigned RTSPClient::fResponseBytesAlreadySeen
private

Definition at line 341 of file RTSPClient.hh.

netAddressBits RTSPClient::fServerAddress
protected

Definition at line 329 of file RTSPClient.hh.

char RTSPClient::fSessionCookie[33]
private

Definition at line 345 of file RTSPClient.hh.

unsigned RTSPClient::fSessionCookieCounter
private

Definition at line 346 of file RTSPClient.hh.

unsigned RTSPClient::fSessionTimeoutParameter
private

Definition at line 339 of file RTSPClient.hh.

Referenced by sessionTimeoutParameter().

unsigned char RTSPClient::fTCPStreamIdCount
private

Definition at line 337 of file RTSPClient.hh.

portNumBits RTSPClient::fTunnelOverHTTPPortNum
private

Definition at line 332 of file RTSPClient.hh.

char* RTSPClient::fUserAgentHeaderStr
private

Definition at line 333 of file RTSPClient.hh.

unsigned RTSPClient::fUserAgentHeaderStrLen
private

Definition at line 334 of file RTSPClient.hh.

int RTSPClient::fVerbosityLevel
protected

Definition at line 325 of file RTSPClient.hh.

unsigned RTSPClient::responseBufferSize
static

Definition at line 190 of file RTSPClient.hh.


The documentation for this class was generated from the following file: