| OLD | NEW |
| 1 /* Copyright 2014 The Chromium Authors. All rights reserved. | 1 /* Copyright 2014 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 /* From ppb_audio_frame.idl modified Wed Jan 29 13:24:24 2014. */ | 6 /* From ppb_audio_buffer.idl modified Thu Feb 6 15:31:48 2014. */ |
| 7 | 7 |
| 8 #ifndef PPAPI_C_PPB_AUDIO_FRAME_H_ | 8 #ifndef PPAPI_C_PPB_AUDIO_BUFFER_H_ |
| 9 #define PPAPI_C_PPB_AUDIO_FRAME_H_ | 9 #define PPAPI_C_PPB_AUDIO_BUFFER_H_ |
| 10 | 10 |
| 11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
| 12 #include "ppapi/c/pp_macros.h" | 12 #include "ppapi/c/pp_macros.h" |
| 13 #include "ppapi/c/pp_resource.h" | 13 #include "ppapi/c/pp_resource.h" |
| 14 #include "ppapi/c/pp_stdint.h" | 14 #include "ppapi/c/pp_stdint.h" |
| 15 #include "ppapi/c/pp_time.h" | 15 #include "ppapi/c/pp_time.h" |
| 16 | 16 |
| 17 #define PPB_AUDIOFRAME_INTERFACE_0_1 "PPB_AudioFrame;0.1" /* dev */ | 17 #define PPB_AUDIOBUFFER_INTERFACE_0_1 "PPB_AudioBuffer;0.1" /* dev */ |
| 18 /** | 18 /** |
| 19 * @file | 19 * @file |
| 20 * Defines the <code>PPB_AudioFrame</code> interface. | 20 * Defines the <code>PPB_AudioBuffer</code> interface. |
| 21 */ | 21 */ |
| 22 | 22 |
| 23 | 23 |
| 24 /** | 24 /** |
| 25 * @addtogroup Enums | 25 * @addtogroup Enums |
| 26 * @{ | 26 * @{ |
| 27 */ | 27 */ |
| 28 /** | 28 /** |
| 29 * PP_AudioFrame_SampleRate is an enumeration of the different audio sample | 29 * PP_AudioBuffer_SampleRate is an enumeration of the different audio sample |
| 30 * rates. | 30 * rates. |
| 31 */ | 31 */ |
| 32 typedef enum { | 32 typedef enum { |
| 33 PP_AUDIOFRAME_SAMPLERATE_UNKNOWN = 0, | 33 PP_AUDIOBUFFER_SAMPLERATE_UNKNOWN = 0, |
| 34 PP_AUDIOFRAME_SAMPLERATE_8000 = 8000, | 34 PP_AUDIOBUFFER_SAMPLERATE_8000 = 8000, |
| 35 PP_AUDIOFRAME_SAMPLERATE_44100 = 44100 | 35 PP_AUDIOBUFFER_SAMPLERATE_44100 = 44100 |
| 36 } PP_AudioFrame_SampleRate; | 36 } PP_AudioBuffer_SampleRate; |
| 37 | 37 |
| 38 /** | 38 /** |
| 39 * PP_AudioFrame_SampleSize is an enumeration of the different audio sample | 39 * PP_AudioBuffer_SampleSize is an enumeration of the different audio sample |
| 40 * sizes. | 40 * sizes. |
| 41 */ | 41 */ |
| 42 typedef enum { | 42 typedef enum { |
| 43 PP_AUDIOFRAME_SAMPLESIZE_UNKNOWN = 0, | 43 PP_AUDIOBUFFER_SAMPLESIZE_UNKNOWN = 0, |
| 44 PP_AUDIOFRAME_SAMPLESIZE_16_BITS = 2 | 44 PP_AUDIOBUFFER_SAMPLESIZE_16_BITS = 2 |
| 45 } PP_AudioFrame_SampleSize; | 45 } PP_AudioBuffer_SampleSize; |
| 46 /** | 46 /** |
| 47 * @} | 47 * @} |
| 48 */ | 48 */ |
| 49 | 49 |
| 50 /** | 50 /** |
| 51 * @addtogroup Interfaces | 51 * @addtogroup Interfaces |
| 52 * @{ | 52 * @{ |
| 53 */ | 53 */ |
| 54 struct PPB_AudioFrame_0_1 { /* dev */ | 54 struct PPB_AudioBuffer_0_1 { /* dev */ |
| 55 /** | 55 /** |
| 56 * Determines if a resource is an AudioFrame resource. | 56 * Determines if a resource is an AudioBuffer resource. |
| 57 * | 57 * |
| 58 * @param[in] resource The <code>PP_Resource</code> to test. | 58 * @param[in] resource The <code>PP_Resource</code> to test. |
| 59 * | 59 * |
| 60 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given | 60 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given |
| 61 * resource is an AudioFrame resource or <code>PP_FALSE</code> otherwise. | 61 * resource is an AudioBuffer resource or <code>PP_FALSE</code> otherwise. |
| 62 */ | 62 */ |
| 63 PP_Bool (*IsAudioFrame)(PP_Resource resource); | 63 PP_Bool (*IsAudioBuffer)(PP_Resource resource); |
| 64 /** | 64 /** |
| 65 * Gets the timestamp of the audio frame. | 65 * Gets the timestamp of the audio buffer. |
| 66 * | 66 * |
| 67 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame | 67 * @param[in] buffer A <code>PP_Resource</code> corresponding to an audio |
| 68 * resource. | 68 * buffer resource. |
| 69 * | 69 * |
| 70 * @return A <code>PP_TimeDelta</code> containing the timestamp of the audio | 70 * @return A <code>PP_TimeDelta</code> containing the timestamp of the audio |
| 71 * frame. Given in seconds since the start of the containing audio stream. | 71 * buffer. Given in seconds since the start of the containing audio stream. |
| 72 */ | 72 */ |
| 73 PP_TimeDelta (*GetTimestamp)(PP_Resource frame); | 73 PP_TimeDelta (*GetTimestamp)(PP_Resource buffer); |
| 74 /** | 74 /** |
| 75 * Sets the timestamp of the audio frame. | 75 * Sets the timestamp of the audio buffer. |
| 76 * | 76 * |
| 77 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame | 77 * @param[in] buffer A <code>PP_Resource</code> corresponding to an audio |
| 78 * resource. | 78 * buffer resource. |
| 79 * @param[in] timestamp A <code>PP_TimeDelta</code> containing the timestamp | 79 * @param[in] timestamp A <code>PP_TimeDelta</code> containing the timestamp |
| 80 * of the audio frame. Given in seconds since the start of the containing | 80 * of the audio buffer. Given in seconds since the start of the containing |
| 81 * audio stream. | 81 * audio stream. |
| 82 */ | 82 */ |
| 83 void (*SetTimestamp)(PP_Resource frame, PP_TimeDelta timestamp); | 83 void (*SetTimestamp)(PP_Resource buffer, PP_TimeDelta timestamp); |
| 84 /** | 84 /** |
| 85 * Gets the sample rate of the audio frame. | 85 * Gets the sample rate of the audio buffer. |
| 86 * | 86 * |
| 87 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame | 87 * @param[in] buffer A <code>PP_Resource</code> corresponding to an audio |
| 88 * resource. | 88 * buffer resource. |
| 89 * | 89 * |
| 90 * @return The sample rate of the audio frame. | 90 * @return The sample rate of the audio buffer. |
| 91 */ | 91 */ |
| 92 PP_AudioFrame_SampleRate (*GetSampleRate)(PP_Resource frame); | 92 PP_AudioBuffer_SampleRate (*GetSampleRate)(PP_Resource buffer); |
| 93 /** | 93 /** |
| 94 * Gets the sample size of the audio frame. | 94 * Gets the sample size of the audio buffer. |
| 95 * | 95 * |
| 96 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame | 96 * @param[in] buffer A <code>PP_Resource</code> corresponding to an audio |
| 97 * resource. | 97 * buffer resource. |
| 98 * | 98 * |
| 99 * @return The sample size of the audio frame. | 99 * @return The sample size of the audio buffer. |
| 100 */ | 100 */ |
| 101 PP_AudioFrame_SampleSize (*GetSampleSize)(PP_Resource frame); | 101 PP_AudioBuffer_SampleSize (*GetSampleSize)(PP_Resource buffer); |
| 102 /** | 102 /** |
| 103 * Gets the number of channels in the audio frame. | 103 * Gets the number of channels in the audio buffer. |
| 104 * | 104 * |
| 105 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame | 105 * @param[in] buffer A <code>PP_Resource</code> corresponding to an audio |
| 106 * resource. | 106 * buffer resource. |
| 107 * | 107 * |
| 108 * @return The number of channels in the audio frame. | 108 * @return The number of channels in the audio buffer. |
| 109 */ | 109 */ |
| 110 uint32_t (*GetNumberOfChannels)(PP_Resource frame); | 110 uint32_t (*GetNumberOfChannels)(PP_Resource buffer); |
| 111 /** | 111 /** |
| 112 * Gets the number of samples in the audio frame. | 112 * Gets the number of samples in the audio buffer. |
| 113 * | 113 * |
| 114 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame | 114 * @param[in] buffer A <code>PP_Resource</code> corresponding to an audio |
| 115 * resource. | 115 * buffer resource. |
| 116 * | 116 * |
| 117 * @return The number of samples in the audio frame. | 117 * @return The number of samples in the audio buffer. |
| 118 * For example, at a sampling rate of 44,100 Hz in stereo audio, a frame | 118 * For example, at a sampling rate of 44,100 Hz in stereo audio, a buffer |
| 119 * containing 4410 * 2 samples would have a duration of 100 milliseconds. | 119 * containing 4410 * 2 samples would have a duration of 100 milliseconds. |
| 120 */ | 120 */ |
| 121 uint32_t (*GetNumberOfSamples)(PP_Resource frame); | 121 uint32_t (*GetNumberOfSamples)(PP_Resource buffer); |
| 122 /** | 122 /** |
| 123 * Gets the data buffer containing the audio frame samples. | 123 * Gets the data buffer containing the audio samples. |
| 124 * | 124 * |
| 125 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame | 125 * @param[in] buffer A <code>PP_Resource</code> corresponding to an audio |
| 126 * resource. | 126 * buffer resource. |
| 127 * | 127 * |
| 128 * @return A pointer to the beginning of the data buffer. | 128 * @return A pointer to the beginning of the data buffer. |
| 129 */ | 129 */ |
| 130 void* (*GetDataBuffer)(PP_Resource frame); | 130 void* (*GetDataBuffer)(PP_Resource buffer); |
| 131 /** | 131 /** |
| 132 * Gets the size of the data buffer in bytes. | 132 * Gets the size of the data buffer in bytes. |
| 133 * | 133 * |
| 134 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame | 134 * @param[in] buffer A <code>PP_Resource</code> corresponding to an audio |
| 135 * resource. | 135 * buffer resource. |
| 136 * | 136 * |
| 137 * @return The size of the data buffer in bytes. | 137 * @return The size of the data buffer in bytes. |
| 138 */ | 138 */ |
| 139 uint32_t (*GetDataBufferSize)(PP_Resource frame); | 139 uint32_t (*GetDataBufferSize)(PP_Resource buffer); |
| 140 }; | 140 }; |
| 141 /** | 141 /** |
| 142 * @} | 142 * @} |
| 143 */ | 143 */ |
| 144 | 144 |
| 145 #endif /* PPAPI_C_PPB_AUDIO_FRAME_H_ */ | 145 #endif /* PPAPI_C_PPB_AUDIO_BUFFER_H_ */ |
| 146 | 146 |
| OLD | NEW |