OLD | NEW |
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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 static_cast<uint32_t>( | 422 static_cast<uint32_t>( |
423 (static_cast<double>( | 423 (static_cast<double>( |
424 codec_manager_.CurrentEncoder()->SampleRateHz()) / | 424 codec_manager_.CurrentEncoder()->SampleRateHz()) / |
425 static_cast<double>(in_frame.sample_rate_hz_))); | 425 static_cast<double>(in_frame.sample_rate_hz_))); |
426 expected_in_ts_ = in_frame.timestamp_; | 426 expected_in_ts_ = in_frame.timestamp_; |
427 } | 427 } |
428 | 428 |
429 | 429 |
430 if (!down_mix && !resample) { | 430 if (!down_mix && !resample) { |
431 // No pre-processing is required. | 431 // No pre-processing is required. |
432 expected_in_ts_ += in_frame.samples_per_channel_; | 432 expected_in_ts_ += static_cast<uint32_t>(in_frame.samples_per_channel_); |
433 expected_codec_ts_ += in_frame.samples_per_channel_; | 433 expected_codec_ts_ += static_cast<uint32_t>(in_frame.samples_per_channel_); |
434 *ptr_out = &in_frame; | 434 *ptr_out = &in_frame; |
435 return 0; | 435 return 0; |
436 } | 436 } |
437 | 437 |
438 *ptr_out = &preprocess_frame_; | 438 *ptr_out = &preprocess_frame_; |
439 preprocess_frame_.num_channels_ = in_frame.num_channels_; | 439 preprocess_frame_.num_channels_ = in_frame.num_channels_; |
440 int16_t audio[WEBRTC_10MS_PCM_AUDIO]; | 440 int16_t audio[WEBRTC_10MS_PCM_AUDIO]; |
441 const int16_t* src_ptr_audio = in_frame.data_; | 441 const int16_t* src_ptr_audio = in_frame.data_; |
442 int16_t* dest_ptr_audio = preprocess_frame_.data_; | 442 int16_t* dest_ptr_audio = preprocess_frame_.data_; |
443 if (down_mix) { | 443 if (down_mix) { |
(...skipping 24 matching lines...) Expand all Loading... |
468 | 468 |
469 if (preprocess_frame_.samples_per_channel_ < 0) { | 469 if (preprocess_frame_.samples_per_channel_ < 0) { |
470 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_, | 470 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_, |
471 "Cannot add 10 ms audio, resampling failed"); | 471 "Cannot add 10 ms audio, resampling failed"); |
472 return -1; | 472 return -1; |
473 } | 473 } |
474 preprocess_frame_.sample_rate_hz_ = | 474 preprocess_frame_.sample_rate_hz_ = |
475 codec_manager_.CurrentEncoder()->SampleRateHz(); | 475 codec_manager_.CurrentEncoder()->SampleRateHz(); |
476 } | 476 } |
477 | 477 |
478 expected_codec_ts_ += preprocess_frame_.samples_per_channel_; | 478 expected_codec_ts_ += |
479 expected_in_ts_ += in_frame.samples_per_channel_; | 479 static_cast<uint32_t>(preprocess_frame_.samples_per_channel_); |
| 480 expected_in_ts_ += static_cast<uint32_t>(in_frame.samples_per_channel_); |
480 | 481 |
481 return 0; | 482 return 0; |
482 } | 483 } |
483 | 484 |
484 ///////////////////////////////////////// | 485 ///////////////////////////////////////// |
485 // (RED) Redundant Coding | 486 // (RED) Redundant Coding |
486 // | 487 // |
487 | 488 |
488 bool AudioCodingModuleImpl::REDStatus() const { | 489 bool AudioCodingModuleImpl::REDStatus() const { |
489 CriticalSectionScoped lock(acm_crit_sect_); | 490 CriticalSectionScoped lock(acm_crit_sect_); |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1255 *channels = 1; | 1256 *channels = 1; |
1256 break; | 1257 break; |
1257 #endif | 1258 #endif |
1258 default: | 1259 default: |
1259 FATAL() << "Codec type " << codec_type << " not supported."; | 1260 FATAL() << "Codec type " << codec_type << " not supported."; |
1260 } | 1261 } |
1261 return true; | 1262 return true; |
1262 } | 1263 } |
1263 | 1264 |
1264 } // namespace webrtc | 1265 } // namespace webrtc |
OLD | NEW |