OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/rtp_sender/rtp_sender.h" | 5 #include "media/cast/transport/rtp_sender/rtp_sender.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
9 #include "media/cast/cast_defines.h" | |
10 #include "media/cast/net/pacing/paced_sender.h" | |
11 #include "media/cast/rtcp/rtcp_defines.h" | 9 #include "media/cast/rtcp/rtcp_defines.h" |
| 10 #include "media/cast/transport/cast_transport_defines.h" |
| 11 #include "media/cast/transport/pacing/paced_sender.h" |
12 #include "net/base/big_endian.h" | 12 #include "net/base/big_endian.h" |
13 | 13 |
14 namespace media { | 14 namespace media { |
15 namespace cast { | 15 namespace cast { |
| 16 namespace transport { |
16 | 17 |
17 RtpSender::RtpSender(scoped_refptr<CastEnvironment> cast_environment, | 18 RtpSender::RtpSender(scoped_refptr<CastEnvironment> cast_environment, |
18 const AudioSenderConfig* audio_config, | 19 const AudioSenderConfig* audio_config, |
19 const VideoSenderConfig* video_config, | 20 const VideoSenderConfig* video_config, |
20 PacedPacketSender* transport) | 21 PacedPacketSender* transport) |
21 : cast_environment_(cast_environment), | 22 : cast_environment_(cast_environment), |
22 config_(), | 23 config_(), |
23 transport_(transport) { | 24 transport_(transport) { |
24 // Store generic cast config and create packetizer config. | 25 // Store generic cast config and create packetizer config. |
25 DCHECK(audio_config || video_config) << "Invalid argument"; | 26 DCHECK(audio_config || video_config) << "Invalid argument"; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 base::TimeDelta time_since_last_send = now - time_sent; | 135 base::TimeDelta time_since_last_send = now - time_sent; |
135 sender_info->rtp_timestamp = rtp_timestamp + | 136 sender_info->rtp_timestamp = rtp_timestamp + |
136 time_since_last_send.InMilliseconds() * (config_.frequency / 1000); | 137 time_since_last_send.InMilliseconds() * (config_.frequency / 1000); |
137 } else { | 138 } else { |
138 sender_info->rtp_timestamp = 0; | 139 sender_info->rtp_timestamp = 0; |
139 } | 140 } |
140 sender_info->send_packet_count = packetizer_->send_packets_count(); | 141 sender_info->send_packet_count = packetizer_->send_packets_count(); |
141 sender_info->send_octet_count = packetizer_->send_octet_count(); | 142 sender_info->send_octet_count = packetizer_->send_octet_count(); |
142 } | 143 } |
143 | 144 |
| 145 } // namespace transport |
144 } // namespace cast | 146 } // namespace cast |
145 } // namespace media | 147 } // namespace media |
OLD | NEW |