OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CONFIG_H_ | 5 #ifndef PPAPI_CPP_AUDIO_CONFIG_H_ |
6 #define PPAPI_CPP_AUDIO_CONFIG_H_ | 6 #define PPAPI_CPP_AUDIO_CONFIG_H_ |
7 | 7 |
8 #include "ppapi/c/ppb_audio_config.h" | 8 #include "ppapi/c/ppb_audio_config.h" |
9 #include "ppapi/c/pp_stdint.h" | 9 #include "ppapi/c/pp_stdint.h" |
10 #include "ppapi/cpp/resource.h" | 10 #include "ppapi/cpp/resource.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 /// than <code>PP_AUDIOMINSAMPLEFRAMECOUNT</code> and greater than | 93 /// than <code>PP_AUDIOMINSAMPLEFRAMECOUNT</code> and greater than |
94 /// <code>PP_AUDIOMAXSAMPLEFRAMECOUNT</code> are never supported on any | 94 /// <code>PP_AUDIOMAXSAMPLEFRAMECOUNT</code> are never supported on any |
95 /// system, but values in between aren't necessarily valid. This function | 95 /// system, but values in between aren't necessarily valid. This function |
96 /// will return a supported count closest to the requested value for use in | 96 /// will return a supported count closest to the requested value for use in |
97 /// the constructor. | 97 /// the constructor. |
98 /// | 98 /// |
99 /// @param[in] instance The instance associated with this resource. | 99 /// @param[in] instance The instance associated with this resource. |
100 /// @param[in] sample_rate A <code>PP_AudioSampleRate</code> which is either | 100 /// @param[in] sample_rate A <code>PP_AudioSampleRate</code> which is either |
101 /// <code>PP_AUDIOSAMPLERATE_44100</code> or | 101 /// <code>PP_AUDIOSAMPLERATE_44100</code> or |
102 /// <code>PP_AUDIOSAMPLERATE_48000</code>. | 102 /// <code>PP_AUDIOSAMPLERATE_48000</code>. |
103 /// @param[in] requested_sample_frame_count A uint_32t requested frame count. | 103 /// @param[in] requested_sample_frame_count A uint32_t requested frame count. |
104 /// | 104 /// |
105 /// @return A uint32_t containing the recommended sample frame count if | 105 /// @return A uint32_t containing the recommended sample frame count if |
106 /// successful. If the sample frame count or bit rate is not supported, | 106 /// successful. If the sample frame count or bit rate is not supported, |
107 /// this function will fail and return 0. | 107 /// this function will fail and return 0. |
108 static uint32_t RecommendSampleFrameCount( | 108 static uint32_t RecommendSampleFrameCount( |
109 const InstanceHandle& instance, | 109 const InstanceHandle& instance, |
110 PP_AudioSampleRate sample_rate, | 110 PP_AudioSampleRate sample_rate, |
111 uint32_t requested_sample_frame_count); | 111 uint32_t requested_sample_frame_count); |
112 | 112 |
113 /// Getter function for returning the internal | 113 /// Getter function for returning the internal |
114 /// <code>PP_AudioSampleRate</code> enum. | 114 /// <code>PP_AudioSampleRate</code> enum. |
115 /// | 115 /// |
116 /// @return The <code>PP_AudioSampleRate</code> enum. | 116 /// @return The <code>PP_AudioSampleRate</code> enum. |
117 PP_AudioSampleRate sample_rate() const { return sample_rate_; } | 117 PP_AudioSampleRate sample_rate() const { return sample_rate_; } |
118 | 118 |
119 /// Getter function for returning the internal sample frame count. | 119 /// Getter function for returning the internal sample frame count. |
120 /// | 120 /// |
121 /// @return A uint32_t containing the sample frame count. | 121 /// @return A uint32_t containing the sample frame count. |
122 uint32_t sample_frame_count() const { return sample_frame_count_; } | 122 uint32_t sample_frame_count() const { return sample_frame_count_; } |
123 | 123 |
124 private: | 124 private: |
125 PP_AudioSampleRate sample_rate_; | 125 PP_AudioSampleRate sample_rate_; |
126 uint32_t sample_frame_count_; | 126 uint32_t sample_frame_count_; |
127 }; | 127 }; |
128 | 128 |
129 } // namespace pp | 129 } // namespace pp |
130 | 130 |
131 #endif // PPAPI_CPP_AUDIO_CONFIG_H_ | 131 #endif // PPAPI_CPP_AUDIO_CONFIG_H_ |
132 | 132 |
OLD | NEW |