testProgs/openRTSP.cpp

Go to the documentation of this file.
00001 /**********
00002 This library is free software; you can redistribute it and/or modify it under
00003 the terms of the GNU Lesser General Public License as published by the
00004 Free Software Foundation; either version 2.1 of the License, or (at your
00005 option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
00006 
00007 This library is distributed in the hope that it will be useful, but WITHOUT
00008 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00009 FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
00010 more details.
00011 
00012 You should have received a copy of the GNU Lesser General Public License
00013 along with this library; if not, write to the Free Software Foundation, Inc.,
00014 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
00015 **********/
00016 // Copyright (c) 1996-2014, Live Networks, Inc.  All rights reserved
00017 // A RTSP client application that opens a RTSP URL argument,
00018 // and extracts and records the data from each incoming RTP stream.
00019 //
00020 // NOTE: If you want to develop your own RTSP client application (or embed RTSP client functionality into your own application),
00021 // then we don't recommend using this code as a model, because it is too complex (with many options).
00022 // Instead, we recommend using the "testRTSPClient" application code as a model.
00023 
00024 #include "playCommon.hh"
00025 
00026 RTSPClient* ourRTSPClient = NULL;
00027 Medium* createClient(UsageEnvironment& env, char const* url, int verbosityLevel, char const* applicationName) {
00028   extern portNumBits tunnelOverHTTPPortNum;
00029   return ourRTSPClient = RTSPClient::createNew(env, url, verbosityLevel, applicationName, tunnelOverHTTPPortNum);
00030 }
00031 
00032 void assignClient(Medium* client) {
00033   ourRTSPClient = (RTSPClient*)client;
00034 }
00035 
00036 void getOptions(RTSPClient::responseHandler* afterFunc) { 
00037   ourRTSPClient->sendOptionsCommand(afterFunc, ourAuthenticator);
00038 }
00039 
00040 void getSDPDescription(RTSPClient::responseHandler* afterFunc) {
00041   ourRTSPClient->sendDescribeCommand(afterFunc, ourAuthenticator);
00042 }
00043 
00044 void setupSubsession(MediaSubsession* subsession, Boolean streamUsingTCP, Boolean forceMulticastOnUnspecified, RTSPClient::responseHandler* afterFunc) {
00045   
00046   ourRTSPClient->sendSetupCommand(*subsession, afterFunc, False, streamUsingTCP, forceMulticastOnUnspecified, ourAuthenticator);
00047 }
00048 
00049 void startPlayingSession(MediaSession* session, double start, double end, float scale, RTSPClient::responseHandler* afterFunc) {
00050   ourRTSPClient->sendPlayCommand(*session, afterFunc, start, end, scale, ourAuthenticator);
00051 }
00052 
00053 void startPlayingSession(MediaSession* session, char const* absStartTime, char const* absEndTime, float scale, RTSPClient::responseHandler* afterFunc) {
00054   ourRTSPClient->sendPlayCommand(*session, afterFunc, absStartTime, absEndTime, scale, ourAuthenticator);
00055 }
00056 
00057 void tearDownSession(MediaSession* session, RTSPClient::responseHandler* afterFunc) {
00058   ourRTSPClient->sendTeardownCommand(*session, afterFunc, ourAuthenticator);
00059 }
00060 
00061 void setUserAgentString(char const* userAgentString) {
00062   ourRTSPClient->setUserAgentString(userAgentString);
00063 }
00064 
00065 Boolean allowProxyServers = False;
00066 Boolean controlConnectionUsesTCP = True;
00067 Boolean supportCodecSelection = False;
00068 char const* clientProtocolName = "RTSP";

Generated on Tue Mar 25 14:35:36 2014 for live by  doxygen 1.5.2