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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 } | 330 } |
331 | 331 |
332 if (audio_frame.sample_rate_hz_ > 48000) { | 332 if (audio_frame.sample_rate_hz_ > 48000) { |
333 assert(false); | 333 assert(false); |
334 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_, | 334 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_, |
335 "Cannot Add 10 ms audio, input frequency not valid"); | 335 "Cannot Add 10 ms audio, input frequency not valid"); |
336 return -1; | 336 return -1; |
337 } | 337 } |
338 | 338 |
339 // If the length and frequency matches. We currently just support raw PCM. | 339 // If the length and frequency matches. We currently just support raw PCM. |
340 if ((audio_frame.sample_rate_hz_ / 100) | 340 if ((audio_frame.sample_rate_hz_ / 100) != |
341 != audio_frame.samples_per_channel_) { | 341 audio_frame.samples_per_channel_) { |
342 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_, | 342 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_, |
343 "Cannot Add 10 ms audio, input frequency and length doesn't" | 343 "Cannot Add 10 ms audio, input frequency and length doesn't" |
344 " match"); | 344 " match"); |
345 return -1; | 345 return -1; |
346 } | 346 } |
347 | 347 |
348 if (audio_frame.num_channels_ != 1 && audio_frame.num_channels_ != 2) { | 348 if (audio_frame.num_channels_ != 1 && audio_frame.num_channels_ != 2) { |
349 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_, | 349 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_, |
350 "Cannot Add 10 ms audio, invalid number of channels."); | 350 "Cannot Add 10 ms audio, invalid number of channels."); |
351 return -1; | 351 return -1; |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1255 *channels = 1; | 1255 *channels = 1; |
1256 break; | 1256 break; |
1257 #endif | 1257 #endif |
1258 default: | 1258 default: |
1259 FATAL() << "Codec type " << codec_type << " not supported."; | 1259 FATAL() << "Codec type " << codec_type << " not supported."; |
1260 } | 1260 } |
1261 return true; | 1261 return true; |
1262 } | 1262 } |
1263 | 1263 |
1264 } // namespace webrtc | 1264 } // namespace webrtc |
OLD | NEW |