Chromium Code Reviews| 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..eb42185ed72de83f4a710db0caf5cb17fbceec23 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 |
| @@ -45,14 +46,23 @@ 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() {} |
| + // Initialize audio pipeline. Encoded audio frames cannot be transmitted until |
| + // this method is called. |
| + virtual void InitializeAudio(const CastTransportAudioConfig& config) = 0; |
|
hubbe
2014/02/21 23:41:23
Can we have these two functions take a CastTranspo
mikhal1
2014/02/24 17:02:50
Sorry, but no.
These callbacks are called from the
hubbe
2014/02/25 00:37:04
Ugh, this is soooo messy, but I don't have a reall
|
| + |
| + // Initialize video pipeline. Encoded video frames cannot be transmitted until |
| + // this method is called. |
| + 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( |
| @@ -83,6 +93,7 @@ class CastTransportSender : public base::NonThreadSafe { |
| // Audio/Video RTP statistics. |
| // RTP statistics will be returned on a regular interval on the designated |
| // callback. |
| + // Must be called following initialization (InitializeAudio/InitializeVideo). |
| virtual void SubscribeAudioRtpStatsCallback( |
| const CastTransportRtpStatistics& callback) = 0; |