PSEncoder.h 1.07 KB
Newer Older
xiongziliang committed
1
/*
2 3
 * Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
 *
4
 * This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit).
5 6 7 8 9 10 11 12
 *
 * 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
13

14
#if defined(ENABLE_RTPPROXY)
15 16

#include "Record/MPEG.h"
17 18
#include "Common/MediaSink.h"

19
namespace mediakit{
mtdxc committed
20
class CommonRtpEncoder;
21
class PSEncoderImp : public MpegMuxer{
xiongziliang committed
22 23 24 25 26 27
public:
    PSEncoderImp(uint32_t ssrc, uint8_t payload_type = 96);
    ~PSEncoderImp() override;

protected:
    //rtp打包后回调
28
    virtual void onRTP(toolkit::Buffer::Ptr rtp,bool is_key = false) = 0;
xiongziliang committed
29 30

protected:
ziyue committed
31
    void onWrite(std::shared_ptr<toolkit::Buffer> buffer, uint64_t stamp, bool key_pos) override;
xiongziliang committed
32 33 34 35 36

private:
    std::shared_ptr<CommonRtpEncoder> _rtp_encoder;
};

37
}//namespace mediakit
38

39 40
#endif //ENABLE_RTPPROXY
#endif //ZLMEDIAKIT_PSENCODER_H