live
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Friends
RTSPServer Class Reference

#include <RTSPServer.hh>

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

Data Structures

class  RTSPClientConnection
 
class  RTSPClientSession
 

Public Types

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

Public Member Functions

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)
 
unsigned deregisterStream (ServerMediaSession *serverMediaSession, char const *remoteClientNameOrAddress, portNumBits remoteClientPortNum, responseHandlerForDEREGISTER *responseHandler, char const *username=NULL, char const *password=NULL, char const *proxyURLSuffix=NULL)
 
char * rtspURL (ServerMediaSession const *serverMediaSession, int clientSocket=-1, Boolean useIPv6=False) const
 
char * ipv4rtspURL (ServerMediaSession const *serverMediaSession, int clientSocket=-1)
 
char * ipv6rtspURL (ServerMediaSession const *serverMediaSession, int clientSocket=-1)
 
char * rtspURLPrefix (int clientSocket=-1, Boolean useIPv6=False) const
 
char * ipv4rtspURLPrefix (int clientSocket=-1)
 
char * ipv6rtspURLPrefix (int clientSocket=-1)
 
UserAuthenticationDatabasesetAuthenticationDatabase (UserAuthenticationDatabase *newDB)
 
void disableStreamingRTPOverTCP ()
 
Boolean setUpTunnelingOverHTTP (Port httpPort)
 
portNumBits httpServerPortNum () const
 
void addServerMediaSession (ServerMediaSession *serverMediaSession)
 
virtual void lookupServerMediaSession (char const *streamName, lookupServerMediaSessionCompletionFunc *completionFunc, void *completionClientData, Boolean isFirstLookupInSession=True)
 
void lookupServerMediaSession (char const *streamName, void(GenericMediaServer::*memberFunc)(ServerMediaSession *))
 
void removeServerMediaSession (ServerMediaSession *serverMediaSession)
 
virtual void removeServerMediaSession (char const *streamName)
 
void closeAllClientSessionsForServerMediaSession (ServerMediaSession *serverMediaSession)
 
virtual void closeAllClientSessionsForServerMediaSession (char const *streamName)
 
void deleteServerMediaSession (ServerMediaSession *serverMediaSession)
 
virtual void deleteServerMediaSession (char const *streamName)
 
unsigned numClientSessions () 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
 

Static Public Member Functions

