1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

SRT: Initialize SRT eventloop in adapter.

This commit is contained in:
winlin 2022-05-28 12:07:36 +08:00
parent 4899be9c34
commit 21899c5998
2 changed files with 15 additions and 11 deletions

View file

@ -14,6 +14,10 @@ using namespace std;
#include <srs_app_config.hpp>
#include <srs_app_srt_conn.hpp>
#ifdef SRS_SRT
SrsSrtEventLoop* _srt_eventloop = NULL;
#endif
std::string srs_srt_listener_type2string(SrsSrtListenerType type)
{
switch (type) {
@ -300,6 +304,17 @@ SrsSrtServerAdapter::~SrsSrtServerAdapter()
srs_error_t SrsSrtServerAdapter::initialize()
{
srs_error_t err = srs_success;
_srt_eventloop = new SrsSrtEventLoop();
if ((err = _srt_eventloop->initialize()) != srs_success) {
return srs_error_wrap(err, "srt poller initialize");
}
if ((err = _srt_eventloop->start()) != srs_success) {
return srs_error_wrap(err, "srt poller start");
}
return err;
}