ZLMediaKit/src/Rtp/GB28181Process.h

62 lines
1.7 KiB
C++
Raw Normal View History

2020-10-24 23:37:43 +08:00
/*
2020-10-24 23:33:13 +08:00
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
*
* This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit).
2020-10-24 23:33:13 +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.
*/
#ifndef ZLMEDIAKIT_GB28181ROCESS_H
#define ZLMEDIAKIT_GB28181ROCESS_H
#if defined(ENABLE_RTPPROXY)
#include "Decoder.h"
#include "ProcessInterface.h"
#include "Rtsp/RtpCodec.h"
#include "Rtsp/RtpReceiver.h"
#include "Http/HttpRequestSplitter.h"
namespace mediakit{
class RtpReceiverImp;
class GB28181Process : public ProcessInterface {
2020-10-24 23:33:13 +08:00
public:
typedef std::shared_ptr<GB28181Process> Ptr;
2022-01-11 14:09:57 +08:00
GB28181Process(const MediaInfo &media_info, MediaSinkInterface *sink);
2022-10-16 19:49:56 +08:00
~GB28181Process() override = default;
2020-10-24 23:33:13 +08:00
/**
* rtp
* @param data rtp数据指针
* @param data_len rtp数据长度
* @return
*/
bool inputRtp(bool, const char *data, size_t data_len) override;
2020-10-24 23:33:13 +08:00
2022-10-16 19:49:56 +08:00
/**
*
*/
void flush() override;
2020-10-24 23:33:13 +08:00
protected:
void onRtpSorted(RtpPacket::Ptr rtp);
2020-10-24 23:33:13 +08:00
private:
void onRtpDecode(const Frame::Ptr &frame);
private:
MediaInfo _media_info;
DecoderImp::Ptr _decoder;
MediaSinkInterface *_interface;
std::shared_ptr<FILE> _save_file_ps;
std::unordered_map<uint8_t, std::shared_ptr<RtpCodec> > _rtp_decoder;
std::unordered_map<uint8_t, std::shared_ptr<RtpReceiverImp> > _rtp_receiver;
2020-10-24 23:33:13 +08:00
};
}//namespace mediakit
#endif//defined(ENABLE_RTPPROXY)
#endif //ZLMEDIAKIT_GB28181ROCESS_H