
#include <fstream>
#include "MediaRtmpService.h"

namespace mfs
{
    static MediaRtmpService* _instance = nullptr;

    MediaRtmpService* MediaRtmpService::Instance()
    {
        return _instance;
    }

    MediaRtmpService* MediaRtmpService::SetupOnce(std::string& sername, int port, std::shared_ptr<uvw::Loop> loop)
    {
        if (_instance)
        {
            delete _instance;
            _instance = nullptr;
        }
        
        _instance = new MediaRtmpService(sername, port, loop);
        return _instance;
    }
}
