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

Side by Side Diff: ppapi/cpp/audio_config.cc

Issue 9129007: Work on improving PpbAudioConfig:RecommendSampleFrameCount (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 10 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ppapi/cpp/audio_config.h" 5 #include "ppapi/cpp/audio_config.h"
6 6
7 #include "ppapi/cpp/instance.h" 7 #include "ppapi/cpp/instance.h"
8 #include "ppapi/cpp/module.h" 8 #include "ppapi/cpp/module.h"
9 #include "ppapi/cpp/module_impl.h" 9 #include "ppapi/cpp/module_impl.h"
10 10
11 namespace pp { 11 namespace pp {
(...skipping 17 matching lines...) Expand all
29 : sample_rate_(sample_rate), 29 : sample_rate_(sample_rate),
30 sample_frame_count_(sample_frame_count) { 30 sample_frame_count_(sample_frame_count) {
31 if (has_interface<PPB_AudioConfig>()) { 31 if (has_interface<PPB_AudioConfig>()) {
32 PassRefFromConstructor( 32 PassRefFromConstructor(
33 get_interface<PPB_AudioConfig>()->CreateStereo16Bit( 33 get_interface<PPB_AudioConfig>()->CreateStereo16Bit(
34 instance->pp_instance(), sample_rate, sample_frame_count)); 34 instance->pp_instance(), sample_rate, sample_frame_count));
35 } 35 }
36 } 36 }
37 37
38 // static 38 // static
39 PP_AudioSampleRate AudioConfig::RecommendSampleRate(Instance* instance) {
40 if (!has_interface<PPB_AudioConfig>())
41 return PP_AUDIOSAMPLERATE_NONE;
42 return get_interface<PPB_AudioConfig>()->
43 RecommendSampleRate(instance->pp_instance());
44 }
45
46 // static
39 uint32_t AudioConfig::RecommendSampleFrameCount( 47 uint32_t AudioConfig::RecommendSampleFrameCount(
48 Instance* instance,
40 PP_AudioSampleRate sample_rate, 49 PP_AudioSampleRate sample_rate,
41 uint32_t requested_sample_frame_count) { 50 uint32_t requested_sample_frame_count) {
42 if (!has_interface<PPB_AudioConfig>()) 51 if (!has_interface<PPB_AudioConfig>())
43 return 0; 52 return 0;
44 return get_interface<PPB_AudioConfig>()-> 53 return get_interface<PPB_AudioConfig>()->
45 RecommendSampleFrameCount(sample_rate, requested_sample_frame_count); 54 RecommendSampleFrameCount(instance->pp_instance(),
55 sample_rate,
56 requested_sample_frame_count);
46 } 57 }
47 58
48 } // namespace pp 59 } // namespace pp
49 60
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698