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/files/file_util.h" | 7 #include "base/files/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 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 AudioParameters native_params = GetInputStreamParameters(); | 804 AudioParameters native_params = GetInputStreamParameters(); |
805 AudioParameters params(native_params.format(), | 805 AudioParameters params(native_params.format(), |
806 native_params.channel_layout(), | 806 native_params.channel_layout(), |
807 native_params.sample_rate(), | 807 native_params.sample_rate(), |
808 native_params.bits_per_sample(), | 808 native_params.bits_per_sample(), |
809 native_params.sample_rate() / 100, | 809 native_params.sample_rate() / 100, |
810 native_params.effects()); | 810 native_params.effects()); |
811 StartInputStreamCallbacks(params); | 811 StartInputStreamCallbacks(params); |
812 } | 812 } |
813 | 813 |
| 814 |
| 815 #if defined(__aarch64__) |
| 816 // Disable StartOutputStreamCallbacks and |
| 817 // StartOutputStreamCallbacksNonDefaultParameters on Arm64: crbug.com/418029 |
| 818 #define MAYBE_StartOutputStreamCallbacks DISABLED_StartOutputStreamCallbacks |
| 819 #define MAYBE_StartOutputStreamCallbacksNonDefaultParameters \ |
| 820 DISABLED_StartOutputStreamCallbacksNonDefaultParameters |
| 821 #else |
| 822 #define MAYBE_StartOutputStreamCallbacks StartOutputStreamCallbacks |
| 823 #define MAYBE_StartOutputStreamCallbacksNonDefaultParameters \ |
| 824 StartOutputStreamCallbacksNonDefaultParameters |
| 825 #endif |
| 826 |
| 827 |
814 // Start output streaming using default output parameters and ensure that the | 828 // Start output streaming using default output parameters and ensure that the |
815 // callback sequence is sane. | 829 // callback sequence is sane. |
816 TEST_F(AudioAndroidOutputTest, StartOutputStreamCallbacks) { | 830 TEST_F(AudioAndroidOutputTest, MAYBE_StartOutputStreamCallbacks) { |
817 GetDefaultOutputStreamParametersOnAudioThread(); | 831 GetDefaultOutputStreamParametersOnAudioThread(); |
818 StartOutputStreamCallbacks(audio_output_parameters()); | 832 StartOutputStreamCallbacks(audio_output_parameters()); |
819 } | 833 } |
820 | 834 |
821 // Start output streaming using non default output parameters and ensure that | 835 // Start output streaming using non default output parameters and ensure that |
822 // the callback sequence is sane. The only change we make in this test is to | 836 // the callback sequence is sane. The only change we make in this test is to |
823 // select a 10ms buffer size instead of the default size and to open up the | 837 // select a 10ms buffer size instead of the default size and to open up the |
824 // device in mono. | 838 // device in mono. |
825 // TODO(henrika): possibly add support for more variations. | 839 // TODO(henrika): possibly add support for more variations. |
826 TEST_F(AudioAndroidOutputTest, StartOutputStreamCallbacksNonDefaultParameters) { | 840 TEST_F(AudioAndroidOutputTest, |
| 841 MAYBE_StartOutputStreamCallbacksNonDefaultParameters) { |
827 GetDefaultOutputStreamParametersOnAudioThread(); | 842 GetDefaultOutputStreamParametersOnAudioThread(); |
828 AudioParameters params(audio_output_parameters().format(), | 843 AudioParameters params(audio_output_parameters().format(), |
829 CHANNEL_LAYOUT_MONO, | 844 CHANNEL_LAYOUT_MONO, |
830 audio_output_parameters().sample_rate(), | 845 audio_output_parameters().sample_rate(), |
831 audio_output_parameters().bits_per_sample(), | 846 audio_output_parameters().bits_per_sample(), |
832 audio_output_parameters().sample_rate() / 100); | 847 audio_output_parameters().sample_rate() / 100); |
833 StartOutputStreamCallbacks(params); | 848 StartOutputStreamCallbacks(params); |
834 } | 849 } |
835 | 850 |
836 // Play out a PCM file segment in real time and allow the user to verify that | 851 // Play out a PCM file segment in real time and allow the user to verify that |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20)); | 982 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20)); |
968 printf("\n"); | 983 printf("\n"); |
969 StopAndCloseAudioOutputStreamOnAudioThread(); | 984 StopAndCloseAudioOutputStreamOnAudioThread(); |
970 StopAndCloseAudioInputStreamOnAudioThread(); | 985 StopAndCloseAudioInputStreamOnAudioThread(); |
971 } | 986 } |
972 | 987 |
973 INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest, AudioAndroidInputTest, | 988 INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest, AudioAndroidInputTest, |
974 testing::ValuesIn(RunAudioRecordInputPathTests())); | 989 testing::ValuesIn(RunAudioRecordInputPathTests())); |
975 | 990 |
976 } // namespace media | 991 } // namespace media |
OLD | NEW |