From 6d3eb861b8b66e12131ee0156e73182383e3b815 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Fri, 20 Sep 2019 12:55:47 +0200 Subject: [PATCH] Implemented RTP HEVC Aggregation Packets --- lib/rtp.cpp | 13 ++++++++++++- src/output/output_rtsp.cpp | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/rtp.cpp b/lib/rtp.cpp index 18cc0e1f..c36dfa49 100644 --- a/lib/rtp.cpp +++ b/lib/rtp.cpp @@ -703,7 +703,18 @@ namespace RTP{ } uint8_t nalType = (pl[0] & 0x7E) >> 1; if (nalType == 48){ - ERROR_MSG("AP not supported yet"); + unsigned int pos = 2; + while (pos + 2 < plSize){ + unsigned int pLen = Bit::btohs(pl + pos); + VERYHIGH_MSG("AP Packet of %ub and type %s", pLen, h265::typeToStr((pl[pos+2]&0x7E) >> 1)); + if (packBuffer.allocate(4 + pLen)){ + Bit::htobl(packBuffer, pLen); // size-prepend + memcpy(packBuffer + 4, pl + pos + 2, pLen); + handleHEVCSingle(msTime, packBuffer, pLen + 4, h265::isKeyframe(pl + pos + 2, pLen)); + } + pos += 2 + pLen; + } + return; }else if (nalType == 49){ DONTEVEN_MSG("H265 Fragmentation Unit"); // No length yet? Check for start bit. Ignore rest. diff --git a/src/output/output_rtsp.cpp b/src/output/output_rtsp.cpp index befbd925..1e629c9c 100644 --- a/src/output/output_rtsp.cpp +++ b/src/output/output_rtsp.cpp @@ -384,7 +384,7 @@ namespace Mist{ HTTP_R.Clean(); continue; } - WARN_MSG("Unhandled command %s:\n%s", HTTP_R.method.c_str(), HTTP_R.BuildRequest().c_str()); + WARN_MSG("Unhandled command received (protocol corruption?)"); HTTP_R.Clean(); } }