static RTSPServercreateNew (UsageEnvironment &env, Port ourPort=554, UserAuthenticationDatabase *authDatabase=NULL, unsigned reclamationSeconds=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

 RTSPServer (UsageEnvironment &env, int ourSocketIPv4, int ourSocketIPv6, Port ourPort, UserAuthenticationDatabase *authDatabase, unsigned reclamationSeconds)
 
virtual ~RTSPServer ()
 
virtual char const * allowedCommandNames ()
 
virtual Boolean weImplementREGISTER (char const *cmd, char const *proxyURLSuffix, char *&responseStr)
 
virtual void implementCmd_REGISTER (char const *cmd, 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_storage const &clientAddr, char const *urlSuffix)
 
virtual Boolean specialClientUserAccessCheck (int clientSocket, struct sockaddr_storage const &clientAddr, char const *urlSuffix, char const *username)
 
virtual ClientConnectioncreateNewClientConnection (int clientSocket, struct sockaddr_storage const &clientAddr)
 
virtual ClientSessioncreateNewClientSession (u_int32_t sessionId)
 
void cleanup ()
 
void incomingConnectionHandlerIPv4 ()
 
void incomingConnectionHandlerIPv6 ()
 
void incomingConnectionHandlerOnSocket (int serverSocket)
 
ClientSessioncreateNewClientSessionWithId ()
 
ClientSessionlookupClientSession (u_int32_t sessionId)
 
ClientSessionlookupClientSession (char const *sessionIdStr)
 
ServerMediaSessiongetServerMediaSession (char const *streamName)
 
TaskTokennextTask ()
 

Static Protected Member Functions

static int setUpOurSocket (UsageEnvironment &env, Port &ourPort, int domain)
 
static void incomingConnectionHandlerIPv4 (void *, int)
 
static void incomingConnectionHandlerIPv6 (void *, int)
 

Protected Attributes

int fServerSocketIPv4
 
int fServerSocketIPv6
 
Port fServerPort
 
unsigned fReclamationSeconds
 

Private Member Functions

virtual Boolean isRTSPServer () const
 
void incomingConnectionHandlerHTTPIPv4 ()
 
void incomingConnectionHandlerHTTPIPv6 ()
 
void noteTCPStreamingOnSocket (int socketNum, RTSPClientSession *clientSession, unsigned trackNum)
 
void unnoteTCPStreamingOnSocket (int socketNum, RTSPClientSession *clientSession, unsigned trackNum)
 
void stopTCPStreamingOnSocket (int socketNum)
 

Static Private Member Functions

static void incomingConnectionHandlerHTTPIPv4 (void *, int)
 
static void incomingConnectionHandlerHTTPIPv6 (void *, int)
 

Private Attributes

int fHTTPServerSocketIPv4
 
int fHTTPServerSocketIPv6
 
Port fHTTPServerPort
 
HashTablefClientConnectionsForHTTPTunneling
 
HashTablefTCPStreamingDatabase
 
HashTablefPendingRegisterOrDeregisterRequests
 
unsigned fRegisterOrDeregisterRequestCounter
 
UserAuthenticationDatabasefAuthDB
 
Boolean fAllowStreamingRTPOverTCP
 

Friends

class RTSPClientConnection
 
class RTSPClientSession
 
class RegisterRequestRecord
 
class DeregisterRequestRecord
 

Detailed Description

Definition at line 31 of file RTSPServer.hh.

Member Typedef Documentation

◆ responseHandlerForDEREGISTER

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

Definition at line 64 of file RTSPServer.hh.

◆ responseHandlerForREGISTER

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

Definition at line 46 of file RTSPServer.hh.

Constructor & Destructor Documentation

◆ RTSPServer()

RTSPServer::RTSPServer ( UsageEnvironment env,
int  ourSocketIPv4,
int  ourSocketIPv6,
Port  ourPort,
UserAuthenticationDatabase authDatabase,
unsigned  reclamationSeconds 
)
protected

◆ ~RTSPServer()

virtual RTSPServer::~RTSPServer ( )
protectedvirtual

Member Function Documentation

◆ addServerMediaSession()

void GenericMediaServer::addServerMediaSession ( ServerMediaSession serverMediaSession)
inherited

◆ allowedCommandNames()

virtual char const* RTSPServer::allowedCommandNames ( )
protectedvirtual

◆ cleanup()

void GenericMediaServer::cleanup ( )
protectedinherited

◆ close() [1/2]

static void Medium::close ( UsageEnvironment env,
char const *  mediumName 
)
staticinherited

◆ close() [2/2]

static void Medium::close ( Medium medium)
staticinherited

◆ closeAllClientSessionsForServerMediaSession() [1/2]

void GenericMediaServer::closeAllClientSessionsForServerMediaSession ( ServerMediaSession serverMediaSession)
inherited

◆ closeAllClientSessionsForServerMediaSession() [2/2]

virtual void GenericMediaServer::closeAllClientSessionsForServerMediaSession ( char const *  streamName)
virtualinherited

◆ createNew()

static RTSPServer* RTSPServer::createNew ( UsageEnvironment env,
Port  ourPort = 554,
UserAuthenticationDatabase authDatabase = NULL,
unsigned  reclamationSeconds = 65 
)
static

◆ createNewClientConnection()

virtual ClientConnection* RTSPServer::createNewClientConnection ( int  clientSocket,
struct sockaddr_storage const &  clientAddr 
)
protectedvirtual

Implements GenericMediaServer.

◆ createNewClientSession()

virtual ClientSession* RTSPServer::createNewClientSession ( u_int32_t  sessionId)
protectedvirtual

Implements GenericMediaServer.

◆ createNewClientSessionWithId()

ClientSession* GenericMediaServer::createNewClientSessionWithId ( )
protectedinherited

◆ deleteServerMediaSession() [1/2]

void GenericMediaServer::deleteServerMediaSession ( ServerMediaSession serverMediaSession)
inherited

◆ deleteServerMediaSession() [2/2]

virtual void GenericMediaServer::deleteServerMediaSession ( char const *  streamName)
virtualinherited

◆ deregisterStream()

unsigned RTSPServer::deregisterStream ( ServerMediaSession serverMediaSession,
char const *  remoteClientNameOrAddress,
portNumBits  remoteClientPortNum,
responseHandlerForDEREGISTER responseHandler,
char const *  username = NULL,
char const *  password = NULL,
char const *  proxyURLSuffix = NULL 
)

◆ disableStreamingRTPOverTCP()

void RTSPServer::disableStreamingRTPOverTCP ( )
inline

Definition at line 100 of file RTSPServer.hh.

100  {
102  }
const Boolean False
Definition: Boolean.hh:28
Boolean fAllowStreamingRTPOverTCP
Definition: RTSPServer.hh:325

References fAllowStreamingRTPOverTCP, and False.

◆ envir()

UsageEnvironment& Medium::envir ( ) const
inlineinherited

◆ getAuthenticationDatabaseForCommand()

virtual UserAuthenticationDatabase* RTSPServer::getAuthenticationDatabaseForCommand ( char const *  cmdName)
protectedvirtual

Reimplemented in RTSPServerWithREGISTERProxying.

◆ getServerMediaSession()

ServerMediaSession* GenericMediaServer::getServerMediaSession ( char const *  streamName)
protectedinherited

◆ httpServerPortNum()

portNumBits RTSPServer::httpServerPortNum ( ) const

◆ implementCmd_REGISTER()

virtual void RTSPServer::implementCmd_REGISTER ( char const *  cmd,
char const *  url,
char const *  urlSuffix,
int  socketToRemoteServer,
Boolean  deliverViaTCP,
char const *  proxyURLSuffix 
)
protectedvirtual

◆ incomingConnectionHandlerHTTPIPv4() [1/2]

static void RTSPServer::incomingConnectionHandlerHTTPIPv4 ( void *  ,
int   
)
staticprivate

◆ incomingConnectionHandlerHTTPIPv4() [2/2]

void RTSPServer::incomingConnectionHandlerHTTPIPv4 ( )
private

◆ incomingConnectionHandlerHTTPIPv6() [1/2]

static void RTSPServer::incomingConnectionHandlerHTTPIPv6 ( void *  ,
int   
)
staticprivate

◆ incomingConnectionHandlerHTTPIPv6() [2/2]

void RTSPServer::incomingConnectionHandlerHTTPIPv6 ( )
private

◆ incomingConnectionHandlerIPv4() [1/2]

static void GenericMediaServer::incomingConnectionHandlerIPv4 ( void *  ,
int   
)
staticprotectedinherited

◆ incomingConnectionHandlerIPv4() [2/2]

void GenericMediaServer::incomingConnectionHandlerIPv4 ( )
protectedinherited

◆ incomingConnectionHandlerIPv6() [1/2]

static void GenericMediaServer::incomingConnectionHandlerIPv6 ( void *  ,
int   
)
staticprotectedinherited

◆ incomingConnectionHandlerIPv6() [2/2]

void GenericMediaServer::incomingConnectionHandlerIPv6 ( )
protectedinherited

◆ incomingConnectionHandlerOnSocket()

void GenericMediaServer::incomingConnectionHandlerOnSocket ( int  serverSocket)
protectedinherited

◆ ipv4rtspURL()

char* RTSPServer::ipv4rtspURL ( ServerMediaSession const *  serverMediaSession,
int  clientSocket = -1 
)
inline

Definition at line 81 of file RTSPServer.hh.

81  {
82  return rtspURL(serverMediaSession, clientSocket, False);
83  }
const Boolean False
Definition: Boolean.hh:28
char * rtspURL(ServerMediaSession const *serverMediaSession, int clientSocket=-1, Boolean useIPv6=False) const

References False, and rtspURL().

◆ ipv4rtspURLPrefix()

char* RTSPServer::ipv4rtspURLPrefix ( int  clientSocket = -1)
inline

Definition at line 93 of file RTSPServer.hh.

93 { return rtspURLPrefix(clientSocket, False); }
const Boolean False
Definition: Boolean.hh:28
char * rtspURLPrefix(int clientSocket=-1, Boolean useIPv6=False) const

References False, and rtspURLPrefix().

◆ ipv6rtspURL()

char* RTSPServer::ipv6rtspURL ( ServerMediaSession const *  serverMediaSession,
int  clientSocket = -1 
)
inline

Definition at line 84 of file RTSPServer.hh.

84  {
85  return rtspURL(serverMediaSession, clientSocket, True);
86  }
char * rtspURL(ServerMediaSession const *serverMediaSession, int clientSocket=-1, Boolean useIPv6=False) const
const Boolean True
Definition: Boolean.hh:31

References rtspURL(), and True.

◆ ipv6rtspURLPrefix()

char* RTSPServer::ipv6rtspURLPrefix ( int  clientSocket = -1)
inline

Definition at line 94 of file RTSPServer.hh.

94 { return rtspURLPrefix(clientSocket, True); }
char * rtspURLPrefix(int clientSocket=-1, Boolean useIPv6=False) const
const Boolean True
Definition: Boolean.hh:31

References rtspURLPrefix(), and True.

◆ isMediaSession()

virtual Boolean Medium::isMediaSession ( ) const
virtualinherited

Reimplemented in MediaSession.

◆ isRTCPInstance()

virtual Boolean Medium::isRTCPInstance ( ) const
virtualinherited

Reimplemented in RTCPInstance.

◆ isRTSPClient()

virtual Boolean Medium::isRTSPClient ( ) const
virtualinherited

Reimplemented in RTSPClient.

◆ isRTSPServer()

virtual Boolean RTSPServer::isRTSPServer ( ) const
privatevirtual

Reimplemented from Medium.

◆ isServerMediaSession()

virtual Boolean Medium::isServerMediaSession ( ) const
virtualinherited

Reimplemented in ServerMediaSession.

◆ isSink()

virtual Boolean Medium::isSink ( ) const
virtualinherited

Reimplemented in MediaSink.

◆ isSource()

virtual Boolean Medium::isSource ( ) const
virtualinherited

Reimplemented in MediaSource.

◆ lookupByName() [1/2]

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

◆ lookupByName() [2/2]

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

◆ lookupClientSession() [1/2]

ClientSession* GenericMediaServer::lookupClientSession ( u_int32_t  sessionId)
protectedinherited

◆ lookupClientSession() [2/2]

ClientSession* GenericMediaServer::lookupClientSession ( char const *  sessionIdStr)
protectedinherited

◆ lookupServerMediaSession() [1/2]

virtual void GenericMediaServer::lookupServerMediaSession ( char const *  streamName,
lookupServerMediaSessionCompletionFunc completionFunc,
void *  completionClientData,
Boolean  isFirstLookupInSession = True 
)
virtualinherited

◆ lookupServerMediaSession() [2/2]

void GenericMediaServer::lookupServerMediaSession ( char const *  streamName,
void(GenericMediaServer::*)(ServerMediaSession *)  memberFunc 
)
inherited

◆ name()

char const* Medium::name ( ) const
inlineinherited

Definition at line 61 of file Media.hh.

61 {return fMediumName;}
char fMediumName[mediumNameMaxLen]
Definition: Media.hh:83

References Medium::fMediumName.

◆ nextTask()

TaskToken& Medium::nextTask ( )
inlineprotectedinherited

Definition at line 77 of file Media.hh.

77  {
78  return fNextTask;
79  }
TaskToken fNextTask
Definition: Media.hh:84

References Medium::fNextTask.

◆ noteTCPStreamingOnSocket()

void RTSPServer::noteTCPStreamingOnSocket ( int  socketNum,
RTSPClientSession clientSession,
unsigned  trackNum 
)
private

◆ numClientSessions()

unsigned GenericMediaServer::numClientSessions ( ) const
inlineinherited

Definition at line 80 of file GenericMediaServer.hh.

80 { return fClientSessions->numEntries(); }
virtual unsigned numEntries() const =0

References GenericMediaServer::fClientSessions, and HashTable::numEntries().

◆ registerStream()

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 
)

