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 #include "media/cast/net/cast_transport_sender_impl.h" | 5 #include "media/cast/net/cast_transport_sender_impl.h" |
6 | 6 |
7 #include "base/single_thread_task_runner.h" | 7 #include "base/single_thread_task_runner.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "media/cast/net/cast_transport_config.h" | 9 #include "media/cast/net/cast_transport_config.h" |
10 #include "media/cast/net/cast_transport_defines.h" | 10 #include "media/cast/net/cast_transport_defines.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 } | 99 } |
100 if (transport_) { | 100 if (transport_) { |
101 if (options->HasKey("DSCP")) { | 101 if (options->HasKey("DSCP")) { |
102 // The default DSCP value for cast is AF41. Which gives it a higher | 102 // The default DSCP value for cast is AF41. Which gives it a higher |
103 // priority over other traffic. | 103 // priority over other traffic. |
104 transport_->SetDscp(net::DSCP_AF41); | 104 transport_->SetDscp(net::DSCP_AF41); |
105 } | 105 } |
106 transport_->StartReceiving( | 106 transport_->StartReceiving( |
107 base::Bind(&CastTransportSenderImpl::OnReceivedPacket, | 107 base::Bind(&CastTransportSenderImpl::OnReceivedPacket, |
108 weak_factory_.GetWeakPtr())); | 108 weak_factory_.GetWeakPtr())); |
| 109 int wifi_options = 0; |
| 110 if (options->HasKey("disable_wifi_scan")) { |
| 111 wifi_options |= net::WIFI_OPTIONS_DISABLE_SCAN; |
| 112 } |
| 113 if (options->HasKey("media_streaming_mode")) { |
| 114 wifi_options |= net::WIFI_OPTIONS_MEDIA_STREAMING_MODE; |
| 115 } |
| 116 if (wifi_options) { |
| 117 wifi_options_autoreset_ = net::SetWifiOptions(wifi_options); |
| 118 } |
109 } | 119 } |
110 } | 120 } |
111 | 121 |
112 CastTransportSenderImpl::~CastTransportSenderImpl() { | 122 CastTransportSenderImpl::~CastTransportSenderImpl() { |
113 if (event_subscriber_.get()) | 123 if (event_subscriber_.get()) |
114 logging_.RemoveRawEventSubscriber(event_subscriber_.get()); | 124 logging_.RemoveRawEventSubscriber(event_subscriber_.get()); |
115 } | 125 } |
116 | 126 |
117 void CastTransportSenderImpl::InitializeAudio( | 127 void CastTransportSenderImpl::InitializeAudio( |
118 const CastTransportRtpConfig& config, | 128 const CastTransportRtpConfig& config, |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 // 2. Specifies a deduplication window. For video this would be the most | 393 // 2. Specifies a deduplication window. For video this would be the most |
384 // recent RTT. For audio there is no deduplication. | 394 // recent RTT. For audio there is no deduplication. |
385 ResendPackets(ssrc, | 395 ResendPackets(ssrc, |
386 cast_message.missing_frames_and_packets, | 396 cast_message.missing_frames_and_packets, |
387 true, | 397 true, |
388 dedup_info); | 398 dedup_info); |
389 } | 399 } |
390 | 400 |
391 } // namespace cast | 401 } // namespace cast |
392 } // namespace media | 402 } // namespace media |
OLD | NEW |