liveMedia/include/RTSPCommon.hh

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 // "liveMedia"
00017 // Copyright (c) 1996-2013 Live Networks, Inc.  All rights reserved.
00018 // Common routines used by both RTSP clients and servers
00019 // C++ header
00020 
00021 #ifndef _RTSP_COMMON_HH
00022 #define _RTSP_COMMON_HH
00023 
00024 #ifndef _BOOLEAN_HH
00025 #include "Boolean.hh"
00026 #endif
00027 
00028 #ifndef _MEDIA_HH
00029 #include <Media.hh> // includes some definitions perhaps needed for Borland compilers?
00030 #endif
00031 
00032 #if defined(__WIN32__) || defined(_WIN32) || defined(_QNX4)
00033 #define _strncasecmp _strnicmp
00034 #define snprintf _snprintf
00035 #else
00036 #define _strncasecmp strncasecmp
00037 #endif
00038 
00039 #define RTSP_PARAM_STRING_MAX 200
00040 
00041 Boolean parseRTSPRequestString(char const *reqStr, unsigned reqStrSize,
00042                                char *resultCmdName,
00043                                unsigned resultCmdNameMaxSize,
00044                                char* resultURLPreSuffix,
00045                                unsigned resultURLPreSuffixMaxSize,
00046                                char* resultURLSuffix,
00047                                unsigned resultURLSuffixMaxSize,
00048                                char* resultCSeq,
00049                                unsigned resultCSeqMaxSize,
00050                                char* resultSessionId,
00051                                unsigned resultSessionIdMaxSize,
00052                                unsigned& contentLength);
00053 
00054 Boolean parseRangeParam(char const* paramStr, double& rangeStart, double& rangeEnd, char*& absStartTime, char*& absEndTime);
00055 Boolean parseRangeHeader(char const* buf, double& rangeStart, double& rangeEnd, char*& absStartTime, char*& absEndTime);
00056 
00057 Boolean RTSPOptionIsSupported(char const* commandName, char const* optionsResponseString);
00058     // Returns True iff the RTSP command "commandName" is mentioned as one of the commands supported in "optionsResponseString"
00059     // (which should be the 'resultString' from a previous RTSP "OPTIONS" request).
00060 
00061 char const* dateHeader(); // A "Date:" header that can be used in a RTSP (or HTTP) response 
00062 
00063 void ignoreSigPipeOnSocket(int socketNum);
00064 
00065 #endif

Generated on Tue Jun 18 13:16:51 2013 for live by  doxygen 1.5.2