◆ removeServerMediaSession() [1/2]

void GenericMediaServer::removeServerMediaSession ( ServerMediaSession serverMediaSession)
inherited

◆ removeServerMediaSession() [2/2]

virtual void GenericMediaServer::removeServerMediaSession ( char const *  streamName)
virtualinherited

◆ rtspURL()

char* RTSPServer::rtspURL ( ServerMediaSession const *  serverMediaSession,
int  clientSocket = -1,
Boolean  useIPv6 = False 
) const

Referenced by ipv4rtspURL(), and ipv6rtspURL().

◆ rtspURLPrefix()

char* RTSPServer::rtspURLPrefix ( int  clientSocket = -1,
Boolean  useIPv6 = False 
) const

◆ setAuthenticationDatabase()

UserAuthenticationDatabase* RTSPServer::setAuthenticationDatabase ( UserAuthenticationDatabase newDB)

◆ setUpOurSocket()

static int GenericMediaServer::setUpOurSocket ( UsageEnvironment env,
Port ourPort,
int  domain 
)
staticprotectedinherited

◆ setUpTunnelingOverHTTP()

Boolean RTSPServer::setUpTunnelingOverHTTP ( Port  httpPort)

◆ specialClientAccessCheck()

virtual Boolean RTSPServer::specialClientAccessCheck ( int  clientSocket,
struct sockaddr_storage const &  clientAddr,
char const *  urlSuffix 
)
protectedvirtual

