OLD | NEW |
(Empty) | |
| 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 |
| 3 * found in the LICENSE file. |
| 4 */ |
| 5 |
| 6 /* From ppb_audio_frame.idl modified Tue Jan 7 16:08:07 2014. */ |
| 7 |
| 8 #ifndef PPAPI_C_PPB_AUDIO_FRAME_H_ |
| 9 #define PPAPI_C_PPB_AUDIO_FRAME_H_ |
| 10 |
| 11 #include "ppapi/c/pp_bool.h" |
| 12 #include "ppapi/c/pp_macros.h" |
| 13 #include "ppapi/c/pp_resource.h" |
| 14 #include "ppapi/c/pp_stdint.h" |
| 15 #include "ppapi/c/pp_time.h" |
| 16 |
| 17 #define PPB_AUDIOFRAME_INTERFACE_0_1 "PPB_AudioFrame;0.1" /* dev */ |
| 18 /** |
| 19 * @file |
| 20 * Defines the <code>PPB_AudioFrame</code> interface. |
| 21 */ |
| 22 |
| 23 |
| 24 /** |
| 25 * @addtogroup Interfaces |
| 26 * @{ |
| 27 */ |
| 28 struct PPB_AudioFrame_0_1 { /* dev */ |
| 29 /** |
| 30 * Determines if a resource is an AudioFrame resource. |
| 31 * |
| 32 * @param[in] resource The <code>PP_Resource</code> to test. |
| 33 * |
| 34 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given |
| 35 * resource is an AudioFrame resource or <code>PP_FALSE</code> otherwise. |
| 36 */ |
| 37 PP_Bool (*IsAudioFrame)(PP_Resource resource); |
| 38 /** |
| 39 * Gets the timestamp of the audio frame. |
| 40 * |
| 41 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame |
| 42 * resource. |
| 43 * |
| 44 * @return A <code>PP_TimeDelta</code> containing the timestamp of the audio |
| 45 * frame. Given in seconds since the start of the containing audio stream. |
| 46 */ |
| 47 PP_TimeDelta (*GetTimestamp)(PP_Resource frame); |
| 48 /** |
| 49 * Sets the timestamp of the audio frame. Given in seconds since the |
| 50 * start of the containing audio stream. |
| 51 * |
| 52 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame |
| 53 * resource. |
| 54 * @param[in] timestamp A <code>PP_TimeDelta</code> containing the timestamp |
| 55 * of the audio frame. Given in seconds since the start of the containing |
| 56 * audio stream. |
| 57 */ |
| 58 void (*SetTimestamp)(PP_Resource frame, PP_TimeDelta timestamp); |
| 59 /** |
| 60 * Gets the sample size of the audio frame. |
| 61 * |
| 62 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame |
| 63 * resource. |
| 64 * |
| 65 * @return The sample size of the audio frame. It always returns 2 (16 bits) |
| 66 * rignt now. |
| 67 */ |
| 68 uint32_t (*GetSampleSize)(PP_Resource frame); |
| 69 /** |
| 70 * Gets the number of channels in the audio frame. |
| 71 * |
| 72 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame |
| 73 * resource. |
| 74 * |
| 75 * @return The number of channles in the audio frame. |
| 76 */ |
| 77 uint32_t (*GetNumberOfChannels)(PP_Resource frame); |
| 78 /** |
| 79 * Gets the number of samples in the audio frame. |
| 80 * |
| 81 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame |
| 82 * resource. |
| 83 * |
| 84 * @return The number of samples in the audio frame. |
| 85 * For 1 second sample rate 44100 stereo audio frame, the number of samples |
| 86 * should be 1 * 44100 * 2. |
| 87 */ |
| 88 uint32_t (*GetNumberOfSamples)(PP_Resource frame); |
| 89 /** |
| 90 * Gets the data buffer for audio frame samples. |
| 91 * |
| 92 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame |
| 93 * resource. |
| 94 * |
| 95 * @return A pointer to the beginning of the data buffer. |
| 96 */ |
| 97 void* (*GetDataBuffer)(PP_Resource frame); |
| 98 /** |
| 99 * Gets the size of data buffer. |
| 100 * |
| 101 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame |
| 102 * resource. |
| 103 * |
| 104 * @return The size of the data buffer in bytes. |
| 105 */ |
| 106 uint32_t (*GetDataBufferSize)(PP_Resource frame); |
| 107 }; |
| 108 /** |
| 109 * @} |
| 110 */ |
| 111 |
| 112 #endif /* PPAPI_C_PPB_AUDIO_FRAME_H_ */ |
| 113 |
OLD | NEW |