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

Unified Diff: media/cast/net/rtcp/sender_rtcp_session.h

Issue 1878883003: Refactor: simplify interface of SenderRtcpSession and CastTransport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/rtcp/sender_rtcp_session.h
diff --git a/media/cast/net/rtcp/sender_rtcp_session.h b/media/cast/net/rtcp/sender_rtcp_session.h
index d32a1ade86fd60014332933e4730954b97909176..2d4cdae05c577abca91e66b9643c11fb190628ff 100644
--- a/media/cast/net/rtcp/sender_rtcp_session.h
+++ b/media/cast/net/rtcp/sender_rtcp_session.h
@@ -28,22 +28,37 @@ typedef std::queue<RtcpSendTimePair> RtcpSendTimeQueue;
// receiver to maintain clock offsets and synchronize between audio and video.
//
// RTCP session on sender handles the following incoming RTCP reports
-// from receiver:
+// from receiver and passes the information to the Client:
// - Receiver reference time report: Helps with tracking largest timestamp
// seen and as a result rejecting old RTCP reports.
-// - Receiver logs: The sender receives log events from the receiver and
-// invokes a callback passed.
-// - cast message: Receives feedback from receiver on missing packets/frames
-// and last frame id received and invokes a callback passed.
+// - Receiver logs: The sender receives log events from the receiver.
+// - cast message: Receives feedback from receiver on missing packets/frames,
+// later frames received, and last frame id.
// - Last report: The receiver provides feedback on delay since last report
-// received which helps it compute round trip time and invoke a callback.
+// received which helps it compute round trip time.
+// - PLI: Receiver sends PLI when decoding error exists on ultra-low latency
+// applications.
class SenderRtcpSession : public RtcpSession {
public:
- // TODO(xjz): Simplify the interface. http://crbug.com/588275.
- SenderRtcpSession(const RtcpCastMessageCallback& cast_callback,
- const RtcpRttCallback& rtt_callback,
- const RtcpLogMessageCallback& log_callback,
- const RtcpPliCallback pli_callback,
+ // Interface to handel receiving RTCP messages from RTP receiver.
+ class Client {
miu 2016/04/15 23:14:39 This is identical to RtpSenderRtcpClient, except i
xjz 2016/04/20 01:09:03 Done. Named the interface "SenderRtcpObserver".
+ public:
+ virtual ~Client() {}
+
+ // Called to pass the cast message to the Client.
+ virtual void OnCastMessageReceived(const RtcpCastMessage& cast_message) = 0;
+
+ // Called to pass the current Rtt to the Client.
+ virtual void OnRttReceived(base::TimeDelta round_trip_time) = 0;
+
+ // Called to pass the RTP receiver logs to the Client.
+ virtual void OnReceiverLogReceived(const RtcpReceiverLogMessage& log) = 0;
+
+ // Received PLI from RTP receiver.
+ virtual void OnPliReceived() = 0;
+ };
+
+ SenderRtcpSession(std::unique_ptr<Client> client,
base::TickClock* clock, // Not owned.
PacedPacketSender* packet_sender, // Not owned.
uint32_t local_ssrc,
@@ -98,11 +113,7 @@ class SenderRtcpSession : public RtcpSession {
PacedPacketSender* packet_sender_; // Not owned.
const uint32_t local_ssrc_;
const uint32_t remote_ssrc_;
-
- const RtcpCastMessageCallback cast_callback_;
- const RtcpRttCallback rtt_callback_;
- const RtcpLogMessageCallback log_callback_;
- const RtcpPliCallback pli_callback_;
+ const std::unique_ptr<Client> sender_rtcp_client_;
// Computed from RTCP RRTR report.
base::TimeTicks largest_seen_timestamp_;

Powered by Google App Engine
This is Rietveld 408576698