◆ specialClientUserAccessCheck()

virtual Boolean RTSPServer::specialClientUserAccessCheck ( int  clientSocket,
struct sockaddr_storage const &  clientAddr,
char const *  urlSuffix,
char const *  username 
)
protectedvirtual

◆ stopTCPStreamingOnSocket()

void RTSPServer::stopTCPStreamingOnSocket ( int  socketNum)
private

◆ unnoteTCPStreamingOnSocket()

void RTSPServer::unnoteTCPStreamingOnSocket ( int  socketNum,
RTSPClientSession clientSession,
unsigned  trackNum 
)
private

◆ weImplementREGISTER()

virtual Boolean RTSPServer::weImplementREGISTER ( char const *  cmd,
char const *  proxyURLSuffix,
char *&  responseStr 
)
protectedvirtual

Friends And Related Function Documentation

◆ DeregisterRequestRecord

friend class DeregisterRequestRecord
friend

Definition at line 315 of file RTSPServer.hh.

◆ RegisterRequestRecord

friend class RegisterRequestRecord
friend

Definition at line 314 of file RTSPServer.hh.

◆ RTSPClientConnection

friend class RTSPClientConnection
friend

Definition at line 312 of file RTSPServer.hh.

◆ RTSPClientSession

friend class RTSPClientSession
friend

