OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 5 |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 #include <limits> | 9 #include <limits> |
10 #include <string> | 10 #include <string> |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } | 70 } |
71 } | 71 } |
72 | 72 |
73 void ExtraChecks(pp::AudioConfig* config) { | 73 void ExtraChecks(pp::AudioConfig* config) { |
74 CHECK(obtained_sample_frame_count_ >= PP_AUDIOMINSAMPLEFRAMECOUNT); | 74 CHECK(obtained_sample_frame_count_ >= PP_AUDIOMINSAMPLEFRAMECOUNT); |
75 CHECK(obtained_sample_frame_count_ <= PP_AUDIOMAXSAMPLEFRAMECOUNT); | 75 CHECK(obtained_sample_frame_count_ <= PP_AUDIOMAXSAMPLEFRAMECOUNT); |
76 | 76 |
77 PPB_GetInterface get_browser_if = | 77 PPB_GetInterface get_browser_if = |
78 pp::Module::Get()->get_browser_interface(); | 78 pp::Module::Get()->get_browser_interface(); |
79 | 79 |
80 const struct PPB_AudioConfig* audio_config_if = | 80 const PPB_AudioConfig* audio_config_if = |
81 static_cast<const struct PPB_AudioConfig*>( | 81 static_cast<const PPB_AudioConfig*>( |
82 get_browser_if(PPB_AUDIO_CONFIG_INTERFACE)); | 82 get_browser_if(PPB_AUDIO_CONFIG_INTERFACE)); |
83 | 83 |
84 const struct PPB_Audio* audio_if = | 84 const PPB_Audio* audio_if = |
85 static_cast<const struct PPB_Audio*>( | 85 static_cast<const PPB_Audio*>( |
86 get_browser_if(PPB_AUDIO_INTERFACE)); | 86 get_browser_if(PPB_AUDIO_INTERFACE)); |
87 | 87 |
88 CHECK(NULL != audio_config_if); | 88 CHECK(NULL != audio_config_if); |
89 CHECK(NULL != audio_if); | 89 CHECK(NULL != audio_if); |
90 | 90 |
91 const PP_Resource audio_config_res = config->pp_resource(); | 91 const PP_Resource audio_config_res = config->pp_resource(); |
92 const PP_Resource audio_res = audio_.pp_resource(); | 92 const PP_Resource audio_res = audio_.pp_resource(); |
93 | 93 |
94 CHECK(PP_TRUE == audio_config_if->IsAudioConfig(audio_config_res)); | 94 CHECK(PP_TRUE == audio_config_if->IsAudioConfig(audio_config_res)); |
95 CHECK(PP_TRUE == audio_if->IsAudio(audio_res)); | 95 CHECK(PP_TRUE == audio_if->IsAudio(audio_res)); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 return new MyInstance(instance); | 146 return new MyInstance(instance); |
147 } | 147 } |
148 }; | 148 }; |
149 | 149 |
150 namespace pp { | 150 namespace pp { |
151 Module* CreateModule() { | 151 Module* CreateModule() { |
152 return new MyModule(); | 152 return new MyModule(); |
153 } | 153 } |
154 | 154 |
155 } // namespace pp | 155 } // namespace pp |
OLD | NEW |