ZLMediaKit/src/Rtp/RtpSplitter.h

44 lines
1.2 KiB
C++
Raw Normal View History

2019-12-05 19:20:12 +08:00
/*
2020-04-04 20:30:09 +08:00
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
2019-12-06 11:54:10 +08:00
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
*
2020-04-04 20:30:09 +08:00
* Use of this source code is governed by MIT license that can be found in the
* LICENSE file in the root of the source tree. All contributing project authors
* may be found in the AUTHORS file in the root of the source tree.
2019-12-06 11:54:10 +08:00
*/
2019-12-05 19:20:12 +08:00
2019-12-06 11:54:10 +08:00
#ifndef ZLMEDIAKIT_RTPSPLITTER_H
#define ZLMEDIAKIT_RTPSPLITTER_H
2019-12-05 19:20:12 +08:00
2019-12-06 11:54:10 +08:00
#if defined(ENABLE_RTPPROXY)
2019-12-05 19:20:12 +08:00
#include "Http/HttpRequestSplitter.h"
2019-12-06 11:54:10 +08:00
namespace mediakit{
2019-12-05 19:20:12 +08:00
class RtpSplitter : public HttpRequestSplitter{
public:
RtpSplitter();
2020-10-24 23:32:23 +08:00
~RtpSplitter() override;
2020-08-15 09:48:27 +08:00
2019-12-05 19:20:12 +08:00
protected:
/**
* rtp包回调
2020-10-24 23:32:23 +08:00
* @param data RTP包数据指针
* @param len RTP包数据长度
2019-12-05 19:20:12 +08:00
*/
2020-10-24 23:32:23 +08:00
virtual void onRtpPacket(const char *data, uint64_t len) = 0;
2020-08-15 09:48:27 +08:00
2019-12-05 19:20:12 +08:00
protected:
2020-10-24 23:32:23 +08:00
int64_t onRecvHeader(const char *data, uint64_t len) override;
const char *onSearchPacketTail(const char *data, uint64_t len) override;
const char *onSearchPacketTail_l(const char *data, uint64_t len);
2020-10-18 21:39:22 +08:00
private:
int _offset = 0;
2019-12-05 19:20:12 +08:00
};
2019-12-06 11:54:10 +08:00
}//namespace mediakit
#endif//defined(ENABLE_RTPPROXY)
#endif //ZLMEDIAKIT_RTPSPLITTER_H