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

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: 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/cast_transport.h
diff --git a/media/cast/net/cast_transport.h b/media/cast/net/cast_transport.h
index 953d61cdd4529575ea9260ab7e2b2dd221b91fd9..58d90bf403954b97fa157d3fb303bb6b969921e4 100644
--- a/media/cast/net/cast_transport.h
+++ b/media/cast/net/cast_transport.h
@@ -21,7 +21,6 @@
#include <stdint.h>
#include "base/callback.h"
-#include "base/memory/scoped_ptr.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/non_thread_safe.h"
#include "base/time/tick_clock.h"
@@ -52,10 +51,20 @@ struct RtcpTimeData;
typedef base::Callback<void(CastTransportStatus status)>
CastTransportStatusCallback;
-typedef base::Callback<void(scoped_ptr<std::vector<FrameEvent>>,
- scoped_ptr<std::vector<PacketEvent>>)>
+typedef base::Callback<void(std::unique_ptr<std::vector<FrameEvent>>,
miu 2016/04/15 23:14:39 nit: ditto on "using" instead of "typedef" syntax
xjz 2016/04/20 01:09:02 Done.
+ std::unique_ptr<std::vector<PacketEvent>>)>
BulkRawEventsCallback;
+// Interface to handle received RTCP messages on RTP sender.
+class RtpSenderRtcpClient {
+ public:
+ virtual ~RtpSenderRtcpClient() {}
+
+ virtual void OnCastMessageReceived(const RtcpCastMessage& cast_message) = 0;
+ virtual void OnRttReceived(base::TimeDelta round_trip_time) = 0;
+ virtual void OnPliReceived() = 0;
+};
+
// The application should only trigger this class from the transport thread.
class CastTransport : public base::NonThreadSafe {
public:
@@ -72,18 +81,18 @@ class CastTransport : public base::NonThreadSafe {
// the configured logging flush interval passed to
// CastTransport::Create().
virtual void OnLoggingEventsReceived(
- scoped_ptr<std::vector<FrameEvent>> frame_events,
- scoped_ptr<std::vector<PacketEvent>> packet_events) = 0;
+ std::unique_ptr<std::vector<FrameEvent>> frame_events,
+ std::unique_ptr<std::vector<PacketEvent>> packet_events) = 0;
// Called to pass RTP packets to the Client.
- virtual void ProcessRtpPacket(scoped_ptr<Packet> packet) = 0;
+ virtual void ProcessRtpPacket(std::unique_ptr<Packet> packet) = 0;
};
- static scoped_ptr<CastTransport> Create(
+ static std::unique_ptr<CastTransport> Create(
base::TickClock* clock, // Owned by the caller.
base::TimeDelta logging_flush_interval,
- scoped_ptr<Client> client,
- scoped_ptr<PacketTransport> transport,
+ std::unique_ptr<Client> client,
+ std::unique_ptr<PacketTransport> transport,
const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner);
virtual ~CastTransport() {}
@@ -91,14 +100,12 @@ class CastTransport : public base::NonThreadSafe {
// Audio/Video initialization.
// 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;
- virtual void InitializeVideo(const CastTransportRtpConfig& config,
- const RtcpCastMessageCallback& cast_message_cb,
- const RtcpRttCallback& rtt_cb,
- const RtcpPliCallback& pli_cb) = 0;
+ virtual void InitializeAudio(
+ const CastTransportRtpConfig& config,
+ std::unique_ptr<RtpSenderRtcpClient> rtcp_client) {}
+ virtual void InitializeVideo(
+ const CastTransportRtpConfig& config,
+ std::unique_ptr<RtpSenderRtcpClient> rtcp_client) {}
// Encrypt, packetize and transmit |frame|. |ssrc| must refer to a
// a channel already established with InitializeAudio / InitializeVideo.

Powered by Google App Engine
This is Rietveld 408576698