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

Unified Diff: media/cast/net/cast_transport.h

Issue 1878883003: Refactor: simplify interface of SenderRtcpSession and CastTransport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
« no previous file with comments | « chrome/renderer/media/cast_transport_ipc.cc ('k') | media/cast/net/cast_transport_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/net/cast_transport.h
diff --git a/media/cast/net/cast_transport.h b/media/cast/net/cast_transport.h
index 7f37da04e8376775ecbe53dcafa3123b89735978..48fc5fe7f6eb42f196bfadb0ba839c15fd83b6f7 100644
--- a/media/cast/net/cast_transport.h
+++ b/media/cast/net/cast_transport.h
@@ -50,12 +50,30 @@ struct RtcpTimeData;
// Following the initialization of either audio or video an initialization
// status will be sent via this callback.
-typedef base::Callback<void(CastTransportStatus status)>
- CastTransportStatusCallback;
+using CastTransportStatusCallback =
+ base::Callback<void(CastTransportStatus status)>;
-typedef base::Callback<void(std::unique_ptr<std::vector<FrameEvent>>,
- std::unique_ptr<std::vector<PacketEvent>>)>
- BulkRawEventsCallback;
+using BulkRawEventsCallback =
+ base::Callback<void(std::unique_ptr<std::vector<FrameEvent>>,
+ std::unique_ptr<std::vector<PacketEvent>>)>;
+
+// Interface to handle received RTCP messages on RTP sender.
+class RtcpObserver {
+ public:
+ virtual ~RtcpObserver() {}
+
+ // Called on receiving cast message from RTP receiver.
+ virtual void OnReceivedCastMessage(const RtcpCastMessage& cast_message) = 0;
+
+ // Called on receiving Rtt message from RTP receiver.
+ virtual void OnReceivedRtt(base::TimeDelta round_trip_time) = 0;
+
+ // Called on receiving PLI from RTP receiver.
+ virtual void OnReceivedPli() = 0;
+
+ // Called on receiving RTP receiver logs.
+ virtual void OnReceivedReceiverLog(const RtcpReceiverLogMessage& log) {}
+};
// The application should only trigger this class from the transport thread.
class CastTransport : public base::NonThreadSafe {
@@ -93,13 +111,9 @@ class CastTransport : public base::NonThreadSafe {
// Encoded frames cannot be transmitted until the relevant initialize method
// is called.
virtual void InitializeAudio(const CastTransportRtpConfig& config,
- const RtcpCastMessageCallback& cast_message_cb,
- const RtcpRttCallback& rtt_cb,
- const RtcpPliCallback& pli_cb) = 0;
+ std::unique_ptr<RtcpObserver> rtcp_observer) {}
virtual void InitializeVideo(const CastTransportRtpConfig& config,
- const RtcpCastMessageCallback& cast_message_cb,
- const RtcpRttCallback& rtt_cb,
- const RtcpPliCallback& pli_cb) = 0;
+ std::unique_ptr<RtcpObserver> rtcp_observer) {}
// Encrypt, packetize and transmit |frame|. |ssrc| must refer to a
// a channel already established with InitializeAudio / InitializeVideo.
« no previous file with comments | « chrome/renderer/media/cast_transport_ipc.cc ('k') | media/cast/net/cast_transport_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698