Definition at line 313 of file RTSPServer.hh.

Field Documentation

◆ fAllowStreamingRTPOverTCP

Boolean RTSPServer::fAllowStreamingRTPOverTCP
private

Definition at line 325 of file RTSPServer.hh.

Referenced by disableStreamingRTPOverTCP().

◆ fAuthDB

UserAuthenticationDatabase* RTSPServer::fAuthDB
private

Definition at line 324 of file RTSPServer.hh.

◆ fClientConnectionsForHTTPTunneling

HashTable* RTSPServer::fClientConnectionsForHTTPTunneling
private

Definition at line 318 of file RTSPServer.hh.

◆ fHTTPServerPort

Port RTSPServer::fHTTPServerPort
private

Definition at line 317 of file RTSPServer.hh.

◆ fHTTPServerSocketIPv4

int RTSPServer::fHTTPServerSocketIPv4
private

Definition at line 316 of file RTSPServer.hh.

◆ fHTTPServerSocketIPv6

int RTSPServer::fHTTPServerSocketIPv6
private

Definition at line 316 of file RTSPServer.hh.

◆ fPendingRegisterOrDeregisterRequests

HashTable* RTSPServer::fPendingRegisterOrDeregisterRequests
private

Definition at line 322 of file RTSPServer.hh.

◆ fReclamationSeconds

unsigned GenericMediaServer::fReclamationSeconds
protectedinherited

Definition at line 177 of file GenericMediaServer.hh.

◆ fRegisterOrDeregisterRequestCounter

unsigned RTSPServer::fRegisterOrDeregisterRequestCounter
private

Definition at line 323 of file RTSPServer.hh.

◆ fServerPort

Port GenericMediaServer::fServerPort
protectedinherited

◆ fServerSocketIPv4

int GenericMediaServer::fServerSocketIPv4
protectedinherited

Definition at line 175 of file GenericMediaServer.hh.

◆ fServerSocketIPv6

int GenericMediaServer::fServerSocketIPv6
protectedinherited

Definition at line 175 of file GenericMediaServer.hh.

◆ fTCPStreamingDatabase

HashTable* RTSPServer::fTCPStreamingDatabase
private

Definition at line 320 of file RTSPServer.hh.


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