00001
00034 #pragma once
00035
00036
00037 #include <map>
00038 #include <string>
00039 #include <vector>
00040
00041
00042 #include <liveMedia.hh>
00043
00050 class RtspSnifferSession
00051 {
00052 public:
00053
00055 RtspSnifferSession();
00056
00058 ~RtspSnifferSession();
00063 bool getMediaSessionInformation(const std::string sUrl, int nTimeOut = -1);
00064
00065 std::vector<MediaSubsession*> getMediaSubsessions()
00066 {
00067 return m_vSubsessions;
00068 }
00069
00070 std::string getLastError()
00071 {
00072 return m_sLastError;
00073 }
00074
00076 void shutdown();
00077
00079 static void subsessionByeHandler(void* clientData)
00080 {
00081 RtspSnifferSession* pSnifferSession = (RtspSnifferSession*) clientData;
00082 pSnifferSession->shutdown();
00083 }
00084
00085 private:
00086
00087 bool playStreamsIfNecessary(UsageEnvironment* pEnv, MediaSession* pSession);
00088
00089 bool createReceivers(MediaSession* pSession);
00094
00095
00097 bool needToPlayStreams(MediaSession* pSubsession);
00098
00100
00101
00103 RTSPClient* m_pRtspClient;
00104
00106 MediaSession* m_pSession;
00107
00109 bool m_bStreamUsingTCP;
00110
00112 char m_watchVariable;
00113
00114
00115 std::string m_sLastError;
00116
00117
00118 std::vector<MediaSubsession*> m_vSubsessions;
00119 };