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 | |
robertm
2011/06/27 14:55:15
can you reference this bug in the description
| |
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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
295 | 292 |
296 namespace pp { | 293 namespace pp { |
297 | 294 |
298 // Factory function for your specialization of the Module object. | 295 // Factory function for your specialization of the Module object. |
299 Module* CreateModule() { | 296 Module* CreateModule() { |
300 NaClLogModuleInit(); | 297 NaClLogModuleInit(); |
301 return new MyModule(); | 298 return new MyModule(); |
302 } | 299 } |
303 | 300 |
304 } // namespace pp | 301 } // namespace pp |
OLD | NEW |