OLD | NEW |
1 // Copyright (c) 2011 The Native Client Authors. All rights reserved. | 1 // Copyright (c) 2011 The Native Client 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 <nacl/nacl_log.h> | 6 #include <nacl/nacl_log.h> |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <stdio.h> | 9 #include <stdio.h> |
10 #include <stdlib.h> | 10 #include <stdlib.h> |
11 #include <string.h> | 11 #include <string.h> |
12 | 12 |
13 #include <cmath> | 13 #include <cmath> |
14 #include <limits> | 14 #include <limits> |
15 #include <string> | 15 #include <string> |
| 16 #include <nacl/nacl_inttypes.h> |
16 | 17 |
17 #include "native_client/src/shared/ppapi_proxy/utility.h" | 18 #include "native_client/src/shared/ppapi_proxy/utility.h" |
18 #include "ppapi/c/pp_bool.h" | 19 #include "ppapi/c/pp_bool.h" |
19 #include "ppapi/c/pp_errors.h" | 20 #include "ppapi/c/pp_errors.h" |
20 #include "ppapi/c/ppb_audio.h" | 21 #include "ppapi/c/ppb_audio.h" |
21 #include "ppapi/c/ppb_audio_config.h" | 22 #include "ppapi/c/ppb_audio_config.h" |
22 #include "ppapi/cpp/audio.h" | 23 #include "ppapi/cpp/audio.h" |
23 #include "ppapi/cpp/audio_config.h" | 24 #include "ppapi/cpp/audio_config.h" |
24 #include "ppapi/cpp/completion_callback.h" | 25 #include "ppapi/cpp/completion_callback.h" |
25 #include "ppapi/cpp/instance.h" | 26 #include "ppapi/cpp/instance.h" |
26 #include "ppapi/cpp/module.h" | 27 #include "ppapi/cpp/module.h" |
27 #include "ppapi/cpp/var.h" | 28 #include "ppapi/cpp/var.h" |
28 | 29 |
29 // Due to a bug in nacl-newlib, this #include has to come last. | |
30 // See http://code.google.com/p/nativeclient/issues/detail?id=1654 | |
31 #include <nacl/nacl_inttypes.h> | |
32 | |
33 | 30 |
34 // Most of this example is borrowed from ppapi/examples/audio/audio.cc | 31 // Most of this example is borrowed from ppapi/examples/audio/audio.cc |
35 | 32 |
36 // Separate left and right frequency to make sure we didn't swap L & R. | 33 // Separate left and right frequency to make sure we didn't swap L & R. |
37 // Sounds pretty horrible, though... | 34 // Sounds pretty horrible, though... |
38 const double kDefaultFrequencyLeft = 400.0; | 35 const double kDefaultFrequencyLeft = 400.0; |
39 const double kDefaultFrequencyRight = 1000.0; | 36 const double kDefaultFrequencyRight = 1000.0; |
40 const uint32_t kDefaultDuration = 10000; | 37 const uint32_t kDefaultDuration = 10000; |
41 | 38 |
42 // This sample frequency is guaranteed to work. | 39 // This sample frequency is guaranteed to work. |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 | 287 |
291 namespace pp { | 288 namespace pp { |
292 | 289 |
293 // Factory function for your specialization of the Module object. | 290 // Factory function for your specialization of the Module object. |
294 Module* CreateModule() { | 291 Module* CreateModule() { |
295 NaClLogModuleInit(); | 292 NaClLogModuleInit(); |
296 return new MyModule(); | 293 return new MyModule(); |
297 } | 294 } |
298 | 295 |
299 } // namespace pp | 296 } // namespace pp |
OLD | NEW |