2020-09-06 18:09:31 +08:00
|
|
|
|
/*
|
2020-09-06 17:56:05 +08:00
|
|
|
|
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
|
|
|
|
|
*
|
2021-01-17 18:31:50 +08:00
|
|
|
|
* This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit).
|
2020-09-06 17:56:05 +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_PSENCODER_H
|
|
|
|
|
#define ZLMEDIAKIT_PSENCODER_H
|
2021-12-28 21:04:53 +08:00
|
|
|
|
|
2020-09-06 17:56:05 +08:00
|
|
|
|
#if defined(ENABLE_RTPPROXY)
|
2021-12-28 21:04:53 +08:00
|
|
|
|
|
|
|
|
|
#include "Record/MPEG.h"
|
2020-09-06 17:56:05 +08:00
|
|
|
|
#include "Common/MediaSink.h"
|
|
|
|
|
#include "Common/Stamp.h"
|
2020-10-24 23:33:13 +08:00
|
|
|
|
#include "Extension/CommonRtp.h"
|
2020-09-06 17:56:05 +08:00
|
|
|
|
|
2021-12-28 21:04:53 +08:00
|
|
|
|
namespace mediakit{
|
2020-09-06 17:56:05 +08:00
|
|
|
|
|
2021-12-28 21:04:53 +08:00
|
|
|
|
class PSEncoderImp : public MpegMuxer{
|
2020-10-24 23:33:13 +08:00
|
|
|
|
public:
|
|
|
|
|
PSEncoderImp(uint32_t ssrc, uint8_t payload_type = 96);
|
|
|
|
|
~PSEncoderImp() override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
//rtp打包后回调
|
2022-02-02 20:34:50 +08:00
|
|
|
|
virtual void onRTP(toolkit::Buffer::Ptr rtp) = 0;
|
2020-10-24 23:33:13 +08:00
|
|
|
|
|
|
|
|
|
protected:
|
2022-02-02 20:34:50 +08:00
|
|
|
|
void onWrite(std::shared_ptr<toolkit::Buffer> buffer, uint32_t stamp, bool key_pos) override;
|
2020-10-24 23:33:13 +08:00
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
std::shared_ptr<CommonRtpEncoder> _rtp_encoder;
|
|
|
|
|
};
|
|
|
|
|
|
2020-09-06 17:56:05 +08:00
|
|
|
|
}//namespace mediakit
|
2021-12-28 21:04:53 +08:00
|
|
|
|
|
2020-09-06 17:56:05 +08:00
|
|
|
|
#endif //ENABLE_RTPPROXY
|
|
|
|
|
#endif //ZLMEDIAKIT_PSENCODER_H
|