Index: media/cast/transport/cast_transport_sender.h |
diff --git a/media/cast/transport/cast_transport_sender.h b/media/cast/transport/cast_transport_sender.h |
index 2e214bf0d141ff69911a363522d0b3a594dec51b..5c523093402387533b273fceae2e65af32d7c131 100644 |
--- a/media/cast/transport/cast_transport_sender.h |
+++ b/media/cast/transport/cast_transport_sender.h |
@@ -5,7 +5,6 @@ |
// This is the main interface for the cast transport sender. The cast sender |
// handles the cast pipeline from encoded frames (both audio and video), to |
// encryption, packetization and transport. |
-// All configurations are done at creation. |
// Construction of the Cast Sender and the Cast Transport Sender should be done |
// in the following order: |
@@ -13,6 +12,8 @@ |
// 2. Create CastSender (accepts CastTransportSender as an input). |
// 3. Call CastTransportSender::SetPacketReceiver to ensure that the packets |
// received by the CastTransportSender will be sent to the CastSender. |
+// 4. Initialize audio and/or video. |
+// Steps 3 & 4 can be done interchangeably. |
// Destruction: The CastTransportSender is assumed to be valid as long as the |
// CastSender is alive. Therefore the CastSender should be destructed before the |
@@ -35,6 +36,8 @@ namespace media { |
namespace cast { |
namespace transport { |
+// Following the initialization of either audio or video an initialization |
+// status will be sent via this callback. |
typedef base::Callback<void(CastTransportStatus status)> |
CastTransportStatusCallback; |
@@ -45,14 +48,22 @@ typedef base::Callback<void(const RtcpSenderInfo& sender_info, |
// The application should only trigger this class from the transport thread. |
class CastTransportSender : public base::NonThreadSafe { |
public: |
- static CastTransportSender* CreateCastTransportSender( |
+ static scoped_ptr<CastTransportSender> Create( |
base::TickClock* clock, |
- const CastTransportConfig& config, |
+ const net::IPEndPoint& local_end_point, |
+ const net::IPEndPoint& remote_end_point, |
const CastTransportStatusCallback& status_callback, |
const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner); |
virtual ~CastTransportSender() {} |
+ // Audio/Video initialization. |
+ // Encoded frames cannot be transmitted until the relevant initialize method |
+ // is called. |
+ virtual void InitializeAudio(const CastTransportAudioConfig& config) = 0; |
+ |
+ virtual void InitializeVideo(const CastTransportVideoConfig& config) = 0; |
+ |
// Sets the Cast packet receiver. Should be called after creation on the |
// Cast sender. Packets won't be received until this function is called. |
virtual void SetPacketReceiver( |
@@ -80,9 +91,9 @@ class CastTransportSender : public base::NonThreadSafe { |
bool is_audio, |
const MissingFramesAndPacketsMap& missing_packets) = 0; |
- // Audio/Video RTP statistics. |
// RTP statistics will be returned on a regular interval on the designated |
// callback. |
+ // Must be called after initialization of the corresponding A/V pipeline. |
virtual void SubscribeAudioRtpStatsCallback( |
const CastTransportRtpStatistics& callback) = 0; |