新增配置项指定H264 rtp打包是否优先采用stap-a模式 (#2582)

H264 rtp打包模式是否采用stap-a模式(为了在老版本浏览器上兼容webrtc)还是采用Single NAL unit packet
per H.264 模式 有些老的rtsp设备不支持stap-a rtp,设置此配置为0可提高兼容性
This commit is contained in:
夏楚
2023-06-26 10:04:16 +08:00
committed by GitHub
parent 24d210f61d
commit db8e9182cc
5 changed files with 32 additions and 10 deletions

View File

@@ -28,7 +28,7 @@ public:
using Ptr = std::shared_ptr<H264RtpDecoder>;
H264RtpDecoder();
~H264RtpDecoder() {}
~H264RtpDecoder() override = default;
/**
* 输入264 rtp包
@@ -77,9 +77,10 @@ public:
uint32_t sample_rate = 90000,
uint8_t pt = 96,
uint8_t interleaved = TrackVideo * 2);
~H264RtpEncoder() {}
/**
~H264RtpEncoder() override = default;
/**
* 输入264帧
* @param frame 帧数据,必须
*/
@@ -96,6 +97,8 @@ private:
void packRtp(const char *data, size_t len, uint64_t pts, bool is_mark, bool gop_pos);
void packRtpFu(const char *data, size_t len, uint64_t pts, bool is_mark, bool gop_pos);
void packRtpStapA(const char *data, size_t len, uint64_t pts, bool is_mark, bool gop_pos);
void packRtpSingleNalu(const char *data, size_t len, uint64_t pts, bool is_mark, bool gop_pos);
void packRtpSmallFrame(const char *data, size_t len, uint64_t pts, bool is_mark, bool gop_pos);
private:
Frame::Ptr _sps;