Index: webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc |
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc |
index 0bf95b7fe4b14f10d60d4cea44504d5a2083ee0e..812dbf1f55398377798991eb7d7cf0047eef5527 100644 |
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc |
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc |
@@ -198,7 +198,7 @@ size_t RTPSenderVideo::FECPacketOverhead() const { |
// from an FEC viewpoint, they are part of the payload to be protected. |
// (The base RTP header is already protected by the FEC header.) |
return ForwardErrorCorrection::PacketOverhead() + REDForFECHeaderLength + |
- (_rtpSender.RTPHeaderLength() - kRtpHeaderSize); |
+ (_rtpSender.RtpHeaderMaxLength() - kRtpHeaderSize); |
} |
return 0; |
} |
@@ -248,7 +248,7 @@ int32_t RTPSenderVideo::SendVideo(const RtpVideoCodecTypes videoType, |
cvo_mode = _rtpSender.ActivateCVORtpHeaderExtension(); |
} |
- uint16_t rtp_header_length = _rtpSender.RTPHeaderLength(); |
+ int rtp_header_length = _rtpSender.RtpHeaderCurrentLength(); |
size_t payload_bytes_to_send = payloadSize; |
const uint8_t* data = payloadData; |
@@ -265,15 +265,19 @@ int32_t RTPSenderVideo::SendVideo(const RtpVideoCodecTypes videoType, |
while (!last) { |
uint8_t dataBuffer[IP_PACKET_SIZE] = {0}; |
size_t payload_bytes_in_packet = 0; |
- if (!packetizer->NextPacket(&dataBuffer[rtp_header_length], |
- &payload_bytes_in_packet, &last)) { |
+ |
+ // Note that RTP header size is dynamically computed since there may be |
+ // an optional RTP header extension. |
+ if (!packetizer->NextPacket( |
+ &dataBuffer[_rtpSender.RtpHeaderCurrentLength()], |
+ &payload_bytes_in_packet, &last)) { |
return -1; |
} |
// Write RTP header. |
- // Set marker bit true if this is the last packet in frame. |
_rtpSender.BuildRTPheader( |
danilchap
2016/06/02 12:12:34
playout_delay_oracle_ is not protected by crit_
Th
Irfan
2016/06/02 18:15:53
Thanks for pointing this out. With the updated cha
|
dataBuffer, payloadType, last, captureTimeStamp, capture_time_ms); |
+ |
// According to |
// http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/ |
// ts_126114v120700p.pdf Section 7.4.5: |