MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / CHttpWorker

Method CHttpWorker

Modules/HttpServer/HttpWorker.cpp:32–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 //////////////////////////////////////////////////////////////////////////
31
32 CHttpWorker::CHttpWorker(string strCode, HandleType t, int nChannel, bool isWs)
33 : m_strCode(strCode)
34 , m_nType(0)
35 , m_pLive(nullptr)
36 , m_eHandleType(t)
37 , m_nChannel(nChannel)
38 , m_bWebSocket(isWs)
39 , m_bConnect(true)
40 {
41 m_pRing = lws_ring_create(sizeof(AV_BUFF), 100, destroy_ring_node);
42
43 if (t == h264_handle) {
44 CH264 *tmp = new CH264(AVCallback, this);
45 tmp->SetNodelay(g_nNodelay);
46 m_pFormat = tmp;
47 } else if(t == flv_handle) {
48 CFlv *tmp = new CFlv(AVCallback, this);
49 tmp->SetNodelay(g_nNodelay);
50 m_pFormat = tmp;
51 } else if(t == fmp4_handle){
52 CMP4 *tmp = new CMP4(AVCallback, this);
53 tmp->SetNodelay(g_nNodelay);
54 m_pFormat = tmp;
55 }
56
57 m_SocketBuff.eType = AV_TYPE::NONE;
58 m_SocketBuff.pData = nullptr;
59 m_SocketBuff.nLen = 0;
60
61 m_pLive = LiveClient::GetWorker(strCode);
62 if(m_pLive)
63 m_pLive->AddHandle(this, t, nChannel);
64 }
65
66 CHttpWorker::~CHttpWorker()
67 {

Callers

nothing calls this directly

Calls 4

lws_ring_createFunction · 0.85
GetWorkerFunction · 0.85
SetNodelayMethod · 0.45
AddHandleMethod · 0.45

Tested by

no test coverage detected