Commit bb5223e5 by xiongziliang

不识别的rtp payload type按照ps处理:#673

parent f9f9cde2
...@@ -37,11 +37,18 @@ bool GB28181Process::inputRtp(bool, const char *data, int data_len) { ...@@ -37,11 +37,18 @@ bool GB28181Process::inputRtp(bool, const char *data, int data_len) {
void GB28181Process::onRtpSorted(const RtpPacket::Ptr &rtp, int) { void GB28181Process::onRtpSorted(const RtpPacket::Ptr &rtp, int) {
if (!_rtp_decoder) { if (!_rtp_decoder) {
switch (rtp->PT) { switch (rtp->PT) {
case 33: case 98: {
case 96: { //H264负载
_rtp_decoder = std::make_shared<H264RtpDecoder>();
_interface->addTrack(std::make_shared<H264Track>());
break;
}
default: {
if (rtp->PT != 33 && rtp->PT != 96) {
WarnL << "rtp payload type未识别(" << (int) rtp->PT << "),已按ts或ps负载处理";
}
//ts或ps负载 //ts或ps负载
_rtp_decoder = std::make_shared<CommonRtpDecoder>(CodecInvalid, 256 * 1024); _rtp_decoder = std::make_shared<CommonRtpDecoder>(CodecInvalid, 256 * 1024);
//设置dump目录 //设置dump目录
GET_CONFIG(string, dump_dir, RtpProxy::kDumpDir); GET_CONFIG(string, dump_dir, RtpProxy::kDumpDir);
if (!dump_dir.empty()) { if (!dump_dir.empty()) {
...@@ -54,17 +61,6 @@ void GB28181Process::onRtpSorted(const RtpPacket::Ptr &rtp, int) { ...@@ -54,17 +61,6 @@ void GB28181Process::onRtpSorted(const RtpPacket::Ptr &rtp, int) {
} }
break; break;
} }
case 98: {
//H264负载
_rtp_decoder = std::make_shared<H264RtpDecoder>();
_interface->addTrack(std::make_shared<H264Track>());
break;
}
default:
WarnL << "不支持的rtp负载类型:" << (int) rtp->PT;
return;
} }
//设置frame回调 //设置frame回调
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论