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

For #307, allow dedicated cache for GSO.

This commit is contained in:
winlin 2020-04-14 09:20:21 +08:00
parent 89a247d9bc
commit 8a71ce62db
9 changed files with 303 additions and 48 deletions

View file

@ -273,6 +273,15 @@ private:
int cache_pos;
// The max number of messages for sendmmsg. If 1, we use sendmsg to send.
int max_sendmmsg;
// Whether GSO shares the same mmsghdr cache.
// If not shared, use dedicated cache for GSO.
bool gso_dedicated;
private:
// For Linux kernel 3.*, we must use isolate queue for GSO,
// that is, sendmmsg does not work with GSO.
std::vector<mmsghdr> gso_hotspot;
std::vector<mmsghdr> gso_cache;
int gso_cache_pos;
public:
SrsUdpMuxSender(SrsRtcServer* s);
virtual ~SrsUdpMuxSender();
@ -282,6 +291,7 @@ private:
void free_mhdrs(std::vector<mmsghdr>& mhdrs);
public:
virtual srs_error_t fetch(mmsghdr** pphdr);
virtual srs_error_t gso_fetch(mmsghdr** pphdr);
virtual srs_error_t sendmmsg(mmsghdr* hdr);
virtual srs_error_t cycle();
// interface ISrsReloadHandler