/* MediaMtx (C++) - RTSP static source (MediaMTX: internal/staticsources/rtsp) Pulls a camera stream with live555 (DESCRIBE / SETUP / PLAY), in its own thread with its own live555 event loop. Only H264 video is taken; other tracks are skipped. On an error or when no data arrives for readTimeout the session is torn down and opened again after sourceRetryPause. */ #pragma once #include #include #include #include #include #include "../../conf/conf.h" #include #include #include namespace mtx { class RtspSource : public LogParent { public: RtspSource(const PathConf & conf, const Conf & global, SourceParent * parent); ~RtspSource(); void start(); void stop(); // called by the live555 session (same thread) bool stopRequested() const { return m_bStop; } SourceParent * parent() { return m_pParent; } const PathConf & pathConf() const { return m_conf; } const Conf & global() const { return m_global; } private: void run(); void runSession(); void waitRetry(); PathConf m_conf; Conf m_global; SourceParent * m_pParent; std::atomic m_bStop{false}; std::mutex m_mutex; std::condition_variable m_cond; std::thread m_thread; }; } // namespace mtx