OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/android/build_info.h" | 5 #include "base/android/build_info.h" |
6 #include "base/basictypes.h" | 6 #include "base/basictypes.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 DISABLED_RunSymmetricInputAndOutputStreamsInFullDuplex) { | 818 DISABLED_RunSymmetricInputAndOutputStreamsInFullDuplex) { |
819 // Get native audio parameters for the input side. | 819 // Get native audio parameters for the input side. |
820 AudioParameters default_input_params = GetInputStreamParameters(); | 820 AudioParameters default_input_params = GetInputStreamParameters(); |
821 | 821 |
822 // Modify the parameters so that both input and output can use the same | 822 // Modify the parameters so that both input and output can use the same |
823 // parameters by selecting 10ms as buffer size. This will also ensure that | 823 // parameters by selecting 10ms as buffer size. This will also ensure that |
824 // the output stream will be a mono stream since mono is default for input | 824 // the output stream will be a mono stream since mono is default for input |
825 // audio on Android. | 825 // audio on Android. |
826 AudioParameters io_params(default_input_params.format(), | 826 AudioParameters io_params(default_input_params.format(), |
827 default_input_params.channel_layout(), | 827 default_input_params.channel_layout(), |
| 828 ChannelLayoutToChannelCount( |
| 829 default_input_params.channel_layout()), |
828 default_input_params.sample_rate(), | 830 default_input_params.sample_rate(), |
829 default_input_params.bits_per_sample(), | 831 default_input_params.bits_per_sample(), |
830 default_input_params.sample_rate() / 100); | 832 default_input_params.sample_rate() / 100, |
| 833 default_input_params.effects()); |
831 VLOG(1) << io_params; | 834 VLOG(1) << io_params; |
832 | 835 |
833 // Create input and output streams using the common audio parameters. | 836 // Create input and output streams using the common audio parameters. |
834 AudioInputStream* ais = audio_manager()->MakeAudioInputStream( | 837 AudioInputStream* ais = audio_manager()->MakeAudioInputStream( |
835 io_params, AudioManagerBase::kDefaultDeviceId); | 838 io_params, AudioManagerBase::kDefaultDeviceId); |
836 EXPECT_TRUE(ais); | 839 EXPECT_TRUE(ais); |
837 AudioOutputStream* aos = audio_manager()->MakeAudioOutputStream( | 840 AudioOutputStream* aos = audio_manager()->MakeAudioOutputStream( |
838 io_params, std::string(), std::string()); | 841 io_params, std::string(), std::string()); |
839 EXPECT_TRUE(aos); | 842 EXPECT_TRUE(aos); |
840 | 843 |
(...skipping 16 matching lines...) Expand all Loading... |
857 aos->Stop(); | 860 aos->Stop(); |
858 ais->Stop(); | 861 ais->Stop(); |
859 aos->Close(); | 862 aos->Close(); |
860 ais->Close(); | 863 ais->Close(); |
861 } | 864 } |
862 | 865 |
863 INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest, AudioAndroidInputTest, | 866 INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest, AudioAndroidInputTest, |
864 testing::ValuesIn(RunAudioRecordInputPathTests())); | 867 testing::ValuesIn(RunAudioRecordInputPathTests())); |
865 | 868 |
866 } // namespace media | 869 } // namespace media |
OLD | NEW |