summaryrefslogtreecommitdiffstats
path: root/ppapi/cpp/audio_config.cc
diff options
context:
space:
mode:
authornfullagar@google.com <nfullagar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-18 01:10:19 +0000
committernfullagar@google.com <nfullagar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-18 01:10:19 +0000
commitc59ed589fde8d4c9225b7b1b125286f842a42e56 (patch)
treefdaa00c2a9f51d0030e3b05bb289630ad5f2e211 /ppapi/cpp/audio_config.cc
parent86bd8a2b5e1ce2965551271109be51244d2fcb42 (diff)
downloadchromium_src-c59ed589fde8d4c9225b7b1b125286f842a42e56.zip
chromium_src-c59ed589fde8d4c9225b7b1b125286f842a42e56.tar.gz
chromium_src-c59ed589fde8d4c9225b7b1b125286f842a42e56.tar.bz2
Work on improving PpbAudioConfig:RecommendSampleFrameCount
Add version 1.1 which will query the audio back end for the best available sample frame count. Also add RecommendSampleRate. Switch pepper plugin delegate to use AUDIO_PCM_LOW_LATENCY if client request is compatible. TEST=included BUG=http://code.google.com/p/chromium/issues/detail?id=107572 Review URL: https://chromiumcodereview.appspot.com/9129007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122653 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/cpp/audio_config.cc')
-rw-r--r--ppapi/cpp/audio_config.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/ppapi/cpp/audio_config.cc b/ppapi/cpp/audio_config.cc
index b553dad..a49515e 100644
--- a/ppapi/cpp/audio_config.cc
+++ b/ppapi/cpp/audio_config.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -36,13 +36,24 @@ AudioConfig::AudioConfig(Instance* instance,
}
// static
+PP_AudioSampleRate AudioConfig::RecommendSampleRate(Instance* instance) {
+ if (!has_interface<PPB_AudioConfig>())
+ return PP_AUDIOSAMPLERATE_NONE;
+ return get_interface<PPB_AudioConfig>()->
+ RecommendSampleRate(instance->pp_instance());
+}
+
+// static
uint32_t AudioConfig::RecommendSampleFrameCount(
+ Instance* instance,
PP_AudioSampleRate sample_rate,
uint32_t requested_sample_frame_count) {
if (!has_interface<PPB_AudioConfig>())
return 0;
return get_interface<PPB_AudioConfig>()->
- RecommendSampleFrameCount(sample_rate, requested_sample_frame_count);
+ RecommendSampleFrameCount(instance->pp_instance(),
+ sample_rate,
+ requested_sample_frame_count);
}
} // namespace pp