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 /** | |
7 * Defines the <code>PPB_AudioFrame</code> interface. | |
8 */ | |
9 label Chrome { | |
10 [channel=dev] M34 = 0.1 | |
11 }; | |
12 | |
13 interface PPB_AudioFrame { | |
14 /** | |
15 * Determines if a resource is an AudioFrame resource. | |
16 * | |
17 * @param[in] resource The <code>PP_Resource</code> to test. | |
18 * | |
19 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given | |
20 * resource is an AudioFrame resource or <code>PP_FALSE</code> otherwise. | |
21 */ | |
22 PP_Bool IsAudioFrame([in] PP_Resource resource); | |
23 | |
24 /** | |
25 * Gets the timestamp of the audio frame. | |
26 * | |
27 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame | |
28 * resource. | |
29 * | |
30 * @return A <code>PP_TimeDelta</code> containing the timestamp of the audio | |
31 * frame. Given in seconds since the start of the containing audio stream. | |
32 */ | |
33 PP_TimeDelta GetTimestamp([in] PP_Resource frame); | |
34 | |
35 /** | |
36 * Sets the timestamp of the audio frame. Given in seconds since the | |
37 * start of the containing audio stream. | |
38 * | |
39 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame | |
40 * resource. | |
41 * @param[in] timestamp A <code>PP_TimeDelta</code> containing the timestamp | |
42 * of the audio frame. Given in seconds since the start of the containing | |
43 * audio stream. | |
44 */ | |
45 void SetTimestamp([in] PP_Resource frame, [in] PP_TimeDelta timestamp); | |
46 | |
47 /** | |
48 * Gets the sample size of the audio frame. | |
49 * | |
50 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame | |
51 * resource. | |
52 * | |
53 * @return The sample size of the audio frame. It always returns 2 (16 bits) | |
54 * rignt now. | |
dmichael (off chromium)
2014/01/07 22:00:59
rignt->right
Peng
2014/01/07 22:29:27
Done.
| |
55 */ | |
56 uint32_t GetSampleSize([in] PP_Resource frame); | |
57 | |
58 /** | |
59 * Gets the number of channels in the audio frame. | |
60 * | |
61 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame | |
62 * resource. | |
63 * | |
64 * @return The number of channles in the audio frame. | |
dmichael (off chromium)
2014/01/07 22:00:59
channles->channels
Peng
2014/01/07 22:29:27
Done.
| |
65 */ | |
66 uint32_t GetNumberOfChannels([in] PP_Resource frame); | |
67 | |
68 /** | |
69 * Gets the number of samples in the audio frame. | |
70 * | |
71 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame | |
72 * resource. | |
73 * | |
74 * @return The number of samples in the audio frame. | |
75 * For 1 second sample rate 44100 stereo audio frame, the number of samples | |
dmichael (off chromium)
2014/01/07 22:00:59
This is kind of confusingly worded to me. I think
Peng
2014/01/07 22:29:27
Done.
| |
76 * should be 1 * 44100 * 2. | |
77 */ | |
78 uint32_t GetNumberOfSamples([in] PP_Resource frame); | |
79 | |
80 /** | |
81 * Gets the data buffer for audio frame samples. | |
82 * | |
83 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame | |
84 * resource. | |
85 * | |
86 * @return A pointer to the beginning of the data buffer. | |
87 */ | |
88 mem_t GetDataBuffer([in] PP_Resource frame); | |
89 | |
90 /** | |
91 * Gets the size of data buffer. | |
dmichael (off chromium)
2014/01/07 22:00:59
of +the+ data buffer +in bytes+.
Peng
2014/01/07 22:29:27
Done.
| |
92 * | |
93 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame | |
94 * resource. | |
95 * | |
96 * @return The size of the data buffer in bytes. | |
97 */ | |
98 uint32_t GetDataBufferSize([in] PP_Resource frame); | |
99 }; | |
OLD | NEW |