00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "playCommon.hh"
00021
00022 Medium* createClient(UsageEnvironment& env,
00023 int verbosityLevel, char const* applicationName) {
00024 extern portNumBits tunnelOverHTTPPortNum;
00025 return RTSPClient::createNew(env, verbosityLevel, applicationName,
00026 tunnelOverHTTPPortNum);
00027 }
00028
00029 char* getOptionsResponse(Medium* client, char const* url,
00030 char* username, char* password) {
00031 RTSPClient* rtspClient = (RTSPClient*)client;
00032 return rtspClient->sendOptionsCmd(url, username, password);
00033 }
00034
00035 char* getSDPDescriptionFromURL(Medium* client, char const* url,
00036 char const* username, char const* password,
00037 char const* ,
00038 unsigned short ,
00039 unsigned short ) {
00040 RTSPClient* rtspClient = (RTSPClient*)client;
00041 char* result;
00042 if (username != NULL && password != NULL) {
00043 result = rtspClient->describeWithPassword(url, username, password);
00044 } else {
00045 result = rtspClient->describeURL(url);
00046 }
00047
00048 extern unsigned statusCode;
00049 statusCode = rtspClient->describeStatus();
00050 return result;
00051 }
00052
00053 Boolean clientSetupSubsession(Medium* client, MediaSubsession* subsession,
00054 Boolean streamUsingTCP) {
00055 if (client == NULL || subsession == NULL) return False;
00056 RTSPClient* rtspClient = (RTSPClient*)client;
00057 return rtspClient->setupMediaSubsession(*subsession,
00058 False, streamUsingTCP);
00059 }
00060
00061 Boolean clientStartPlayingSession(Medium* client,
00062 MediaSession* session) {
00063 extern double initialSeekTime, duration, scale;
00064 double endTime = initialSeekTime;
00065 if (scale > 0) {
00066 if (duration <= 0) endTime = -1.0f;
00067 else endTime = initialSeekTime + duration;
00068 } else {
00069 endTime = initialSeekTime - duration;
00070 if (endTime < 0) endTime = 0.0f;
00071 }
00072
00073 if (client == NULL || session == NULL) return False;
00074 RTSPClient* rtspClient = (RTSPClient*)client;
00075 return rtspClient->playMediaSession(*session, (float)initialSeekTime, (float)endTime, (float)scale);
00076 }
00077
00078 Boolean clientTearDownSession(Medium* client,
00079 MediaSession* session) {
00080 if (client == NULL || session == NULL) return False;
00081 RTSPClient* rtspClient = (RTSPClient*)client;
00082 return rtspClient->teardownMediaSession(*session);
00083 }
00084
00085 Boolean allowProxyServers = False;
00086 Boolean controlConnectionUsesTCP = True;
00087 Boolean supportCodecSelection = False;
00088 char const* clientProtocolName = "RTSP";