OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This class maintains a send transport for audio and video in a Cast | 5 // This class maintains a send transport for audio and video in a Cast |
6 // Streaming session. | 6 // Streaming session. |
7 // Audio, video frames and RTCP messages are submitted to this object | 7 // Audio, video frames and RTCP messages are submitted to this object |
8 // and then packetized and paced to the underlying UDP socket. | 8 // and then packetized and paced to the underlying UDP socket. |
9 // | 9 // |
10 // The hierarchy of send transport in a Cast Streaming session: | 10 // The hierarchy of send transport in a Cast Streaming session: |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 class CastTransportSenderImpl : public CastTransportSender { | 49 class CastTransportSenderImpl : public CastTransportSender { |
50 public: | 50 public: |
51 // |external_transport| is only used for testing. | 51 // |external_transport| is only used for testing. |
52 // |raw_events_callback|: Raw events will be returned on this callback | 52 // |raw_events_callback|: Raw events will be returned on this callback |
53 // which will be invoked every |raw_events_callback_interval|. | 53 // which will be invoked every |raw_events_callback_interval|. |
54 // This can be a null callback, i.e. if user is not interested in raw events. | 54 // This can be a null callback, i.e. if user is not interested in raw events. |
55 // |raw_events_callback_interval|: This can be |base::TimeDelta()| if | 55 // |raw_events_callback_interval|: This can be |base::TimeDelta()| if |
56 // |raw_events_callback| is a null callback. | 56 // |raw_events_callback| is a null callback. |
57 // |options| contains optional settings for the transport, possible | 57 // |options| contains optional settings for the transport, possible |
58 // keys are: | 58 // keys are: |
59 // "DSCP" (value doesn't matter) - turns DSCP on | 59 // "DSCP" (value ignored) - turns DSCP on |
60 // "pacer_target_burst_size": int - specifies how many packets to send | 60 // "pacer_target_burst_size": int - specifies how many packets to send |
61 // per 10 ms ideally. | 61 // per 10 ms ideally. |
62 // "pacer_max_burst_size": int - specifies how many pakcets to send | 62 // "pacer_max_burst_size": int - specifies how many pakcets to send |
63 // per 10 ms, max | 63 // per 10 ms, max |
| 64 // "disable_wifi_scan" (value ignored) - disable wifi scans while streaming |
| 65 // "media_streaming_mode" (value ignored) - turn media streaming mode on |
| 66 // Note, these options may be ignored on some platforms. |
64 CastTransportSenderImpl( | 67 CastTransportSenderImpl( |
65 net::NetLog* net_log, | 68 net::NetLog* net_log, |
66 base::TickClock* clock, | 69 base::TickClock* clock, |
67 const net::IPEndPoint& remote_end_point, | 70 const net::IPEndPoint& remote_end_point, |
68 scoped_ptr<base::DictionaryValue> options, | 71 scoped_ptr<base::DictionaryValue> options, |
69 const CastTransportStatusCallback& status_callback, | 72 const CastTransportStatusCallback& status_callback, |
70 const BulkRawEventsCallback& raw_events_callback, | 73 const BulkRawEventsCallback& raw_events_callback, |
71 base::TimeDelta raw_events_callback_interval, | 74 base::TimeDelta raw_events_callback_interval, |
72 const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner, | 75 const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner, |
73 PacketSender* external_transport); | 76 PacketSender* external_transport); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 scoped_ptr<SimpleEventSubscriber> event_subscriber_; | 161 scoped_ptr<SimpleEventSubscriber> event_subscriber_; |
159 | 162 |
160 BulkRawEventsCallback raw_events_callback_; | 163 BulkRawEventsCallback raw_events_callback_; |
161 base::TimeDelta raw_events_callback_interval_; | 164 base::TimeDelta raw_events_callback_interval_; |
162 | 165 |
163 // Right after a frame is sent we record the number of bytes sent to the | 166 // Right after a frame is sent we record the number of bytes sent to the |
164 // socket. We record the corresponding bytes sent for the most recent ACKed | 167 // socket. We record the corresponding bytes sent for the most recent ACKed |
165 // audio packet. | 168 // audio packet. |
166 int64 last_byte_acked_for_audio_; | 169 int64 last_byte_acked_for_audio_; |
167 | 170 |
| 171 scoped_ptr<net::ScopedWifiOptions> wifi_options_autoreset_; |
| 172 |
168 base::WeakPtrFactory<CastTransportSenderImpl> weak_factory_; | 173 base::WeakPtrFactory<CastTransportSenderImpl> weak_factory_; |
169 | 174 |
170 DISALLOW_COPY_AND_ASSIGN(CastTransportSenderImpl); | 175 DISALLOW_COPY_AND_ASSIGN(CastTransportSenderImpl); |
171 }; | 176 }; |
172 | 177 |
173 } // namespace cast | 178 } // namespace cast |
174 } // namespace media | 179 } // namespace media |
175 | 180 |
176 #endif // MEDIA_CAST_NET_CAST_TRANSPORT_IMPL_H_ | 181 #endif // MEDIA_CAST_NET_CAST_TRANSPORT_IMPL_H_ |
OLD | NEW |