Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1738)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc

Issue 2452583002: Follow standard sending CVO rtp header extension (Closed)
Patch Set: -now unused helper Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender_video.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a4a2b150b4416c451bbaedf519581d2de43d1226..87a8226d23cb12a45e46e1734017362b919f889e 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc
@@ -49,7 +49,9 @@ RTPSenderVideo::RTPSenderVideo(Clock* clock, RTPSender* rtp_sender)
: rtp_sender_(rtp_sender),
clock_(clock),
fec_bitrate_(1000, RateStatistics::kBpsScale),
- video_bitrate_(1000, RateStatistics::kBpsScale) {}
+ video_bitrate_(1000, RateStatistics::kBpsScale) {
+ encoder_checker_.Detach();
+}
RTPSenderVideo::~RTPSenderVideo() {}
@@ -228,6 +230,7 @@ bool RTPSenderVideo::SendVideo(RtpVideoCodecTypes video_type,
size_t payload_size,
const RTPFragmentationHeader* fragmentation,
const RTPVideoHeader* video_header) {
+ RTC_DCHECK_CALLED_SEQUENTIALLY(&encoder_checker_);
if (payload_size == 0)
return false;
@@ -246,9 +249,15 @@ bool RTPSenderVideo::SendVideo(RtpVideoCodecTypes video_type,
// packet in each group of packets which make up another type of frame
// (e.g. a P-Frame) only if the current value is different from the previous
// value sent.
- // Here we are adding it to every packet of every frame at this point.
- if (video_header && video_header->rotation != kVideoRotation_0)
- rtp_header->SetExtension<VideoOrientation>(video_header->rotation);
+ if (video_header) {
+ // Set rotation when key frame or when changed (to follow standard).
+ // Or when different from 0 (to follow current receiver implementation).
+ VideoRotation current_rotation = video_header->rotation;
+ if (frame_type == kVideoFrameKey || current_rotation != last_rotation_ ||
+ current_rotation != kVideoRotation_0)
+ rtp_header->SetExtension<VideoOrientation>(current_rotation);
+ last_rotation_ = current_rotation;
+ }
size_t packet_capacity = rtp_sender_->MaxPayloadLength() -
FecPacketOverhead() -
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender_video.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698