| OLD | NEW |
| 1 /* Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2010 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 #ifndef PPAPI_C_DEV_PPB_AUDIO_CONFIG_DEV_H_ | 5 #ifndef PPAPI_C_DEV_PPB_AUDIO_CONFIG_DEV_H_ |
| 6 #define PPAPI_C_DEV_PPB_AUDIO_CONFIG_DEV_H_ | 6 #define PPAPI_C_DEV_PPB_AUDIO_CONFIG_DEV_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
| 9 #include "ppapi/c/pp_instance.h" |
| 9 #include "ppapi/c/pp_macros.h" | 10 #include "ppapi/c/pp_macros.h" |
| 10 #include "ppapi/c/pp_module.h" | |
| 11 #include "ppapi/c/pp_resource.h" | 11 #include "ppapi/c/pp_resource.h" |
| 12 #include "ppapi/c/pp_stdint.h" | 12 #include "ppapi/c/pp_stdint.h" |
| 13 | 13 |
| 14 #define PPB_AUDIO_CONFIG_DEV_INTERFACE "PPB_AudioConfig(Dev);0.3" | 14 #define PPB_AUDIO_CONFIG_DEV_INTERFACE "PPB_AudioConfig(Dev);0.4" |
| 15 | 15 |
| 16 enum { | 16 enum { |
| 17 PP_AUDIOMINSAMPLEFRAMECOUNT = 64, | 17 PP_AUDIOMINSAMPLEFRAMECOUNT = 64, |
| 18 PP_AUDIOMAXSAMPLEFRAMECOUNT = 32768 | 18 PP_AUDIOMAXSAMPLEFRAMECOUNT = 32768 |
| 19 }; | 19 }; |
| 20 | 20 |
| 21 typedef enum { | 21 typedef enum { |
| 22 PP_AUDIOSAMPLERATE_NONE = 0, | 22 PP_AUDIOSAMPLERATE_NONE = 0, |
| 23 PP_AUDIOSAMPLERATE_44100 = 44100, | 23 PP_AUDIOSAMPLERATE_44100 = 44100, |
| 24 PP_AUDIOSAMPLERATE_48000 = 48000 | 24 PP_AUDIOSAMPLERATE_48000 = 48000 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 45 * int16_t *buffer16; | 45 * int16_t *buffer16; |
| 46 * buffer16[0] is the first left channel sample | 46 * buffer16[0] is the first left channel sample |
| 47 * buffer16[1] is the first right channel sample | 47 * buffer16[1] is the first right channel sample |
| 48 * buffer16[2] is the second left channel sample | 48 * buffer16[2] is the second left channel sample |
| 49 * buffer16[3] is the second right channel sample | 49 * buffer16[3] is the second right channel sample |
| 50 * ... | 50 * ... |
| 51 * buffer16[2 * (sample_frame_count - 1)] is the last left channel sample | 51 * buffer16[2 * (sample_frame_count - 1)] is the last left channel sample |
| 52 * buffer16[2 * (sample_frame_count - 1) + 1] is the last right channel sample | 52 * buffer16[2 * (sample_frame_count - 1) + 1] is the last right channel sample |
| 53 * Data will always be in the native endian format of the platform. | 53 * Data will always be in the native endian format of the platform. |
| 54 */ | 54 */ |
| 55 PP_Resource (*CreateStereo16Bit)(PP_Module module, | 55 PP_Resource (*CreateStereo16Bit)(PP_Instance instance, |
| 56 PP_AudioSampleRate_Dev sample_rate, | 56 PP_AudioSampleRate_Dev sample_rate, |
| 57 uint32_t sample_frame_count); | 57 uint32_t sample_frame_count); |
| 58 | 58 |
| 59 /* | 59 /* |
| 60 * Returns a supported sample frame count closest to the given requested | 60 * Returns a supported sample frame count closest to the given requested |
| 61 * count. The sample frame count determines the overall latency of audio. | 61 * count. The sample frame count determines the overall latency of audio. |
| 62 * Since one "frame" is always buffered in advance, smaller frame counts | 62 * Since one "frame" is always buffered in advance, smaller frame counts |
| 63 * will yield lower latency, but higher CPU utilization. | 63 * will yield lower latency, but higher CPU utilization. |
| 64 * | 64 * |
| 65 * Supported sample frame counts will vary by hardware and system (consider | 65 * Supported sample frame counts will vary by hardware and system (consider |
| (...skipping 22 matching lines...) Expand all Loading... |
| 88 /** | 88 /** |
| 89 * Returns the sample frame count for the given AudioConfig resource. If the | 89 * Returns the sample frame count for the given AudioConfig resource. If the |
| 90 * resource is invalid, this will return 0. See RecommendSampleFrameCount for | 90 * resource is invalid, this will return 0. See RecommendSampleFrameCount for |
| 91 * more on sample frame counts. | 91 * more on sample frame counts. |
| 92 */ | 92 */ |
| 93 uint32_t (*GetSampleFrameCount)(PP_Resource config); | 93 uint32_t (*GetSampleFrameCount)(PP_Resource config); |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 #endif /* PPAPI_C_DEV_PPB_AUDIO_CONFIG_DEV_H_ */ | 96 #endif /* PPAPI_C_DEV_PPB_AUDIO_CONFIG_DEV_H_ */ |
| 97 | 97 |
| OLD | NEW |