aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Burk <philburk@mobileer.com>2020-11-12 10:30:40 -0800
committerPhil Burk <philburk@mobileer.com>2020-11-18 10:29:42 -0800
commit32802e368b4eda01bebbadb0ff07dae405282698 (patch)
tree4bf94de6ad5a53f4b5a3883a99eb37cf9fc08acb
parent7b814ba2fcf8badf65b1565c62bafc6561a2cac5 (diff)
downloadoboe-32802e368b4eda01bebbadb0ff07dae405282698.tar.gz
oboe: cleanup new callbacks
Remove dead code and logs.
-rw-r--r--apps/OboeTester/app/src/main/cpp/OboeStreamCallbackProxy.cpp16
-rw-r--r--include/oboe/AudioStreamBase.h3
-rw-r--r--include/oboe/AudioStreamCallback.h2
-rw-r--r--src/aaudio/AudioStreamAAudio.cpp1
-rw-r--r--src/common/AudioSourceCaller.cpp2
-rw-r--r--src/common/FilterAudioStream.cpp3
-rw-r--r--src/common/FilterAudioStream.h4
7 files changed, 5 insertions, 26 deletions
diff --git a/apps/OboeTester/app/src/main/cpp/OboeStreamCallbackProxy.cpp b/apps/OboeTester/app/src/main/cpp/OboeStreamCallbackProxy.cpp
index a17575bf..14f82349 100644
--- a/apps/OboeTester/app/src/main/cpp/OboeStreamCallbackProxy.cpp
+++ b/apps/OboeTester/app/src/main/cpp/OboeStreamCallbackProxy.cpp
@@ -79,19 +79,3 @@ oboe::DataCallbackResult OboeStreamCallbackProxy::onAudioReady(
return callbackResult;
}
-
-// FIXME
-//void OboeStreamCallbackProxy::onErrorBeforeClose(oboe::AudioStream *audioStream, oboe::Result error) {
-// LOGD("OboeStreamCallbackProxy::%s(%p, %d) called", __func__, audioStream, error);
-// mErrorCallbackResult = error;
-// if (mCallback != nullptr) {
-// mCallback->onErrorBeforeClose(audioStream, error);
-// }
-//}
-//
-//void OboeStreamCallbackProxy::onErrorAfterClose(oboe::AudioStream *audioStream, oboe::Result error) {
-// LOGD("OboeStreamCallbackProxy::%s(%p, %d) called", __func__, audioStream, error);
-// if (mCallback != nullptr) {
-// mCallback->onErrorAfterClose(audioStream, error);
-// }
-//}
diff --git a/include/oboe/AudioStreamBase.h b/include/oboe/AudioStreamBase.h
index 73c27dfd..4597c3fb 100644
--- a/include/oboe/AudioStreamBase.h
+++ b/include/oboe/AudioStreamBase.h
@@ -179,9 +179,6 @@ protected:
/** The callback which will be fired when an error or a disconnect occurs. **/
AudioStreamErrorCallback *mErrorCallback = nullptr;
- /** The callback that combines data and error callback. **/
- // AudioStreamCallback *mStreamCallback = nullptr;
-
/** Number of audio frames which will be requested in each callback */
int32_t mFramesPerCallback = kUnspecified;
/** Stream channel count */
diff --git a/include/oboe/AudioStreamCallback.h b/include/oboe/AudioStreamCallback.h
index 0018623d..f40cbaf1 100644
--- a/include/oboe/AudioStreamCallback.h
+++ b/include/oboe/AudioStreamCallback.h
@@ -104,7 +104,7 @@ public:
* It can be used to override and customize the normal error processing.
* Use of this method is considered an advanced technique.
* It might, for example, be used if an app want to use a high level lock when
- * closing and reopening a stream.
+ * closing and reopening a stream.
* Or it might be used when an app want to signal a management thread that handles
* all of the stream state.
*
diff --git a/src/aaudio/AudioStreamAAudio.cpp b/src/aaudio/AudioStreamAAudio.cpp
index 0b7a2e8c..31917148 100644
--- a/src/aaudio/AudioStreamAAudio.cpp
+++ b/src/aaudio/AudioStreamAAudio.cpp
@@ -113,7 +113,6 @@ void AudioStreamAAudio::internalErrorCallback(
aaudio_result_t error) {
oboe::Result oboeResult = static_cast<Result>(error);
AudioStreamAAudio *oboeStream = reinterpret_cast<AudioStreamAAudio*>(userData);
- LOGI("%s() oboeResult = %d", __func__, oboeResult);
oboeStream->mErrorCallbackResult = oboeResult;
// Prevents deletion of the stream if the app is using AudioStreamBuilder::openStream(shared_ptr)
diff --git a/src/common/AudioSourceCaller.cpp b/src/common/AudioSourceCaller.cpp
index 854ade9c..a19cf813 100644
--- a/src/common/AudioSourceCaller.cpp
+++ b/src/common/AudioSourceCaller.cpp
@@ -20,7 +20,7 @@ using namespace oboe;
using namespace flowgraph;
int32_t AudioSourceCaller::onProcessFixedBlock(uint8_t *buffer, int32_t numBytes) {
- oboe::AudioStreamDataCallback *callback = mStream->getDataCallback();
+ AudioStreamDataCallback *callback = mStream->getDataCallback();
int32_t result = 0;
int32_t numFrames = numBytes / mStream->getBytesPerFrame();
if (callback != nullptr) {
diff --git a/src/common/FilterAudioStream.cpp b/src/common/FilterAudioStream.cpp
index bacb54b4..975b03dd 100644
--- a/src/common/FilterAudioStream.cpp
+++ b/src/common/FilterAudioStream.cpp
@@ -100,8 +100,7 @@ DataCallbackResult FilterAudioStream::onAudioReady(AudioStream *oboeStream,
} else {
framesProcessed = mFlowGraph->write(audioData, numFrames);
}
- LOGI("%s() framesProcessed = %d, numFrames = %d", __func__, framesProcessed, numFrames);
return (framesProcessed < numFrames)
? DataCallbackResult::Stop
: mFlowGraph->getDataCallbackResult();
-} \ No newline at end of file
+}
diff --git a/src/common/FilterAudioStream.h b/src/common/FilterAudioStream.h
index be652c9d..9aa9d649 100644
--- a/src/common/FilterAudioStream.h
+++ b/src/common/FilterAudioStream.h
@@ -42,10 +42,10 @@ public:
: AudioStream(builder)
, mChildStream(childStream) {
// Intercept the callback if used.
- if (builder.getErrorCallback() != nullptr) {
+ if (builder.isErrorCallbackSpecified()) {
mErrorCallback = mChildStream->swapErrorCallback(this);
}
- if (builder.getDataCallback() != nullptr) {
+ if (builder.isDataCallbackSpecified()) {
mDataCallback = mChildStream->swapDataCallback(this);
} else {
const int size = childStream->getFramesPerBurst() * childStream->getBytesPerFrame();