Chromium Code Reviews| 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..baa50e476008bfd6b7ab1da2872638498b613463 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.RtpHeaderLength() - kRtpHeaderSize); |
| } |
| return 0; |
| } |
| @@ -243,12 +243,12 @@ int32_t RTPSenderVideo::SendVideo(const RtpVideoCodecTypes videoType, |
| // Register CVO rtp header extension at the first time when we receive a frame |
| // with pending rotation. |
| - RTPSenderInterface::CVOMode cvo_mode = RTPSenderInterface::kCVONone; |
| + bool video_rotation_active = false; |
| if (video_header && video_header->rotation != kVideoRotation_0) { |
| - cvo_mode = _rtpSender.ActivateCVORtpHeaderExtension(); |
| + video_rotation_active = _rtpSender.ActivateCVORtpHeaderExtension(); |
| } |
| - uint16_t rtp_header_length = _rtpSender.RTPHeaderLength(); |
| + int rtp_header_length = _rtpSender.RtpHeaderLength(); |
| size_t payload_bytes_to_send = payloadSize; |
| const uint8_t* data = payloadData; |
| @@ -265,15 +265,18 @@ int32_t RTPSenderVideo::SendVideo(const RtpVideoCodecTypes videoType, |
| while (!last) { |
| uint8_t dataBuffer[IP_PACKET_SIZE] = {0}; |
| size_t payload_bytes_in_packet = 0; |
| + |
| + // Note that RTP header size is dynamically computed since there may be |
|
danilchap
2016/06/03 09:01:37
probably should be removed now.
Irfan
2016/06/03 15:55:33
Done.
|
| + // an optional RTP header extension. |
| if (!packetizer->NextPacket(&dataBuffer[rtp_header_length], |
| &payload_bytes_in_packet, &last)) { |
| return -1; |
| } |
| // Write RTP header. |
| - // Set marker bit true if this is the last packet in frame. |
| _rtpSender.BuildRTPheader( |
| 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: |
| @@ -288,7 +291,7 @@ int32_t RTPSenderVideo::SendVideo(const RtpVideoCodecTypes videoType, |
| if (!video_header) { |
| RTC_DCHECK(!_rtpSender.IsRtpHeaderExtensionRegistered( |
| kRtpExtensionVideoRotation)); |
| - } else if (cvo_mode == RTPSenderInterface::kCVOActivated) { |
| + } else if (video_rotation_active) { |
| // Checking whether CVO header extension is registered will require taking |
| // a lock. It'll be a no-op if it's not registered. |
| // TODO(guoweis): For now, all packets sent will carry the CVO such that |