Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: media/cast/transport/cast_transport_sender_impl.cc

Issue 344953003: Cast: Use DSCP AF41 for all traffic if possible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dcheck Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/cast/transport/transport/udp_transport.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/transport/cast_transport_sender_impl.h" 5 #include "media/cast/transport/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 "media/cast/transport/cast_transport_config.h" 8 #include "media/cast/transport/cast_transport_config.h"
9 #include "media/cast/transport/cast_transport_defines.h" 9 #include "media/cast/transport/cast_transport_defines.h"
10 #include "net/base/net_util.h"
10 11
11 namespace media { 12 namespace media {
12 namespace cast { 13 namespace cast {
13 namespace transport { 14 namespace transport {
14 15
15 scoped_ptr<CastTransportSender> CastTransportSender::Create( 16 scoped_ptr<CastTransportSender> CastTransportSender::Create(
16 net::NetLog* net_log, 17 net::NetLog* net_log,
17 base::TickClock* clock, 18 base::TickClock* clock,
18 const net::IPEndPoint& remote_end_point, 19 const net::IPEndPoint& remote_end_point,
19 const CastTransportStatusCallback& status_callback, 20 const CastTransportStatusCallback& status_callback,
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 DCHECK(clock_); 60 DCHECK(clock_);
60 if (!raw_events_callback_.is_null()) { 61 if (!raw_events_callback_.is_null()) {
61 DCHECK(raw_events_callback_interval > base::TimeDelta()); 62 DCHECK(raw_events_callback_interval > base::TimeDelta());
62 event_subscriber_.reset(new SimpleEventSubscriber); 63 event_subscriber_.reset(new SimpleEventSubscriber);
63 logging_.AddRawEventSubscriber(event_subscriber_.get()); 64 logging_.AddRawEventSubscriber(event_subscriber_.get());
64 raw_events_timer_.Start(FROM_HERE, 65 raw_events_timer_.Start(FROM_HERE,
65 raw_events_callback_interval, 66 raw_events_callback_interval,
66 this, 67 this,
67 &CastTransportSenderImpl::SendRawEvents); 68 &CastTransportSenderImpl::SendRawEvents);
68 } 69 }
70 if (transport_) {
71 // The default DSCP value for cast is AF41. Which gives it a higher
72 // priority over other traffic.
73 transport_->SetDscp(net::DSCP_AF41);
74 }
69 } 75 }
70 76
71 CastTransportSenderImpl::~CastTransportSenderImpl() { 77 CastTransportSenderImpl::~CastTransportSenderImpl() {
72 if (event_subscriber_.get()) 78 if (event_subscriber_.get())
73 logging_.RemoveRawEventSubscriber(event_subscriber_.get()); 79 logging_.RemoveRawEventSubscriber(event_subscriber_.get());
74 } 80 }
75 81
76 void CastTransportSenderImpl::InitializeAudio( 82 void CastTransportSenderImpl::InitializeAudio(
77 const CastTransportAudioConfig& config) { 83 const CastTransportAudioConfig& config) {
78 LOG_IF(WARNING, config.rtp.config.aes_key.empty() || 84 LOG_IF(WARNING, config.rtp.config.aes_key.empty() ||
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 DCHECK(event_subscriber_.get()); 200 DCHECK(event_subscriber_.get());
195 DCHECK(!raw_events_callback_.is_null()); 201 DCHECK(!raw_events_callback_.is_null());
196 std::vector<PacketEvent> packet_events; 202 std::vector<PacketEvent> packet_events;
197 event_subscriber_->GetPacketEventsAndReset(&packet_events); 203 event_subscriber_->GetPacketEventsAndReset(&packet_events);
198 raw_events_callback_.Run(packet_events); 204 raw_events_callback_.Run(packet_events);
199 } 205 }
200 206
201 } // namespace transport 207 } // namespace transport
202 } // namespace cast 208 } // namespace cast
203 } // namespace media 209 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/cast/transport/transport/udp_transport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698