Disable TabDragController tests that fail with a real compositor.
[chromium-blink-merge.git] / ppapi / cpp / audio_frame.h
blob32d55956e67616d0f627799392e98f63f5e15c10
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.
5 #ifndef PPAPI_CPP_AUDIO_FRAME_H_
6 #define PPAPI_CPP_AUDIO_FRAME_H_
8 #include "ppapi/c/ppb_audio_frame.h"
9 #include "ppapi/cpp/resource.h"
11 namespace pp {
13 class AudioFrame : public Resource {
14 public:
15 /// Default constructor for creating an is_null()
16 /// <code>AudioFrame</code> object.
17 AudioFrame();
19 /// The copy constructor for <code>AudioFrame</code>.
20 ///
21 /// @param[in] other A reference to an <code>AudioFrame</code>.
22 AudioFrame(const AudioFrame& other);
24 /// Constructs an <code>AudioFrame</code> from a <code>Resource</code>.
25 ///
26 /// @param[in] resource A <code>PPB_AudioFrame</code> resource.
27 explicit AudioFrame(const Resource& resource);
29 /// A constructor used when you have received a <code>PP_Resource</code> as a
30 /// return value that has had 1 ref added for you.
31 ///
32 /// @param[in] resource A <code>PPB_AudioFrame</code> resource.
33 AudioFrame(PassRef, PP_Resource resource);
35 virtual ~AudioFrame();
37 /// Gets the timestamp of the audio frame.
38 ///
39 /// @return A <code>PP_TimeDelta</code> containing the timestamp of the audio
40 /// frame. Given in seconds since the start of the containing audio stream.
41 PP_TimeDelta GetTimestamp() const;
43 /// Sets the timestamp of the audio frame.
44 ///
45 /// @param[in] timestamp A <code>PP_TimeDelta</code> containing the timestamp
46 /// of the audio frame. Given in seconds since the start of the containing
47 /// audio stream.
48 void SetTimestamp(PP_TimeDelta timestamp);
50 /// Gets the sample size of the audio frame in bytes.
51 ///
52 /// @return The sample size of the audio frame in bytes.
53 uint32_t GetSampleSize() const;
55 /// Gets the number of channels in the audio frame.
56 ///
57 /// @return The number of channels in the audio frame.
58 uint32_t GetNumberOfChannels() const;
60 /// Gets the number of samples in the audio frame.
61 ///
62 /// @return The number of samples in the audio frame.
63 /// For example, at a sampling rate of 44,100 Hz in stereo audio, a frame
64 /// containing 4,410 * 2 samples would have a duration of 100 milliseconds.
65 uint32_t GetNumberOfSamples() const;
67 /// Gets the data buffer containing the audio frame samples.
68 ///
69 /// @return A pointer to the beginning of the data buffer.
70 void* GetDataBuffer();
72 /// Gets the size of data buffer in bytes.
73 ///
74 /// @return The size of the data buffer in bytes.
75 uint32_t GetDataBufferSize() const;
78 } // namespace pp
80 #endif // PPAPI_CPP_AUDIO_FRAME_H_