重写rtp框架

This commit is contained in:
xiongziliang
2021-01-31 19:19:24 +08:00
parent 5175c52abe
commit 070bf19cb5
21 changed files with 395 additions and 322 deletions

View File

@@ -35,8 +35,9 @@ bool GB28181Process::inputRtp(bool, const char *data, size_t data_len) {
}
void GB28181Process::onRtpSorted(const RtpPacket::Ptr &rtp, int) {
auto pt = rtp->getHeader()->pt;
if (!_rtp_decoder) {
switch (rtp->PT) {
switch (pt) {
case 98: {
//H264负载
_rtp_decoder = std::make_shared<H264RtpDecoder>();
@@ -44,8 +45,8 @@ void GB28181Process::onRtpSorted(const RtpPacket::Ptr &rtp, int) {
break;
}
default: {
if (rtp->PT != 33 && rtp->PT != 96) {
WarnL << "rtp payload type未识别(" << (int) rtp->PT << "),已按ts或ps负载处理";
if (pt != 33 && pt != 96) {
WarnL << "rtp payload type未识别(" << (int) pt << "),已按ts或ps负载处理";
}
//ts或ps负载
_rtp_decoder = std::make_shared<CommonRtpDecoder>(CodecInvalid, 32 * 1024);