OLD | NEW |
1 // Copyright (c) 2012 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/shared_impl/ppb_audio_config_shared.h" | 5 #include "ppapi/shared_impl/ppb_audio_config_shared.h" |
6 #include "ppapi/thunk/thunk.h" | 6 #include "ppapi/thunk/thunk.h" |
7 #include "ppapi/thunk/enter.h" | 7 #include "ppapi/thunk/enter.h" |
8 #include "ppapi/thunk/ppb_audio_config_api.h" | 8 #include "ppapi/thunk/ppb_audio_config_api.h" |
9 #include "ppapi/thunk/resource_creation_api.h" | 9 #include "ppapi/thunk/resource_creation_api.h" |
10 | 10 |
11 namespace ppapi { | 11 namespace ppapi { |
12 namespace thunk { | 12 namespace thunk { |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 PP_Resource CreateStereo16bit(PP_Instance instance, | 16 PP_Resource CreateStereo16bit(PP_Instance instance, |
17 PP_AudioSampleRate sample_rate, | 17 PP_AudioSampleRate sample_rate, |
18 uint32_t sample_frame_count) { | 18 uint32_t sample_frame_count) { |
19 EnterFunction<ResourceCreationAPI> enter(instance, true); | 19 EnterResourceCreation enter(instance); |
20 if (enter.failed()) | 20 if (enter.failed()) |
21 return 0; | 21 return 0; |
22 return enter.functions()->CreateAudioConfig(instance, sample_rate, | 22 return enter.functions()->CreateAudioConfig(instance, sample_rate, |
23 sample_frame_count); | 23 sample_frame_count); |
24 } | 24 } |
25 | 25 |
26 uint32_t RecommendSampleFrameCount_1_0(PP_AudioSampleRate sample_rate, | 26 uint32_t RecommendSampleFrameCount_1_0(PP_AudioSampleRate sample_rate, |
27 uint32_t requested_sample_frame_count) { | 27 uint32_t requested_sample_frame_count) { |
28 return PPB_AudioConfig_Shared::RecommendSampleFrameCount_1_0(sample_rate, | 28 return PPB_AudioConfig_Shared::RecommendSampleFrameCount_1_0(sample_rate, |
29 requested_sample_frame_count); | 29 requested_sample_frame_count); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 const PPB_AudioConfig_1_0* GetPPB_AudioConfig_1_0_Thunk() { | 89 const PPB_AudioConfig_1_0* GetPPB_AudioConfig_1_0_Thunk() { |
90 return &g_ppb_audio_config_thunk_1_0; | 90 return &g_ppb_audio_config_thunk_1_0; |
91 } | 91 } |
92 | 92 |
93 const PPB_AudioConfig_1_1* GetPPB_AudioConfig_1_1_Thunk() { | 93 const PPB_AudioConfig_1_1* GetPPB_AudioConfig_1_1_Thunk() { |
94 return &g_ppb_audio_config_thunk_1_1; | 94 return &g_ppb_audio_config_thunk_1_1; |
95 } | 95 } |
96 | 96 |
97 } // namespace thunk | 97 } // namespace thunk |
98 } // namespace ppapi | 98 } // namespace ppapi |
OLD | NEW |