diff options
author | Robert Wu <85952307+robertwu1@users.noreply.github.com> | 2023-01-18 22:58:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-18 14:58:10 -0800 |
commit | 1571780fcecd3f3960eba80d974dc11724aae69b (patch) | |
tree | 2236d9078c81277b93c8973390a3a84173dae2ae | |
parent | 5706c39b2eec39f51198124fe79ea7418161e142 (diff) | |
download | oboe-1571780fcecd3f3960eba80d974dc11724aae69b.tar.gz |
Deprecate AudioStreamBuilder.setCallback (#1696)
-rw-r--r-- | include/oboe/AudioStreamBuilder.h | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/include/oboe/AudioStreamBuilder.h b/include/oboe/AudioStreamBuilder.h index 038f128f..033bb336 100644 --- a/include/oboe/AudioStreamBuilder.h +++ b/include/oboe/AudioStreamBuilder.h @@ -431,18 +431,8 @@ public: * <strong>Important: See AudioStreamCallback for restrictions on what may be called * from the callback methods.</strong> * - * When an error callback occurs, the associated stream will be stopped and closed in a separate thread. - * - * A note on why the streamCallback parameter is a raw pointer rather than a smart pointer: - * - * The caller should retain ownership of the object streamCallback points to. At first glance weak_ptr may seem like - * a good candidate for streamCallback as this implies temporary ownership. However, a weak_ptr can only be created - * from a shared_ptr. A shared_ptr incurs some performance overhead. The callback object is likely to be accessed - * every few milliseconds when the stream requires new data so this overhead is something we want to avoid. - * - * This leaves a raw pointer as the logical type choice. The only caveat being that the caller must not destroy - * the callback before the stream has been closed. - * + * @deprecated Call setDataCallback(std::shared_ptr<AudioStreamDataCallback>) and + * setErrorCallback(std::shared_ptr<AudioStreamErrorCallback>) instead. * @param streamCallback * @return pointer to the builder so calls can be chained */ |