17#ifndef OBOE_STREAM_BASE_H_
18#define OBOE_STREAM_BASE_H_
22#include "oboe/AudioStreamCallback.h"
23#include "oboe/Definitions.h"
199 return mChannelConversionAllowed;
206 return mFormatConversionAllowed;
213 return mSampleRateConversionQuality;
241 std::shared_ptr<AudioStreamDataCallback> mSharedDataCallback;
245 std::shared_ptr<AudioStreamErrorCallback> mSharedErrorCallback;
265 AudioFormat
mFormat = AudioFormat::Unspecified;
306 bool mChannelConversionAllowed =
false;
308 bool mFormatConversionAllowed =
false;
310 SampleRateConversionQuality mSampleRateConversionQuality = SampleRateConversionQuality::Medium;
315 case AudioFormat::Unspecified:
316 case AudioFormat::I16:
317 case AudioFormat::Float:
318 case AudioFormat::I24:
319 case AudioFormat::I32:
320 case AudioFormat::IEC61937:
324 return Result::ErrorInvalidFormat;
327 switch (mSampleRateConversionQuality) {
328 case SampleRateConversionQuality::None:
329 case SampleRateConversionQuality::Fastest:
330 case SampleRateConversionQuality::Low:
331 case SampleRateConversionQuality::Medium:
332 case SampleRateConversionQuality::High:
333 case SampleRateConversionQuality::Best:
336 return Result::ErrorIllegalArgument;
Definition AudioStreamBase.h:30
int32_t mHardwareSampleRate
Definition AudioStreamBase.h:301
int32_t getDeviceId() const
Definition AudioStreamBase.h:106
Usage getUsage() const
Definition AudioStreamBase.h:143
AudioFormat mHardwareFormat
Definition AudioStreamBase.h:303
SpatializationBehavior mSpatializationBehavior
Definition AudioStreamBase.h:296
AudioStreamDataCallback * getDataCallback() const
Definition AudioStreamBase.h:112
SampleRateConversionQuality getSampleRateConversionQuality() const
Definition AudioStreamBase.h:212
InputPreset mInputPreset
Definition AudioStreamBase.h:278
SharingMode getSharingMode() const
Definition AudioStreamBase.h:96
int32_t mDeviceId
Definition AudioStreamBase.h:254
Direction mDirection
Definition AudioStreamBase.h:267
PerformanceMode getPerformanceMode() const
Definition AudioStreamBase.h:101
int32_t mFramesPerCallback
Definition AudioStreamBase.h:248
int32_t mBufferSizeInFrames
Definition AudioStreamBase.h:258
PrivacySensitiveMode getPrivacySensitiveMode() const
Definition AudioStreamBase.h:193
AudioFormat getHardwareFormat() const
Definition AudioStreamBase.h:236
Usage mUsage
Definition AudioStreamBase.h:272
InputPreset getInputPreset() const
Definition AudioStreamBase.h:153
virtual Result isValidConfig()
Definition AudioStreamBase.h:313
ContentType mContentType
Definition AudioStreamBase.h:274
int32_t mChannelCount
Definition AudioStreamBase.h:250
PrivacySensitiveMode mPrivacySensitiveMode
Definition AudioStreamBase.h:286
int32_t getHardwareSampleRate() const
Definition AudioStreamBase.h:231
AudioStreamDataCallback * mDataCallback
Definition AudioStreamBase.h:240
AllowedCapturePolicy mAllowedCapturePolicy
Definition AudioStreamBase.h:283
Direction getDirection() const
Definition AudioStreamBase.h:58
AudioStreamErrorCallback * getErrorCallback() const
Definition AudioStreamBase.h:120
AudioFormat mFormat
Definition AudioStreamBase.h:265
int32_t mHardwareChannelCount
Definition AudioStreamBase.h:299
int32_t getChannelCount() const
Definition AudioStreamBase.h:53
int32_t getFramesPerCallback() const
Definition AudioStreamBase.h:68
ChannelMask getChannelMask() const
Definition AudioStreamBase.h:219
int32_t mSampleRate
Definition AudioStreamBase.h:252
bool isDataCallbackSpecified() const
Definition AudioStreamBase.h:127
bool mIsContentSpatialized
Definition AudioStreamBase.h:294
bool isContentSpatialized() const
Definition AudioStreamBase.h:163
SessionId getSessionId() const
Definition AudioStreamBase.h:158
ChannelMask mChannelMask
Definition AudioStreamBase.h:260
bool isChannelConversionAllowed() const
Definition AudioStreamBase.h:198
AudioStreamBase(const AudioStreamBase &)=default
ContentType getContentType() const
Definition AudioStreamBase.h:148
virtual int32_t getBufferCapacityInFrames() const
Definition AudioStreamBase.h:91
AudioFormat getFormat() const
Definition AudioStreamBase.h:78
PerformanceMode mPerformanceMode
Definition AudioStreamBase.h:269
int32_t getFramesPerDataCallback() const
Definition AudioStreamBase.h:73
SessionId mSessionId
Definition AudioStreamBase.h:280
std::string mPackageName
Definition AudioStreamBase.h:289
int32_t mBufferCapacityInFrames
Definition AudioStreamBase.h:256
bool isFormatConversionAllowed() const
Definition AudioStreamBase.h:205
AllowedCapturePolicy getAllowedCapturePolicy() const
Definition AudioStreamBase.h:180
int32_t getHardwareChannelCount() const
Definition AudioStreamBase.h:226
AudioStreamErrorCallback * mErrorCallback
Definition AudioStreamBase.h:244
SpatializationBehavior getSpatializationBehavior() const
Definition AudioStreamBase.h:168
AudioStreamBase & operator=(const AudioStreamBase &)=default
std::string mAttributionTag
Definition AudioStreamBase.h:291
SharingMode mSharingMode
Definition AudioStreamBase.h:263
int32_t getSampleRate() const
Definition AudioStreamBase.h:63
bool isErrorCallbackSpecified() const
Definition AudioStreamBase.h:136
virtual int32_t getBufferSizeInFrames()
Definition AudioStreamBase.h:86
Definition AudioStreamCallback.h:34
Definition AudioStreamCallback.h:102
Definition ResultWithValue.h:47