| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 | 7 |
| 8 /* This example loads an ogg file using the C Pepper URLLoader interface, | 8 /* This example loads an ogg file using the C Pepper URLLoader interface, |
| 9 * decodes the file using libvorbis/libogg, and loop plays the file using | 9 * decodes the file using libvorbis/libogg, and loop plays the file using |
| 10 * OpenAL. Various properties of the audio source and listener can be changed | 10 * OpenAL. Various properties of the audio source and listener can be changed |
| 11 * through HTML controls which result in PostMessage calls interpreted below in | 11 * through HTML controls which result in PostMessage calls interpreted below in |
| 12 * Messaging_HandleMessage. | 12 * Messaging_HandleMessage. |
| 13 */ | 13 */ |
| 14 | 14 |
| 15 #include <assert.h> | 15 #include <assert.h> |
| 16 #include <pthread.h> | 16 #include <pthread.h> |
| 17 #include <stdio.h> | 17 #include <stdio.h> |
| 18 #include <semaphore.h> | 18 #include <semaphore.h> |
| 19 #include <string.h> | 19 #include <string.h> |
| 20 | 20 |
| 21 #include "AL/al.h" | 21 #include "AL/al.h" |
| 22 #include "AL/alc.h" | 22 #include "AL/alc.h" |
| 23 | 23 |
| 24 /* Pepper includes */ | 24 /* Pepper includes */ |
| 25 #include "ppapi/c/pp_completion_callback.h" | 25 #include "ppapi/c/pp_completion_callback.h" |
| 26 #include "ppapi/c/pp_errors.h" | 26 #include "ppapi/c/pp_errors.h" |
| 27 #include "ppapi/c/pp_instance.h" | 27 #include "ppapi/c/pp_instance.h" |
| 28 #include "ppapi/c/pp_module.h" | 28 #include "ppapi/c/pp_module.h" |
| 29 #include "ppapi/c/pp_rect.h" |
| 29 #include "ppapi/c/ppb_audio.h" | 30 #include "ppapi/c/ppb_audio.h" |
| 30 #include "ppapi/c/ppb_audio_config.h" | 31 #include "ppapi/c/ppb_audio_config.h" |
| 31 #include "ppapi/c/ppb_instance.h" | 32 #include "ppapi/c/ppb_instance.h" |
| 32 #include "ppapi/c/ppb_core.h" | 33 #include "ppapi/c/ppb_core.h" |
| 33 #include "ppapi/c/ppb_url_loader.h" | 34 #include "ppapi/c/ppb_url_loader.h" |
| 34 #include "ppapi/c/ppb_url_request_info.h" | 35 #include "ppapi/c/ppb_url_request_info.h" |
| 35 #include "ppapi/c/ppb_var.h" | 36 #include "ppapi/c/ppb_var.h" |
| 36 #include "ppapi/c/ppp.h" | 37 #include "ppapi/c/ppp.h" |
| 37 #include "ppapi/c/ppp_input_event.h" | 38 #include "ppapi/c/ppp_input_event.h" |
| 38 #include "ppapi/c/ppp_instance.h" | 39 #include "ppapi/c/ppp_instance.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 PP_EXPORT void PPP_ShutdownModule() { | 404 PP_EXPORT void PPP_ShutdownModule() { |
| 404 } | 405 } |
| 405 | 406 |
| 406 PP_EXPORT const void* PPP_GetInterface(const char* interface_name) { | 407 PP_EXPORT const void* PPP_GetInterface(const char* interface_name) { |
| 407 if (strcmp(interface_name, PPP_INSTANCE_INTERFACE) == 0) | 408 if (strcmp(interface_name, PPP_INSTANCE_INTERFACE) == 0) |
| 408 return &instance_interface; | 409 return &instance_interface; |
| 409 if (strcmp(interface_name, PPP_MESSAGING_INTERFACE) == 0) | 410 if (strcmp(interface_name, PPP_MESSAGING_INTERFACE) == 0) |
| 410 return &messaging_interface; | 411 return &messaging_interface; |
| 411 return NULL; | 412 return NULL; |
| 412 } | 413 } |
| OLD | NEW |