GB28181单端口接收流支持多线程

This commit is contained in:
ziyue
2021-06-08 14:03:25 +08:00
parent 92736db5b2
commit c4817c6d5f
5 changed files with 85 additions and 51 deletions

View File

@@ -20,9 +20,11 @@ using namespace toolkit;
namespace mediakit{
class RtpSession : public TcpSession , public RtpSplitter , public MediaSourceEvent{
class RtpSession : public Session , public RtpSplitter , public MediaSourceEvent{
public:
static const string kStreamID;
static const string kIsUDP;
RtpSession(const Socket::Ptr &sock);
~RtpSession() override;
void onRecv(const Buffer::Ptr &) override;
@@ -41,13 +43,16 @@ protected:
const char *onSearchPacketTail(const char *data, size_t len) override;
private:
bool _is_udp = false;
bool _search_rtp = false;
bool _search_rtp_finished = false;
uint32_t _ssrc = 0;
Ticker _ticker;
string _stream_id;
struct sockaddr addr;
struct sockaddr _addr;
RtpProcess::Ptr _process;
std::shared_ptr<ObjectStatistic<TcpSession> > _statistic_tcp;
std::shared_ptr<ObjectStatistic<UdpSession> > _statistic_udp;
};
}//namespace mediakit