21#ifndef _RTSP_CLIENT_HH
22#define _RTSP_CLIENT_HH
24#ifndef _MEDIA_SESSION_HH
27#ifndef _NET_ADDRESS_HH
30#ifndef _DIGEST_AUTHENTICATION_HH
36#ifndef OMIT_REGISTER_HANDLING
37#ifndef _RTSP_SERVER_HH
45 int verbosityLevel = 0,
46 char const* applicationName =
NULL,
48 int socketNumToServer = -1);
56 int resultCode,
char* resultString);
99 double start = 0.0f,
double end = -1.0f,
float scale = 1.0f,
105 double start = 0.0f,
double end = -1.0f,
float scale = 1.0f,
115 char const* absStartTime,
char const* absEndTime =
NULL,
float scale = 1.0f,
118 char const* absStartTime,
char const* absEndTime =
NULL,
float scale = 1.0f,
143 char const* parameterName,
char const* parameterValue,
179 char const* sourceName,
243 int verbosityLevel,
char const* applicationName,
portNumBits tunnelOverHTTPPortNum,
int socketNumToServer);
252 char*& cmdURL,
Boolean& cmdURLWasAllocated,
253 char const*& protocolStr,
254 char*& extraHeaders,
Boolean& extraHeadersWereAllocated);
289 static Boolean checkForHeader(
char const* line,
char const* headerName,
unsigned headerNameLength,
char const*& headerParams);
291 char*& serverAddressStr,
portNumBits& serverPortNum,
292 unsigned char& rtpChannelId,
unsigned char& rtcpChannelId);
299 char const* scaleParamsStr,
const char* speedParamsStr,
300 char const* rangeParamsStr,
char const* rtpInfoParamsStr);
310 char const*& separator,
311 char const*& suffix);
329 int write(
const char* data,
unsigned count);
330 int read(u_int8_t* buffer,
unsigned bufferSize);
372#ifndef OMIT_REGISTER_HANDLING
384 int verbosityLevel = 0,
char const* applicationName =
NULL);
395 int socketNumToServer);
402 char const* proxyURLSuffix,
char*& responseStr);
405 char const* url,
char const* urlSuffix,
int socketToRemoteServer,
406 Boolean deliverViaTCP,
char const* proxyURLSuffix);
portNumBits portNum(struct sockaddr_storage const &address)
void onRTSPClientCreationFunc(RTSPClient *newRTSPClient, Boolean requestStreamingOverTCP)
virtual void implementCmd_REGISTER(char const *cmd, char const *url, char const *urlSuffix, int socketToRemoteServer, Boolean deliverViaTCP, char const *proxyURLSuffix)
virtual RTSPClient * createNewRTSPClient(char const *rtspURL, int verbosityLevel, char const *applicationName, int socketNumToServer)
HandlerServerForREGISTERCommand(UsageEnvironment &env, onRTSPClientCreationFunc *creationFunc, int ourSocketIPv4, int ourSocketIPv6, Port ourPort, UserAuthenticationDatabase *authDatabase, int verbosityLevel, char const *applicationName)
onRTSPClientCreationFunc * fCreationFunc
virtual ~HandlerServerForREGISTERCommand()
static HandlerServerForREGISTERCommand * createNew(UsageEnvironment &env, onRTSPClientCreationFunc *creationFunc, Port ourPort=0, UserAuthenticationDatabase *authDatabase=NULL, int verbosityLevel=0, char const *applicationName=NULL)
portNumBits serverPortNum() const
virtual char const * allowedCommandNames()
virtual Boolean weImplementREGISTER(char const *cmd, char const *proxyURLSuffix, char *&responseStr)
void enqueue(RequestRecord *request)
RequestRecord * findByCSeq(unsigned cseq)
void putAtHead(RequestRecord *request)
RequestQueue(RequestQueue &origQueue)
RequestRecord * dequeue()
MediaSession * session() const
MediaSubsession * subsession() const
MediaSubsession * fSubsession
u_int32_t booleanFlags() const
char * contentStr() const
char const * commandName() const
char const * absStartTime() const
char const * absEndTime() const
char const * fCommandName
RequestRecord(unsigned cseq, responseHandler *handler, char const *absStartTime, char const *absEndTime=NULL, float scale=1.0f, MediaSession *session=NULL, MediaSubsession *subsession=NULL)
RequestRecord(unsigned cseq, char const *commandName, responseHandler *handler, MediaSession *session=NULL, MediaSubsession *subsession=NULL, u_int32_t booleanFlags=0, double start=0.0f, double end=-1.0f, float scale=1.0f, char const *contentStr=NULL)
responseHandler * fHandler
responseHandler *& handler()
void handleAlternativeRequestByte1(u_int8_t requestByte)
ClientTLSState * fInputTLS
Boolean parseRTSPURL(char const *url, char *&username, char *&password, NetAddress &address, portNumBits &portNum, char const **urlSuffix=NULL)
char * createKeyMgmtString(char const *url, MediaSubsession const &subsession)
Boolean parseSpeedParam(char const *paramStr, float &speed)
u_int16_t desiredMaxIncomingPacketSize
unsigned sendAnnounceCommand(char const *sdpDescription, responseHandler *responseHandler, Authenticator *authenticator=NULL)
Boolean changeResponseHandler(unsigned cseq, responseHandler *newResponseHandler)
static void responseHandlerForHTTP_GET(RTSPClient *rtspClient, int responseCode, char *responseString)
RequestQueue fRequestsAwaitingHTTPTunneling
virtual Boolean setRequestFields(RequestRecord *request, char *&cmdURL, Boolean &cmdURLWasAllocated, char const *&protocolStr, char *&extraHeaders, Boolean &extraHeadersWereAllocated)
void connectionHandler1()
unsigned sendPauseCommand(MediaSession &session, responseHandler *responseHandler, Authenticator *authenticator=NULL)
Authenticator fCurrentAuthenticator
Boolean resendCommand(RequestRecord *request)
void setSpeed(MediaSession &session, float speed=1.0f)
static unsigned responseBufferSize
void sendDummyUDPPackets(MediaSession &session, unsigned numDummyPackets=2)
unsigned sendRecordCommand(MediaSubsession &subsession, responseHandler *responseHandler, Authenticator *authenticator=NULL)
ClientTLSState * fOutputTLS
unsigned sendDescribeCommand(responseHandler *responseHandler, Authenticator *authenticator=NULL)
char * fUserAgentHeaderStr
Boolean parseResponseCode(char const *line, unsigned &responseCode, char const *&responseString)
unsigned sendPlayCommand(MediaSubsession &subsession, responseHandler *responseHandler, double start=0.0f, double end=-1.0f, float scale=1.0f, Authenticator *authenticator=NULL)
virtual Boolean isRTSPClient() const
static void incomingDataHandler(void *, int)
unsigned sendPlayCommand(MediaSession &session, responseHandler *responseHandler, char const *absStartTime, char const *absEndTime=NULL, float scale=1.0f, Authenticator *authenticator=NULL)
unsigned char fTCPStreamIdCount
char * createAuthenticatorString(char const *cmd, char const *url)
unsigned fResponseBytesAlreadySeen
Boolean fHTTPTunnelingConnectionIsPending
unsigned sendTeardownCommand(MediaSession &session, responseHandler *responseHandler, Authenticator *authenticator=NULL)
unsigned sendPlayCommand(MediaSession &session, responseHandler *responseHandler, double start=0.0f, double end=-1.0f, float scale=1.0f, Authenticator *authenticator=NULL)
Boolean fAllowBasicAuthentication
Boolean handleTEARDOWNResponse(MediaSession &session, MediaSubsession &subsession)
unsigned sendGetParameterCommand(MediaSession &session, responseHandler *responseHandler, char const *parameterName, Authenticator *authenticator=NULL)
int read(u_int8_t *buffer, unsigned bufferSize)
int write(const char *data, unsigned count)
void sendDummyUDPPackets(MediaSubsession &subsession, unsigned numDummyPackets=2)
Boolean setupHTTPTunneling2()
char const * sessionURL(MediaSession const &session) const
unsigned sessionTimeoutParameter() const
void handleRequestError(RequestRecord *request)
char * createBlocksizeString(Boolean streamUsingTCP)
void setBaseURL(char const *url)
void responseHandlerForHTTP_GET1(int responseCode, char *responseString)
Boolean parseTransportParams(char const *paramsStr, char *&serverAddressStr, portNumBits &serverPortNum, unsigned char &rtpChannelId, unsigned char &rtcpChannelId)
unsigned sendTeardownCommand(MediaSubsession &subsession, responseHandler *responseHandler, Authenticator *authenticator=NULL)
RequestQueue fRequestsAwaitingConnection
Boolean handleGET_PARAMETERResponse(char const *parameterName, char *&resultValueString, char *resultValueStringEnd)
static void handleAlternativeRequestByte(void *, u_int8_t requestByte)
static Boolean lookupByName(UsageEnvironment &env, char const *sourceName, RTSPClient *&resultClient)
virtual unsigned sendRequest(RequestRecord *request)
Boolean handleAuthenticationFailure(char const *wwwAuthenticateParamsStr)
void disallowBasicAuthentication()
void handleResponseBytes(int newBytesRead)
void() responseHandler(RTSPClient *rtspClient, int resultCode, char *resultString)
ClientTLSState fPOSTSocketTLS
portNumBits fTunnelOverHTTPPortNum
void setRequireValue(char const *requireValue=NULL)
unsigned sendRecordCommand(MediaSession &session, responseHandler *responseHandler, Authenticator *authenticator=NULL)
unsigned sendOptionsCommand(responseHandler *responseHandler, Authenticator *authenticator=NULL)
unsigned fResponseBufferBytesLeft
unsigned fUserAgentHeaderStrLen
RTSPClient(UsageEnvironment &env, char const *rtspURL, int verbosityLevel, char const *applicationName, portNumBits tunnelOverHTTPPortNum, int socketNumToServer)
Boolean parseScaleParam(char const *paramStr, float &scale)
struct sockaddr_storage fServerAddress
unsigned sendSetParameterCommand(MediaSession &session, responseHandler *responseHandler, char const *parameterName, char const *parameterValue, Authenticator *authenticator=NULL)
unsigned sendPauseCommand(MediaSubsession &subsession, responseHandler *responseHandler, Authenticator *authenticator=NULL)
static void connectionHandler(void *, int)
void resetResponseBuffer()
void handleIncomingRequest()
void setUserAgentString(char const *userAgentName)
virtual int connectToServer(int socketNum, portNumBits remotePortNum)
unsigned sendPlayCommand(MediaSubsession &subsession, responseHandler *responseHandler, char const *absStartTime, char const *absEndTime=NULL, float scale=1.0f, Authenticator *authenticator=NULL)
RequestQueue fRequestsAwaitingResponse
unsigned fSessionTimeoutParameter
unsigned sendSetupCommand(MediaSubsession &subsession, responseHandler *responseHandler, Boolean streamOutgoing=False, Boolean streamUsingTCP=False, Boolean forceMulticastOnUnspecified=False, Authenticator *authenticator=NULL)
static Boolean checkForHeader(char const *line, char const *headerName, unsigned headerNameLength, char const *&headerParams)
void incomingDataHandler1()
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)
unsigned fSessionCookieCounter
Boolean parseRTPInfoParams(char const *¶mStr, u_int16_t &seqNum, u_int32_t ×tamp)
void constructSubsessionURL(MediaSubsession const &subsession, char const *&prefix, char const *&separator, char const *&suffix)
static RTSPClient * createNew(UsageEnvironment &env, char const *rtspURL, int verbosityLevel=0, char const *applicationName=NULL, portNumBits tunnelOverHTTPPortNum=0, int socketNumToServer=-1)
Boolean setupHTTPTunneling1()
char * rtspURL(ServerMediaSession const *serverMediaSession, int clientSocket=-1, Boolean useIPv6=False) const