Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommend not calling getTimestamp() from callback #1499

Merged
merged 1 commit into from
Mar 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions include/oboe/AudioStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ class AudioStream : public AudioStreamBase {
* The latency of an OUTPUT stream is generally higher than the INPUT latency
* because an app generally tries to keep the OUTPUT buffer full and the INPUT buffer empty.
*
* Note that due to issues in Android before R, we recommend NOT calling
* this method from a data callback. See this tech note for more details.
* https://github.com/google/oboe/blob/master/docs/notes/rlsbuffer.md
*
* @return a ResultWithValue which has a result of Result::OK and a value containing the latency
* in milliseconds, or a result of Result::Error*.
*/
Expand All @@ -280,6 +284,10 @@ class AudioStream : public AudioStreamBase {
* The time is based on the implementation's best effort, using whatever knowledge is available
* to the system, but cannot account for any delay unknown to the implementation.
*
* Note that due to issues in Android before R, we recommend NOT calling
* this method from a data callback. See this tech note for more details.
* https://github.com/google/oboe/blob/master/docs/notes/rlsbuffer.md
*
* @deprecated since 1.0, use AudioStream::getTimestamp(clockid_t clockId) instead, which
* returns ResultWithValue
* @param clockId the type of clock to use e.g. CLOCK_MONOTONIC
Expand All @@ -303,6 +311,11 @@ class AudioStream : public AudioStreamBase {
* The time is based on the implementation's best effort, using whatever knowledge is available
* to the system, but cannot account for any delay unknown to the implementation.
*
* Note that due to issues in Android before R, we recommend NOT calling
* this method from a data callback. See this tech note for more details.
* https://github.com/google/oboe/blob/master/docs/notes/rlsbuffer.md
*
* See
* @param clockId the type of clock to use e.g. CLOCK_MONOTONIC
* @return a FrameTimestamp containing the position and time at which a particular audio frame
* entered or left the audio processing pipeline, or an error if the operation failed.
Expand Down