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

Side by Side Diff: webrtc/voice_engine/output_mixer.cc

Issue 1316523002: Convert channel counts to size_t. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Fix compile Created 4 years, 11 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
11 #include "webrtc/voice_engine/output_mixer.h" 11 #include "webrtc/voice_engine/output_mixer.h"
12 12
13 #include "webrtc/base/format_macros.h"
13 #include "webrtc/modules/audio_processing/include/audio_processing.h" 14 #include "webrtc/modules/audio_processing/include/audio_processing.h"
14 #include "webrtc/modules/utility/include/audio_frame_operations.h" 15 #include "webrtc/modules/utility/include/audio_frame_operations.h"
15 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" 16 #include "webrtc/system_wrappers/include/critical_section_wrapper.h"
16 #include "webrtc/system_wrappers/include/file_wrapper.h" 17 #include "webrtc/system_wrappers/include/file_wrapper.h"
17 #include "webrtc/system_wrappers/include/trace.h" 18 #include "webrtc/system_wrappers/include/trace.h"
18 #include "webrtc/voice_engine/include/voe_external_media.h" 19 #include "webrtc/voice_engine/include/voe_external_media.h"
19 #include "webrtc/voice_engine/statistics.h" 20 #include "webrtc/voice_engine/statistics.h"
20 #include "webrtc/voice_engine/utility.h" 21 #include "webrtc/voice_engine/utility.h"
21 22
22 namespace webrtc { 23 namespace webrtc {
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 } 456 }
456 _outputFileRecorderPtr->RegisterModuleFileCallback(NULL); 457 _outputFileRecorderPtr->RegisterModuleFileCallback(NULL);
457 FileRecorder::DestroyFileRecorder(_outputFileRecorderPtr); 458 FileRecorder::DestroyFileRecorder(_outputFileRecorderPtr);
458 _outputFileRecorderPtr = NULL; 459 _outputFileRecorderPtr = NULL;
459 _outputFileRecording = false; 460 _outputFileRecording = false;
460 461
461 return 0; 462 return 0;
462 } 463 }
463 464
464 int OutputMixer::GetMixedAudio(int sample_rate_hz, 465 int OutputMixer::GetMixedAudio(int sample_rate_hz,
465 int num_channels, 466 size_t num_channels,
466 AudioFrame* frame) { 467 AudioFrame* frame) {
467 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,-1), 468 WEBRTC_TRACE(
468 "OutputMixer::GetMixedAudio(sample_rate_hz=%d, num_channels=%d)", 469 kTraceStream, kTraceVoice, VoEId(_instanceId,-1),
469 sample_rate_hz, num_channels); 470 "OutputMixer::GetMixedAudio(sample_rate_hz=%d, num_channels=%" PRIuS ")",
471 sample_rate_hz, num_channels);
470 472
471 // --- Record playout if enabled 473 // --- Record playout if enabled
472 { 474 {
473 CriticalSectionScoped cs(&_fileCritSect); 475 CriticalSectionScoped cs(&_fileCritSect);
474 if (_outputFileRecording && _outputFileRecorderPtr) 476 if (_outputFileRecording && _outputFileRecorderPtr)
475 _outputFileRecorderPtr->RecordAudioToFile(_audioFrame); 477 _outputFileRecorderPtr->RecordAudioToFile(_audioFrame);
476 } 478 }
477 479
478 frame->num_channels_ = num_channels; 480 frame->num_channels_ = num_channels;
479 frame->sample_rate_hz_ = sample_rate_hz; 481 frame->sample_rate_hz_ = sample_rate_hz;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 _audioFrame.data_[2 * i + 1] = 0; 602 _audioFrame.data_[2 * i + 1] = 0;
601 } 603 }
602 } 604 }
603 assert(_audioFrame.samples_per_channel_ == toneSamples); 605 assert(_audioFrame.samples_per_channel_ == toneSamples);
604 606
605 return 0; 607 return 0;
606 } 608 }
607 609
608 } // namespace voe 610 } // namespace voe
609 } // namespace webrtc 611 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/voice_engine/output_mixer.h ('k') | webrtc/voice_engine/test/auto_test/standard/codec_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698