summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authornfullagar@google.com <nfullagar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-24 20:13:45 +0000
committernfullagar@google.com <nfullagar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-24 20:13:45 +0000
commit76fa749a64733060e553da96ab1d2325cc02bb43 (patch)
treef416a24f17778a19d705bcd77be33fd23a722d55 /ppapi
parentca8bc13d432230ec64bc30e6c83fc369a35175f5 (diff)
downloadchromium_src-76fa749a64733060e553da96ab1d2325cc02bb43.zip
chromium_src-76fa749a64733060e553da96ab1d2325cc02bb43.tar.gz
chromium_src-76fa749a64733060e553da96ab1d2325cc02bb43.tar.bz2
Change to interface to M19, add a few more test cases to test_audio.
BUG=http://code.google.com/p/chromium/issues/detail?id=115305 TEST=test_audio.cc Review URL: http://codereview.chromium.org/9416107 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123531 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/api/ppb_audio_config.idl7
-rw-r--r--ppapi/c/ppb_audio_config.h7
-rw-r--r--ppapi/tests/test_audio.cc10
3 files changed, 17 insertions, 7 deletions
diff --git a/ppapi/api/ppb_audio_config.idl b/ppapi/api/ppb_audio_config.idl
index 8ba2a28..d03a1b6 100644
--- a/ppapi/api/ppb_audio_config.idl
+++ b/ppapi/api/ppb_audio_config.idl
@@ -10,7 +10,7 @@
label Chrome {
M14 = 1.0,
- M18 = 1.1
+ M19 = 1.1
};
/**
@@ -134,7 +134,7 @@ interface PPB_AudioConfig {
* <code>PP_AUDIOMINSAMPLEFRAMECOUNT</code> and greater than
* <code>PP_AUDIOMAXSAMPLEFRAMECOUNT</code> are never supported on any
* system, but values in between aren't necessarily valid. This function
- * will return a supported count closest to the requested value.
+ * will return a supported count closest to the requested frame count.
*
* RecommendSampleFrameCount() result is intended for audio output devices.
*
@@ -199,7 +199,8 @@ interface PPB_AudioConfig {
* RecommendSampleRate() returns the native sample rate that the browser
* is using in the backend. Applications that use the recommended sample
* rate will have potentially better latency and fidelity. The return value
- * is indended for audio output devices.
+ * is indended for audio output devices. If the output sample rate cannot be
+ * determined, this function can return PP_AUDIOSAMPLERATE_NONE.
*
* @param[in] instance
*
diff --git a/ppapi/c/ppb_audio_config.h b/ppapi/c/ppb_audio_config.h
index 22547ea..177945e 100644
--- a/ppapi/c/ppb_audio_config.h
+++ b/ppapi/c/ppb_audio_config.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* From ppb_audio_config.idl modified Thu Feb 16 16:23:46 2012. */
+/* From ppb_audio_config.idl modified Wed Feb 22 14:49:51 2012. */
#ifndef PPAPI_C_PPB_AUDIO_CONFIG_H_
#define PPAPI_C_PPB_AUDIO_CONFIG_H_
@@ -121,7 +121,7 @@ struct PPB_AudioConfig_1_1 {
* <code>PP_AUDIOMINSAMPLEFRAMECOUNT</code> and greater than
* <code>PP_AUDIOMAXSAMPLEFRAMECOUNT</code> are never supported on any
* system, but values in between aren't necessarily valid. This function
- * will return a supported count closest to the requested value.
+ * will return a supported count closest to the requested frame count.
*
* RecommendSampleFrameCount() result is intended for audio output devices.
*
@@ -178,7 +178,8 @@ struct PPB_AudioConfig_1_1 {
* RecommendSampleRate() returns the native sample rate that the browser
* is using in the backend. Applications that use the recommended sample
* rate will have potentially better latency and fidelity. The return value
- * is indended for audio output devices.
+ * is indended for audio output devices. If the output sample rate cannot be
+ * determined, this function can return PP_AUDIOSAMPLERATE_NONE.
*
* @param[in] instance
*
diff --git a/ppapi/tests/test_audio.cc b/ppapi/tests/test_audio.cc
index b69ef4e..b6f14f8 100644
--- a/ppapi/tests/test_audio.cc
+++ b/ppapi/tests/test_audio.cc
@@ -52,11 +52,19 @@ std::string TestAudio::TestCreation() {
PP_AUDIOMINSAMPLEFRAMECOUNT,
PP_AUDIOMAXSAMPLEFRAMECOUNT,
// Include some "okay-looking" frame counts; check their validity below.
+ PP_AUDIOSAMPLERATE_44100 / 100, // 10ms @ 44.1kHz
+ PP_AUDIOSAMPLERATE_48000 / 100, // 10ms @ 48kHz
+ 2 * PP_AUDIOSAMPLERATE_44100 / 100, // 20ms @ 44.1kHz
+ 2 * PP_AUDIOSAMPLERATE_48000 / 100, // 20ms @ 48kHz
1024,
2048,
4096
};
-
+ PP_AudioSampleRate sample_rate = audio_config_interface_->RecommendSampleRate(
+ instance_->pp_instance());
+ ASSERT_TRUE(sample_rate == PP_AUDIOSAMPLERATE_NONE ||
+ sample_rate == PP_AUDIOSAMPLERATE_44100 ||
+ sample_rate == PP_AUDIOSAMPLERATE_48000);
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kSampleRates); i++) {
PP_AudioSampleRate sample_rate = kSampleRates[i];