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

Unified Diff: media/cast/net/pacing/paced_sender.h

Issue 2048033003: Refactoring: CastTransport InitializeAudio/InitializeVideo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 6 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: media/cast/net/pacing/paced_sender.h
diff --git a/media/cast/net/pacing/paced_sender.h b/media/cast/net/pacing/paced_sender.h
index 15bbf012a0e44cbbb5bac155d32b71fa75c0e370..9515a98a665c7bf748255961b766d89a773c0c63 100644
--- a/media/cast/net/pacing/paced_sender.h
+++ b/media/cast/net/pacing/paced_sender.h
@@ -115,8 +115,7 @@ class PacedSender : public PacedPacketSender,
~PacedSender() final;
// These must be called before non-RTCP packets are sent.
- void RegisterAudioSsrc(uint32_t audio_ssrc);
- void RegisterVideoSsrc(uint32_t video_ssrc);
+ void RegisterSsrc(uint32_t ssrc, bool is_audio);
// Register SSRC that has a higher priority for sending. Multiple SSRCs can
// be registered.
@@ -205,8 +204,6 @@ class PacedSender : public PacedPacketSender,
PacketTransport* const transport_;
scoped_refptr<base::SingleThreadTaskRunner> transport_task_runner_;
- uint32_t audio_ssrc_;
- uint32_t video_ssrc_;
// Set of SSRCs that have higher priority. This is a vector instead of a
// set because there's only very few in it (most likely 1).
@@ -215,20 +212,17 @@ class PacedSender : public PacedPacketSender,
PacketList packet_list_;
PacketList priority_packet_list_;
- struct PacketSendRecord {
- PacketSendRecord();
- base::TimeTicks time; // Time when the packet was sent.
- int64_t last_byte_sent; // Number of bytes sent to network just after this
- // packet was sent.
- int64_t last_byte_sent_for_audio; // Number of bytes sent to network from
- // audio stream just before this packet.
- int cancel_count; // Number of times the packet was canceled (debugging).
- };
- typedef std::map<PacketKey, PacketSendRecord> PacketSendHistory;
+ struct PacketSendRecord;
+ using PacketSendHistory = std::map<PacketKey, PacketSendRecord>;
PacketSendHistory send_history_;
PacketSendHistory send_history_buffer_;
- // Records the last byte sent for payload with a specific SSRC.
- std::map<uint32_t, int64_t> last_byte_sent_;
+
+ struct RtpSession;
+ using SessionMap = std::map<uint32_t, RtpSession>;
+ SessionMap sessions_;
+
+ // Records the last byte sent for audio payload.
+ int64_t last_byte_sent_for_audio_;
size_t target_burst_size_;
size_t max_burst_size_;
@@ -246,11 +240,6 @@ class PacedSender : public PacedPacketSender,
bool has_reached_upper_bound_once_;
- // Tracks recently-logged RTP timestamps so that it can expand the truncated
- // values found in packets.
- RtpTimeTicks last_logged_audio_rtp_timestamp_;
- RtpTimeTicks last_logged_video_rtp_timestamp_;
-
// NOTE: Weak pointers must be invalidated before all other member variables.
base::WeakPtrFactory<PacedSender> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698