Chromium Code Reviews| Index: media/cast/net/cast_transport_sender_impl.h |
| diff --git a/media/cast/net/cast_transport_sender_impl.h b/media/cast/net/cast_transport_sender_impl.h |
| index 53f8694dfe0b51354ec3c57b8efd3a618dc66e71..beecc66563b9b1ec35f5ee96e535bb6208cb7bda 100644 |
| --- a/media/cast/net/cast_transport_sender_impl.h |
| +++ b/media/cast/net/cast_transport_sender_impl.h |
| @@ -55,42 +55,13 @@ class UdpTransport; |
| class CastTransportSenderImpl : public CastTransportSender { |
| public: |
| // |external_transport| is only used for testing. |
| - // |raw_events_callback|: Raw events will be returned on this callback |
| - // which will be invoked every |raw_events_callback_interval|. |
| - // This can be a null callback, i.e. if user is not interested in raw events. |
| - // |raw_events_callback_interval|: This can be |base::TimeDelta()| if |
| - // |raw_events_callback| is a null callback. |
| - // |options| contains optional settings for the transport, possible |
| - // keys are: |
| - // "DSCP" (value ignored) |
| - // - Turns DSCP on (higher IP Precedence and Type of Service). |
| - // "disable_non_blocking_io" (value ignored) |
| - // - Windows only. Turns off non-blocking IO for the socket. |
| - // Note: Non-blocking IO is, by default, enabled on all platforms. |
| - // "pacer_target_burst_size": int |
| - // - Specifies how many packets to send per 10 ms ideally. |
| - // "pacer_max_burst_size": int |
| - // - Specifies how many pakcets to send per 10 ms, maximum. |
| - // "send_buffer_min_size": int |
| - // - Specifies the minimum socket send buffer size. |
| - // "disable_wifi_scan" (value ignored) |
| - // - Disable wifi scans while streaming. |
| - // "media_streaming_mode" (value ignored) |
| - // - Turn media streaming mode on. |
| - // Note, these options may be ignored on some platforms. |
| - // TODO(hubbe): Too many callbacks, replace with an interface. |
| - // http://crbug.com/557477 |
| CastTransportSenderImpl( |
| - net::NetLog* net_log, |
| - base::TickClock* clock, |
| - const net::IPEndPoint& local_end_point, |
| - const net::IPEndPoint& remote_end_point, |
| + base::TickClock* clock, // Owned by the caller. |
| + const UdpTransportParams& upd_transport_params, |
| + base::TimeDelta logging_flush_interval, |
| scoped_ptr<base::DictionaryValue> options, |
| - const CastTransportStatusCallback& status_callback, |
| - const BulkRawEventsCallback& raw_events_callback, |
| - base::TimeDelta raw_events_callback_interval, |
| + scoped_ptr<Client> client, |
| const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner, |
| - const PacketReceiverCallback& packet_callback, |
| PacketSender* external_transport); |
| ~CastTransportSenderImpl() final; |
| @@ -143,8 +114,9 @@ class CastTransportSenderImpl : public CastTransportSender { |
| bool cancel_rtx_if_not_in_list, |
| const DedupInfo& dedup_info); |
| - // If |raw_events_callback_| is non-null, calls it with events collected |
| - // in |recent_frame_events_| and |recent_packet_events_| since last call. |
| + // If |logging_flush_interval| is not |base::TimeDelta|, calls it with events |
|
miu
2016/01/16 02:28:42
nit: It would be sufficient to just say, "If |logg
xjz
2016/01/21 19:16:27
Done.
|
| + // collected in |logging_flush_interval| and |recent_packet_events_| since |
| + // last call. |
| void SendRawEvents(); |
| // Called when a packet is received. |
| @@ -159,12 +131,17 @@ class CastTransportSenderImpl : public CastTransportSender { |
| const RtcpCastMessageCallback& cast_message_cb, |
| const RtcpCastMessage& cast_message); |
| + // Used as status callback to create udp transport. |
|
miu
2016/01/16 02:28:42
s/udp transport/UdpTransport/
xjz
2016/01/21 19:16:27
Done.
|
| + void OnStatusChanged(CastTransportStatus status); |
| + |
| + scoped_ptr<Client> transport_client_; |
|
miu
2016/01/16 02:28:42
Please preserve ordering (same order here as args)
xjz
2016/01/21 19:16:27
Done.
|
| base::TickClock* clock_; // Not owned by this class. |
|
miu
2016/01/16 02:28:42
Please add const here too: base::TickClock* const
xjz
2016/01/21 19:16:27
Done.
|
| - CastTransportStatusCallback status_callback_; |
| - scoped_refptr<base::SingleThreadTaskRunner> transport_task_runner_; |
| + const scoped_refptr<base::SingleThreadTaskRunner> transport_task_runner_; |
| + const base::TimeDelta logging_flush_interval_; |
| - // FrameEvents and PacketEvents pending delivery via |raw_events_callback_|. |
| - // Do not add elements to these when |raw_events_callback_.is_null()|. |
| + // FrameEvents and PacketEvents pending delivery via raw events callback. |
| + // Do not add elements to these when |logging_flush_interval| is |
| + // |base::TimeDelta()|. |
| std::vector<FrameEvent> recent_frame_events_; |
| std::vector<PacketEvent> recent_packet_events_; |
| @@ -172,7 +149,7 @@ class CastTransportSenderImpl : public CastTransportSender { |
| scoped_ptr<UdpTransport> transport_; |
| // Packet sender that performs pacing. |
| - PacedSender pacer_; |
| + scoped_ptr<PacedSender> pacer_; |
|
miu
2016/01/16 02:28:42
I don't see why this was changed. Unless I'm miss
xjz
2016/01/21 19:16:27
This was changed because this can only be initiali
|
| // Packetizer for audio and video frames. |
| scoped_ptr<RtpSender> audio_sender_; |
| @@ -189,9 +166,6 @@ class CastTransportSenderImpl : public CastTransportSender { |
| TransportEncryptionHandler audio_encryptor_; |
| TransportEncryptionHandler video_encryptor_; |
| - BulkRawEventsCallback raw_events_callback_; |
| - base::TimeDelta raw_events_callback_interval_; |
| - |
| // Right after a frame is sent we record the number of bytes sent to the |
| // socket. We record the corresponding bytes sent for the most recent ACKed |
| // audio packet. |
| @@ -200,10 +174,6 @@ class CastTransportSenderImpl : public CastTransportSender { |
| // Packets that don't match these ssrcs are ignored. |
| std::set<uint32_t> valid_ssrcs_; |
| - // Called with incoming packets. (Unless they match the |
| - // channels created by Initialize{Audio,Video}. |
| - PacketReceiverCallback packet_callback_; |
| - |
| scoped_ptr<net::ScopedWifiOptions> wifi_options_autoreset_; |
| base::WeakPtrFactory<CastTransportSenderImpl> weak_factory_; |