00001
00034 #pragma once
00035
00036
00037 #include <map>
00038 #include <string>
00039 #include <vector>
00040
00041
00042 #include <liveMedia.hh>
00043
00044
00045 class RtpPacketManager;
00046
00047
00048
00049
00050
00051 class RtspDataSession
00052 {
00053 public:
00055 RtspDataSession(RtpPacketManager* pRtpPacketManager);
00056
00057 bool streamUsingTCP() const { return m_bStreamUsingTCP; }
00058 void streamUsingTCP(bool val) { m_bStreamUsingTCP = val; }
00059
00061 bool startRetrievingData(const std::string sUrl, int nTimeOut = -1);
00062
00064 void setWatchVariable()
00065 {
00066 m_watchVariable = 1;
00067 }
00068
00069 std::string getLastError()
00070 {
00071 return m_sLastError;
00072 }
00073
00075 void shutdown();
00076
00078 static void subsessionByeHandler(void* clientData)
00079 {
00080 RtspDataSession* pSnifferSession = (RtspDataSession*) clientData;
00081 pSnifferSession->shutdown();
00082 }
00083
00084 private:
00085
00086 bool playStreams(UsageEnvironment* pEnv, MediaSession* pSession);
00087
00088 bool createReceivers(MediaSession* pSession);
00093 bool mapLiveMediaToRtvc(MediaSession* pSession);
00094
00096 bool needToPlayStreams(MediaSession* pSubsession);
00097
00098
00099 RtpPacketManager* m_pRtpPacketManager;
00100
00102 RTSPClient* m_pRtspClient;
00103
00105 MediaSession* m_pSession;
00106
00108 bool m_bStreamUsingTCP;
00109
00111 char m_watchVariable;
00112
00113
00114 std::string m_sLastError;
00115
00116
00117 std::vector<MediaSubsession*> m_vMediaSubsessions;
00118 };