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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.cc

Issue 1493403003: modules/rtp_rtcp/include folder cleared of lint warnings (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years 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
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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 last_received_timestamp_ = 0; 269 last_received_timestamp_ = 0;
270 last_received_sequence_number_ = 0; 270 last_received_sequence_number_ = 0;
271 last_received_frame_time_ms_ = -1; 271 last_received_frame_time_ms_ = -1;
272 272
273 // Do we have a SSRC? Then the stream is restarted. 273 // Do we have a SSRC? Then the stream is restarted.
274 if (ssrc_ != 0) { 274 if (ssrc_ != 0) {
275 // Do we have the same codec? Then re-initialize coder. 275 // Do we have the same codec? Then re-initialize coder.
276 if (rtp_header.payloadType == last_received_payload_type) { 276 if (rtp_header.payloadType == last_received_payload_type) {
277 re_initialize_decoder = true; 277 re_initialize_decoder = true;
278 278
279 Payload* payload; 279 const Payload* payload = rtp_payload_registry_->PayloadTypeToPayload(
280 if (!rtp_payload_registry_->PayloadTypeToPayload( 280 rtp_header.payloadType);
281 rtp_header.payloadType, payload)) { 281 if (!payload) {
282 return; 282 return;
283 } 283 }
284 assert(payload);
285 payload_name[RTP_PAYLOAD_NAME_SIZE - 1] = 0; 284 payload_name[RTP_PAYLOAD_NAME_SIZE - 1] = 0;
286 strncpy(payload_name, payload->name, RTP_PAYLOAD_NAME_SIZE - 1); 285 strncpy(payload_name, payload->name, RTP_PAYLOAD_NAME_SIZE - 1);
287 if (payload->audio) { 286 if (payload->audio) {
288 channels = payload->typeSpecific.Audio.channels; 287 channels = payload->typeSpecific.Audio.channels;
289 rate = payload->typeSpecific.Audio.rate; 288 rate = payload->typeSpecific.Audio.rate;
290 } 289 }
291 } 290 }
292 } 291 }
293 ssrc_ = rtp_header.ssrc; 292 ssrc_ = rtp_header.ssrc;
294 } 293 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 357
359 rtp_media_receiver_->CheckPayloadChanged( 358 rtp_media_receiver_->CheckPayloadChanged(
360 payload_type, specific_payload, 359 payload_type, specific_payload,
361 &should_discard_changes); 360 &should_discard_changes);
362 361
363 if (should_discard_changes) { 362 if (should_discard_changes) {
364 is_red = false; 363 is_red = false;
365 return 0; 364 return 0;
366 } 365 }
367 366
368 Payload* payload; 367 const Payload* payload =
369 if (!rtp_payload_registry_->PayloadTypeToPayload(payload_type, payload)) { 368 rtp_payload_registry_->PayloadTypeToPayload(payload_type);
369 if (!payload) {
370 // Not a registered payload type. 370 // Not a registered payload type.
371 return -1; 371 return -1;
372 } 372 }
373 assert(payload);
374 payload_name[RTP_PAYLOAD_NAME_SIZE - 1] = 0; 373 payload_name[RTP_PAYLOAD_NAME_SIZE - 1] = 0;
375 strncpy(payload_name, payload->name, RTP_PAYLOAD_NAME_SIZE - 1); 374 strncpy(payload_name, payload->name, RTP_PAYLOAD_NAME_SIZE - 1);
376 375
377 rtp_payload_registry_->set_last_received_payload_type(payload_type); 376 rtp_payload_registry_->set_last_received_payload_type(payload_type);
378 377
379 re_initialize_decoder = true; 378 re_initialize_decoder = true;
380 379
381 rtp_media_receiver_->SetLastMediaSpecificPayload(payload->typeSpecific); 380 rtp_media_receiver_->SetLastMediaSpecificPayload(payload->typeSpecific);
382 rtp_media_receiver_->GetLastMediaSpecificPayload(specific_payload); 381 rtp_media_receiver_->GetLastMediaSpecificPayload(specific_payload);
383 382
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 // implementations might have CSRC 0 as a valid value. 480 // implementations might have CSRC 0 as a valid value.
482 if (num_csrcs_diff > 0) { 481 if (num_csrcs_diff > 0) {
483 cb_rtp_feedback_->OnIncomingCSRCChanged(0, true); 482 cb_rtp_feedback_->OnIncomingCSRCChanged(0, true);
484 } else if (num_csrcs_diff < 0) { 483 } else if (num_csrcs_diff < 0) {
485 cb_rtp_feedback_->OnIncomingCSRCChanged(0, false); 484 cb_rtp_feedback_->OnIncomingCSRCChanged(0, false);
486 } 485 }
487 } 486 }
488 } 487 }
489 488
490 } // namespace webrtc 489 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_payload_registry_unittest.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698