大幅提升接收推流性能以及降低内存占用

This commit is contained in:
xiongziliang
2020-11-01 03:41:35 +08:00
parent 5c7a08eb7c
commit 700a16c759
38 changed files with 173 additions and 193 deletions

View File

@@ -18,7 +18,9 @@
#include <map>
#include <stdexcept>
#include <functional>
#include "Network/Buffer.h"
using namespace std;
using namespace toolkit;
enum AMFType {
AMF_NUMBER,
@@ -81,7 +83,7 @@ private:
class AMFDecoder {
public:
AMFDecoder(const std::string &buf, size_t pos, int version = 0);
AMFDecoder(const BufferLikeString &buf, size_t pos, int version = 0);
template<typename TP>
TP load();
private:
@@ -92,7 +94,7 @@ private:
uint8_t front();
uint8_t pop_front();
private:
const std::string &buf;
const BufferLikeString &buf;
size_t pos;
int version;
};