mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-04 09:47:33 +08:00
优化性能
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include "Util/logger.h"
|
||||
#include "Util/TimeTicker.h"
|
||||
#include "Network/Socket.h"
|
||||
#include "Util/ResourcePool.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace ZL::Util;
|
||||
@@ -54,9 +55,7 @@ public:
|
||||
void reset();
|
||||
protected:
|
||||
virtual void onSendRawData(const char *pcRawData,int iSize) = 0;
|
||||
virtual void onSendRawData(string &&strData) {
|
||||
onSendRawData(strData.data(),strData.size());
|
||||
};
|
||||
virtual void onSendRawData(const Socket::Buffer::Ptr &buffer,int flags) = 0;
|
||||
|
||||
virtual void onRtmpChunk(RtmpPacket &chunkData) = 0;
|
||||
|
||||
@@ -79,13 +78,14 @@ protected:
|
||||
void sendInvoke(const string &strCmd, const AMFValue &val);
|
||||
void sendRequest(int iCmd, const string &str);
|
||||
void sendResponse(int iType, const string &str);
|
||||
void sendRtmp(uint8_t ui8Type, uint32_t ui32StreamId, const std::string &strBuf, uint32_t ui32TimeStamp, int iChunkID);
|
||||
void sendRtmp(uint8_t ui8Type, uint32_t ui32StreamId, const std::string &strBuf, uint32_t ui32TimeStamp, int iChunkID,bool msg_more = false);
|
||||
protected:
|
||||
int m_iReqID = 0;
|
||||
uint32_t m_ui32StreamId = STREAM_CONTROL;
|
||||
int m_iNowStreamID = 0;
|
||||
int m_iNowChunkID = 0;
|
||||
bool m_bDataStarted = false;
|
||||
ResourcePool<Socket::BufferRaw,MAX_SEND_PKT> m_bufferPool;
|
||||
private:
|
||||
void handle_S0S1S2(const function<void()> &cb);
|
||||
void handle_C0C1();
|
||||
|
||||
Reference in New Issue
Block a user