mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 04:31:37 +08:00
完善rtcp ext
This commit is contained in:
parent
cbee3210a0
commit
842257edaa
@ -458,18 +458,27 @@ size_t RtpHeader::getExtSize() const {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
auto ext_ptr = &payload + getCsrcSize();
|
auto ext_ptr = &payload + getCsrcSize();
|
||||||
uint16_t reserved = AV_RB16(ext_ptr);
|
//uint16_t reserved = AV_RB16(ext_ptr);
|
||||||
//每个ext占用4字节
|
//每个ext占用4字节
|
||||||
return AV_RB16(ext_ptr + 2) << 2;
|
return AV_RB16(ext_ptr + 2) << 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint16_t RtpHeader::getExtReserved() const{
|
||||||
|
//rtp有ext
|
||||||
|
if (!ext) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
auto ext_ptr = &payload + getCsrcSize();
|
||||||
|
return AV_RB16(ext_ptr);
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t *RtpHeader::getExtData() {
|
uint8_t *RtpHeader::getExtData() {
|
||||||
if (!ext) {
|
if (!ext) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
auto ext_ptr = &payload + getCsrcSize();
|
auto ext_ptr = &payload + getCsrcSize();
|
||||||
//多出的4个字节分别为reserved、ext_len
|
//多出的4个字节分别为reserved、ext_len
|
||||||
return ext_ptr + 4 + getExtSize();
|
return ext_ptr + 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t RtpHeader::getPayloadOffset() const {
|
size_t RtpHeader::getPayloadOffset() const {
|
||||||
|
@ -119,6 +119,8 @@ public:
|
|||||||
|
|
||||||
//返回ext字段字节长度
|
//返回ext字段字节长度
|
||||||
size_t getExtSize() const;
|
size_t getExtSize() const;
|
||||||
|
//返回ext reserved值
|
||||||
|
uint16_t getExtReserved() const;
|
||||||
//返回ext段首地址,不存在时返回nullptr
|
//返回ext段首地址,不存在时返回nullptr
|
||||||
uint8_t *getExtData();
|
uint8_t *getExtData();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user