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

Side by Side Diff: webrtc/media/base/rtpdataengine.cc

Issue 2493733003: Optimize FindCodecById and ReferencedCodecsMatch (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « webrtc/media/base/codec.h ('k') | webrtc/pc/mediasession.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 packet->cdata<char>() + header_length + sizeof(kReservedSpace); 218 packet->cdata<char>() + header_length + sizeof(kReservedSpace);
219 size_t data_len = packet->size() - header_length - sizeof(kReservedSpace); 219 size_t data_len = packet->size() - header_length - sizeof(kReservedSpace);
220 220
221 if (!receiving_) { 221 if (!receiving_) {
222 LOG(LS_WARNING) << "Not receiving packet " 222 LOG(LS_WARNING) << "Not receiving packet "
223 << header.ssrc << ":" << header.seq_num 223 << header.ssrc << ":" << header.seq_num
224 << " before SetReceive(true) called."; 224 << " before SetReceive(true) called.";
225 return; 225 return;
226 } 226 }
227 227
228 DataCodec codec; 228 if (!FindCodecById(recv_codecs_, header.payload_type)) {
229 if (!FindCodecById(recv_codecs_, header.payload_type, &codec)) {
230 // For bundling, this will be logged for every message. 229 // For bundling, this will be logged for every message.
231 // So disable this logging. 230 // So disable this logging.
232 // LOG(LS_WARNING) << "Not receiving packet " 231 // LOG(LS_WARNING) << "Not receiving packet "
233 // << header.ssrc << ":" << header.seq_num 232 // << header.ssrc << ":" << header.seq_num
234 // << " (" << data_len << ")" 233 // << " (" << data_len << ")"
235 // << " because unknown payload id: " << header.payload_type; 234 // << " because unknown payload id: " << header.payload_type;
236 return; 235 return;
237 } 236 }
238 237
239 if (!GetStreamBySsrc(recv_streams_, header.ssrc)) { 238 if (!GetStreamBySsrc(recv_streams_, header.ssrc)) {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 336
338 MediaChannel::SendPacket(&packet, rtc::PacketOptions()); 337 MediaChannel::SendPacket(&packet, rtc::PacketOptions());
339 send_limiter_->Use(packet_len, now); 338 send_limiter_->Use(packet_len, now);
340 if (result) { 339 if (result) {
341 *result = SDR_SUCCESS; 340 *result = SDR_SUCCESS;
342 } 341 }
343 return true; 342 return true;
344 } 343 }
345 344
346 } // namespace cricket 345 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/base/codec.h ('k') | webrtc/pc/mediasession.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698