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

Side by Side Diff: media/base/audio_hardware_config_unittest.cc

Issue 236123002: Allow pass through buffer sizes on OSX. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « media/base/audio_hardware_config.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "build/build_config.h" 5 #include "build/build_config.h"
6 #include "media/base/audio_hardware_config.h" 6 #include "media/base/audio_hardware_config.h"
7 #include "media/audio/audio_parameters.h" 7 #include "media/audio/audio_parameters.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace media { 10 namespace media {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 kInputSampleRate, 94 kInputSampleRate,
95 16, 95 16,
96 kOutputBufferSize); 96 kOutputBufferSize);
97 AudioParameters output_params(AudioParameters::AUDIO_PCM_LOW_LATENCY, 97 AudioParameters output_params(AudioParameters::AUDIO_PCM_LOW_LATENCY,
98 kOutputChannelLayout, 98 kOutputChannelLayout,
99 3200, 99 3200,
100 16, 100 16,
101 32); 101 32);
102 AudioHardwareConfig fake_config(input_params, output_params); 102 AudioHardwareConfig fake_config(input_params, output_params);
103 103
104 #if defined(OS_LINUX) 104 #if defined(OS_LINUX) || defined(OS_MACOSX)
105 EXPECT_EQ(64, fake_config.GetHighLatencyBufferSize()); 105 EXPECT_EQ(64, fake_config.GetHighLatencyBufferSize());
106 106
107 for (int i = 6400; i <= 204800; i *= 2) { 107 for (int i = 6400; i <= 204800; i *= 2) {
108 fake_config.UpdateOutputConfig( 108 fake_config.UpdateOutputConfig(
109 AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY, 109 AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY,
110 kOutputChannelLayout, 110 kOutputChannelLayout,
111 i, 111 i,
112 16, 112 16,
113 32)); 113 32));
114 EXPECT_EQ(2 * (i / 100), fake_config.GetHighLatencyBufferSize()); 114 EXPECT_EQ(2 * (i / 100), fake_config.GetHighLatencyBufferSize());
115 } 115 }
116 #else 116 #else
117 // If high latency buffer sizes are not supported, the value should just pass 117 // If high latency buffer sizes are not supported, the value should just pass
118 // through the output buffer size. 118 // through the output buffer size.
119 EXPECT_EQ(32, fake_config.GetHighLatencyBufferSize()); 119 EXPECT_EQ(32, fake_config.GetHighLatencyBufferSize());
120 #endif 120 #endif
121 } 121 }
122 122
123 } // namespace content 123 } // namespace content
OLDNEW
« no previous file with comments | « media/base/audio_hardware_config.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698