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

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

Issue 2999063002: Add flag enabling more packets to be retransmittable. (Closed)
Patch Set: Removed GetStorageType and ProtectionType from packetizers. Refactorings. Addressed comments. Created 3 years, 4 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
Index: webrtc/modules/rtp_rtcp/source/rtp_sender_video.h
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender_video.h b/webrtc/modules/rtp_rtcp/source/rtp_sender_video.h
index 9fb4648b82e2138e2bfdb0e75e2d87a816710b37..ed5f1aa7e18db6b28708f97606bd2e993e60e5af 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender_video.h
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender_video.h
@@ -11,9 +11,8 @@
#ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_
#define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_
-#include <list>
+#include <map>
#include <memory>
-#include <vector>
#include "webrtc/common_types.h"
#include "webrtc/modules/rtp_rtcp/include/flexfec_sender.h"
@@ -32,10 +31,13 @@
#include "webrtc/typedefs.h"
namespace webrtc {
+class RtpPacketizer;
class RtpPacketToSend;
class RTPSenderVideo {
public:
+ static constexpr int64_t kTLRateWindowSizeMs = 2500;
+
RTPSenderVideo(Clock* clock,
RTPSender* rtpSender,
FlexfecSender* flexfec_sender);
@@ -55,7 +57,8 @@ class RTPSenderVideo {
const uint8_t* payload_data,
size_t payload_size,
const RTPFragmentationHeader* fragmentation,
- const RTPVideoHeader* video_header);
+ const RTPVideoHeader* video_header,
+ int64_t expected_retransmission_time_ms);
void SetVideoCodecType(RtpVideoCodecTypes type);
@@ -76,7 +79,22 @@ class RTPSenderVideo {
int SelectiveRetransmissions() const;
void SetSelectiveRetransmissions(uint8_t settings);
+ protected:
+ uint8_t GetTemporalId(const RTPVideoHeader& header) const;
danilchap 2017/09/04 09:03:05 look like this one can be static or free function
sprang_webrtc 2017/09/04 11:09:28 Made it static. Call from unit test.
+ StorageType GetStorageType(uint8_t temporal_id,
+ int32_t retransmission_settings,
+ RtpPacketizer* packetizer,
+ int64_t expected_retransmission_time);
+
private:
+ struct TemporalLayerStats {
+ TemporalLayerStats()
+ : frame_rate_fp1000s(kTLRateWindowSizeMs, 1000 * 1000),
brandtr 2017/09/04 10:29:22 Nice unit :)
sprang_webrtc 2017/09/04 11:09:28 Hehe, thanks :) Maybe I'll add a comment explicitl
+ last_frame_time(0) {}
+ RateStatistics frame_rate_fp1000s;
+ int64_t last_frame_time;
danilchap 2017/09/04 09:03:05 add _ms
sprang_webrtc 2017/09/04 11:09:28 Done.
+ };
+
size_t CalculateFecPacketOverhead() const EXCLUSIVE_LOCKS_REQUIRED(crit_);
void SendVideoPacket(std::unique_ptr<RtpPacketToSend> packet,
@@ -103,6 +121,10 @@ class RTPSenderVideo {
bool flexfec_enabled() const { return flexfec_sender_ != nullptr; }
+ bool UpdateConditionalRetransmit(uint8_t temporal_id,
+ int64_t expected_retransmission_time_ms)
+ EXCLUSIVE_LOCKS_REQUIRED(stats_crit_);
+
RTPSender* const rtp_sender_;
Clock* const clock_;
@@ -131,6 +153,10 @@ class RTPSenderVideo {
RateStatistics fec_bitrate_ GUARDED_BY(stats_crit_);
// Bitrate used for video payload and RTP headers.
RateStatistics video_bitrate_ GUARDED_BY(stats_crit_);
+
+ std::map<int, TemporalLayerStats> frame_stats_by_temporal_layer_
+ GUARDED_BY(stats_crit_);
+
OneTimeEvent first_frame_sent_;
};

Powered by Google App Engine
This is Rietveld 408576698