ZLMediaKit/src/Rtp/RtpSplitter.h

46 lines
1.3 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/xia-chu/ZLMediaKit).
2019-12-06 11:54:10 +08:00
*
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() = default;
~RtpSplitter() override = default;
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
*/
virtual void onRtpPacket(const char *data, size_t len) = 0;
2020-08-15 09:48:27 +08:00
2019-12-05 19:20:12 +08:00
protected:
2021-01-19 16:05:38 +08:00
ssize_t onRecvHeader(const char *data, size_t len) override;
const char *onSearchPacketTail(const char *data, size_t len) override;
const char *onSearchPacketTail_l(const char *data, size_t len);
2020-10-18 21:39:22 +08:00
private:
bool _is_ehome = true;
bool _is_rtsp_interleaved = true;
size_t _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