mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
添加rtp ext: av1-rtp-spec (#2609)
Co-authored-by: xia-chu <771730766@qq.com>
This commit is contained in:
parent
f55e13f9da
commit
9e8568e753
@ -94,6 +94,7 @@ uint8_t RtpExtOneByte::getId() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RtpExtOneByte::setId(uint8_t in) {
|
void RtpExtOneByte::setId(uint8_t in) {
|
||||||
|
CHECK(in < (int)RtpExtType::reserved);
|
||||||
id = in & 0x0F;
|
id = in & 0x0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,8 +144,6 @@ void appendExt(map<uint8_t, RtpExt> &ret, uint8_t *ptr, const uint8_t *end) {
|
|||||||
++ptr;
|
++ptr;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//15类型的rtp ext为保留
|
|
||||||
CHECK(ext->getId() < (uint8_t) RtpExtType::reserved);
|
|
||||||
CHECK(reinterpret_cast<uint8_t *>(ext) + Type::kMinSize <= end);
|
CHECK(reinterpret_cast<uint8_t *>(ext) + Type::kMinSize <= end);
|
||||||
CHECK(ext->getData() + ext->getSize() <= end);
|
CHECK(ext->getData() + ext->getSize() <= end);
|
||||||
ret.emplace(ext->getId(), RtpExt(ext, isOneByteExt<Type>(), reinterpret_cast<char *>(ext->getData()), ext->getSize()));
|
ret.emplace(ext->getId(), RtpExt(ext, isOneByteExt<Type>(), reinterpret_cast<char *>(ext->getData()), ext->getSize()));
|
||||||
@ -522,8 +521,13 @@ uint8_t RtpExt::getFramemarkingTID() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RtpExt::setExtId(uint8_t ext_id) {
|
void RtpExt::setExtId(uint8_t ext_id) {
|
||||||
assert(ext_id > (int) RtpExtType::padding && ext_id <= (int) RtpExtType::reserved && _ext);
|
assert(ext_id > (int) RtpExtType::padding && _ext);
|
||||||
if (_one_byte_ext) {
|
if (_one_byte_ext) {
|
||||||
|
if (ext_id >= (int)RtpExtType::reserved) {
|
||||||
|
WarnL << "One byte rtp ext can not store id " << (int)ext_id << "(" << getExtName((RtpExtType)ext_id) << ") big than 14";
|
||||||
|
clearExt();
|
||||||
|
return;
|
||||||
|
}
|
||||||
auto ptr = reinterpret_cast<RtpExtOneByte *>(_ext);
|
auto ptr = reinterpret_cast<RtpExtOneByte *>(_ext);
|
||||||
ptr->setId(ext_id);
|
ptr->setId(ext_id);
|
||||||
} else {
|
} else {
|
||||||
|
@ -34,6 +34,7 @@ namespace mediakit {
|
|||||||
XX(playout_delay, "http://www.webrtc.org/experiments/rtp-hdrext/playout-delay") \
|
XX(playout_delay, "http://www.webrtc.org/experiments/rtp-hdrext/playout-delay") \
|
||||||
XX(video_orientation, "urn:3gpp:video-orientation") \
|
XX(video_orientation, "urn:3gpp:video-orientation") \
|
||||||
XX(toffset, "urn:ietf:params:rtp-hdrext:toffset") \
|
XX(toffset, "urn:ietf:params:rtp-hdrext:toffset") \
|
||||||
|
XX(av1, "https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension") \
|
||||||
XX(encrypt, "urn:ietf:params:rtp-hdrext:encrypt")
|
XX(encrypt, "urn:ietf:params:rtp-hdrext:encrypt")
|
||||||
|
|
||||||
enum class RtpExtType : uint8_t {
|
enum class RtpExtType : uint8_t {
|
||||||
@ -41,7 +42,7 @@ enum class RtpExtType : uint8_t {
|
|||||||
#define XX(type, uri) type,
|
#define XX(type, uri) type,
|
||||||
RTP_EXT_MAP(XX)
|
RTP_EXT_MAP(XX)
|
||||||
#undef XX
|
#undef XX
|
||||||
reserved = encrypt,
|
reserved = 15,
|
||||||
};
|
};
|
||||||
|
|
||||||
class RtcMedia;
|
class RtcMedia;
|
||||||
|
Loading…
Reference in New Issue
Block a user