#include "MediaServer.h" #include "BoostLog.h" #include "Network/TcpServer.h" #include "Rtsp/RtspSession.h" class MediaServerPrivate { public: toolkit::TcpServer::Ptr rtsp_server[2]; }; MediaServer::MediaServer(uint16_t port, bool ssl) : m_d(new MediaServerPrivate()) { try { m_d->rtsp_server[ssl] = std::make_shared(); if (ssl) { m_d->rtsp_server[ssl]->start>(port); } else { m_d->rtsp_server[ssl]->start(port); } } catch (std::exception &ex) { m_d->rtsp_server[ssl] = nullptr; WarnL << ex.what(); } } MediaServer::~MediaServer() { // mk_stop_all_server(); if (m_d != nullptr) { delete m_d; } }