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. | |
bbudge
2014/01/09 19:03:22
I think the first sentence is enough here, since y
Peng
2014/01/09 19:47:48
Done.
| |
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) | |
yzshen1
2014/01/09 19:27:45
nit: maybe we don't have to have the last sentence
Peng
2014/01/09 19:47:48
Done.
| |
54 * right now. | |
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 channels in the audio frame. | |
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 example, at a sampling rate of 44,100 Hz in stereo audio, a frame | |
76 * containing 4410 * 2 samples would have a duration of 100 millisecond. | |
bbudge
2014/01/09 19:03:22
s/millisecond/milliseconds
Peng
2014/01/09 19:47:48
Done.
Peng
2014/01/09 19:47:48
Done.
| |
77 */ | |
78 uint32_t GetNumberOfSamples([in] PP_Resource frame); | |
79 | |
80 /** | |
81 * Gets the data buffer for audio frame samples. | |
bbudge
2014/01/09 19:03:22
s/for/containing the
Peng
2014/01/09 19:47:48
Done.
| |
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 the data buffer in bytes. | |
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 |