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

Side by Side Diff: webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc

Issue 1168753002: Match existing type usage better. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 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
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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 static_cast<uint32_t>( 424 static_cast<uint32_t>(
425 (static_cast<double>( 425 (static_cast<double>(
426 codec_manager_.CurrentEncoder()->SampleRateHz()) / 426 codec_manager_.CurrentEncoder()->SampleRateHz()) /
427 static_cast<double>(in_frame.sample_rate_hz_))); 427 static_cast<double>(in_frame.sample_rate_hz_)));
428 expected_in_ts_ = in_frame.timestamp_; 428 expected_in_ts_ = in_frame.timestamp_;
429 } 429 }
430 430
431 431
432 if (!down_mix && !resample) { 432 if (!down_mix && !resample) {
433 // No pre-processing is required. 433 // No pre-processing is required.
434 expected_in_ts_ += in_frame.samples_per_channel_; 434 expected_in_ts_ += static_cast<uint32_t>(in_frame.samples_per_channel_);
435 expected_codec_ts_ += in_frame.samples_per_channel_; 435 expected_codec_ts_ += static_cast<uint32_t>(in_frame.samples_per_channel_);
436 *ptr_out = &in_frame; 436 *ptr_out = &in_frame;
437 return 0; 437 return 0;
438 } 438 }
439 439
440 *ptr_out = &preprocess_frame_; 440 *ptr_out = &preprocess_frame_;
441 preprocess_frame_.num_channels_ = in_frame.num_channels_; 441 preprocess_frame_.num_channels_ = in_frame.num_channels_;
442 int16_t audio[WEBRTC_10MS_PCM_AUDIO]; 442 int16_t audio[WEBRTC_10MS_PCM_AUDIO];
443 const int16_t* src_ptr_audio = in_frame.data_; 443 const int16_t* src_ptr_audio = in_frame.data_;
444 int16_t* dest_ptr_audio = preprocess_frame_.data_; 444 int16_t* dest_ptr_audio = preprocess_frame_.data_;
445 if (down_mix) { 445 if (down_mix) {
(...skipping 24 matching lines...) Expand all
470 470
471 if (preprocess_frame_.samples_per_channel_ < 0) { 471 if (preprocess_frame_.samples_per_channel_ < 0) {
472 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_, 472 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_,
473 "Cannot add 10 ms audio, resampling failed"); 473 "Cannot add 10 ms audio, resampling failed");
474 return -1; 474 return -1;
475 } 475 }
476 preprocess_frame_.sample_rate_hz_ = 476 preprocess_frame_.sample_rate_hz_ =
477 codec_manager_.CurrentEncoder()->SampleRateHz(); 477 codec_manager_.CurrentEncoder()->SampleRateHz();
478 } 478 }
479 479
480 expected_codec_ts_ += preprocess_frame_.samples_per_channel_; 480 expected_codec_ts_ +=
481 expected_in_ts_ += in_frame.samples_per_channel_; 481 static_cast<uint32_t>(preprocess_frame_.samples_per_channel_);
482 expected_in_ts_ += static_cast<uint32_t>(in_frame.samples_per_channel_);
482 483
483 return 0; 484 return 0;
484 } 485 }
485 486
486 ///////////////////////////////////////// 487 /////////////////////////////////////////
487 // (RED) Redundant Coding 488 // (RED) Redundant Coding
488 // 489 //
489 490
490 bool AudioCodingModuleImpl::REDStatus() const { 491 bool AudioCodingModuleImpl::REDStatus() const {
491 CriticalSectionScoped lock(acm_crit_sect_); 492 CriticalSectionScoped lock(acm_crit_sect_);
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
1257 *channels = 1; 1258 *channels = 1;
1258 break; 1259 break;
1259 #endif 1260 #endif
1260 default: 1261 default:
1261 FATAL() << "Codec type " << codec_type << " not supported."; 1262 FATAL() << "Codec type " << codec_type << " not supported.";
1262 } 1263 }
1263 return true; 1264 return true;
1264 } 1265 }
1265 1266
1266 } // namespace webrtc 1267 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698