Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Side by Side Diff: ppapi/cpp/audio_frame.h

Issue 140783004: [PPAPI] Pepper MediaStream API audio track implementation and example. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix review issues Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ppapi/c/ppb_audio_frame.h ('k') | ppapi/cpp/audio_frame.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef PPAPI_CPP_AUDIO_FRAME_H_ 5 #ifndef PPAPI_CPP_AUDIO_FRAME_H_
6 #define PPAPI_CPP_AUDIO_FRAME_H_ 6 #define PPAPI_CPP_AUDIO_FRAME_H_
7 7
8 #include "ppapi/c/ppb_audio_frame.h" 8 #include "ppapi/c/ppb_audio_frame.h"
9 #include "ppapi/cpp/resource.h" 9 #include "ppapi/cpp/resource.h"
10 10
(...skipping 29 matching lines...) Expand all
40 /// frame. Given in seconds since the start of the containing audio stream. 40 /// frame. Given in seconds since the start of the containing audio stream.
41 PP_TimeDelta GetTimestamp() const; 41 PP_TimeDelta GetTimestamp() const;
42 42
43 /// Sets the timestamp of the audio frame. 43 /// Sets the timestamp of the audio frame.
44 /// 44 ///
45 /// @param[in] timestamp A <code>PP_TimeDelta</code> containing the timestamp 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 46 /// of the audio frame. Given in seconds since the start of the containing
47 /// audio stream. 47 /// audio stream.
48 void SetTimestamp(PP_TimeDelta timestamp); 48 void SetTimestamp(PP_TimeDelta timestamp);
49 49
50 /// Gets the sample rate of the audio frame.
51 ///
52 /// @return The sample rate of the audio frame.
53 PP_AudioFrame_SampleRate GetSampleRate() const;
54
50 /// Gets the sample size of the audio frame in bytes. 55 /// Gets the sample size of the audio frame in bytes.
51 /// 56 ///
52 /// @return The sample size of the audio frame in bytes. 57 /// @return The sample size of the audio frame in bytes.
53 uint32_t GetSampleSize() const; 58 PP_AudioFrame_SampleSize GetSampleSize() const;
54 59
55 /// Gets the number of channels in the audio frame. 60 /// Gets the number of channels in the audio frame.
56 /// 61 ///
57 /// @return The number of channels in the audio frame. 62 /// @return The number of channels in the audio frame.
58 uint32_t GetNumberOfChannels() const; 63 uint32_t GetNumberOfChannels() const;
59 64
60 /// Gets the number of samples in the audio frame. 65 /// Gets the number of samples in the audio frame.
61 /// 66 ///
62 /// @return The number of samples in the audio frame. 67 /// @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 68 /// 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. 69 /// containing 4,410 * 2 samples would have a duration of 100 milliseconds.
65 uint32_t GetNumberOfSamples() const; 70 uint32_t GetNumberOfSamples() const;
66 71
67 /// Gets the data buffer containing the audio frame samples. 72 /// Gets the data buffer containing the audio frame samples.
68 /// 73 ///
69 /// @return A pointer to the beginning of the data buffer. 74 /// @return A pointer to the beginning of the data buffer.
70 void* GetDataBuffer(); 75 void* GetDataBuffer();
71 76
72 /// Gets the size of data buffer in bytes. 77 /// Gets the size of data buffer in bytes.
73 /// 78 ///
74 /// @return The size of the data buffer in bytes. 79 /// @return The size of the data buffer in bytes.
75 uint32_t GetDataBufferSize() const; 80 uint32_t GetDataBufferSize() const;
76 }; 81 };
77 82
78 } // namespace pp 83 } // namespace pp
79 84
80 #endif // PPAPI_CPP_AUDIO_FRAME_H_ 85 #endif // PPAPI_CPP_AUDIO_FRAME_H_
OLDNEW
« no previous file with comments | « ppapi/c/ppb_audio_frame.h ('k') | ppapi/cpp/audio_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698