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

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

Issue 342003007: [Cast] Correct serialization of packet sequence number. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/transport/rtp_sender/rtp_sender.h" 5 #include "media/cast/transport/rtp_sender/rtp_sender.h"
6 6
7 #include "base/big_endian.h"
7 #include "base/logging.h" 8 #include "base/logging.h"
8 #include "base/rand_util.h" 9 #include "base/rand_util.h"
9 #include "media/cast/transport/cast_transport_defines.h" 10 #include "media/cast/transport/cast_transport_defines.h"
10 #include "media/cast/transport/pacing/paced_sender.h" 11 #include "media/cast/transport/pacing/paced_sender.h"
11 12
12 namespace media { 13 namespace media {
13 namespace cast { 14 namespace cast {
14 namespace transport { 15 namespace transport {
15 16
16 namespace { 17 namespace {
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 packets_to_resend.push_back(std::make_pair(packet_key, packet_copy)); 128 packets_to_resend.push_back(std::make_pair(packet_key, packet_copy));
128 } else if (cancel_rtx_if_not_in_list) { 129 } else if (cancel_rtx_if_not_in_list) {
129 transport_->CancelSendingPacket(it->first); 130 transport_->CancelSendingPacket(it->first);
130 } 131 }
131 } 132 }
132 transport_->ResendPackets(packets_to_resend); 133 transport_->ResendPackets(packets_to_resend);
133 } 134 }
134 } 135 }
135 136
136 void RtpSender::UpdateSequenceNumber(Packet* packet) { 137 void RtpSender::UpdateSequenceNumber(Packet* packet) {
137 uint16 new_sequence_number = packetizer_->NextSequenceNumber(); 138 // TODO(miu): This is an abstraction violation. This needs to be a part of
138 int index = 2; 139 // the overall packet (de)serialization consolidation.
139 (*packet)[index] = (static_cast<uint8>(new_sequence_number)); 140 static const int kByteOffsetToSequenceNumber = 2;
140 (*packet)[index + 1] = (static_cast<uint8>(new_sequence_number >> 8)); 141 base::BigEndianWriter big_endian_writer(
142 reinterpret_cast<char*>((&packet->front()) + kByteOffsetToSequenceNumber),
143 sizeof(uint16));
144 big_endian_writer.WriteU16(packetizer_->NextSequenceNumber());
141 } 145 }
142 146
143 } // namespace transport 147 } // namespace transport
144 } // namespace cast 148 } // namespace cast
145 } // namespace media 149 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698