17#ifndef OBOE_STREAM_BUILDER_H_
18#define OBOE_STREAM_BUILDER_H_
20#include "oboe/Definitions.h"
21#include "oboe/AudioStreamBase.h"
22#include "oboe/Utilities.h"
23#include "ResultWithValue.h"
28 struct StreamDeleterFunctor;
29 using ManagedStream = std::unique_ptr<AudioStream, StreamDeleterFunctor>;
459 mSharedDataCallback =
nullptr;
504 mSharedErrorCallback =
nullptr;
538 mChannelConversionAllowed =
allowed;
550 mFormatConversionAllowed =
allowed;
566 mSampleRateConversionQuality =
quality;
Definition AudioStreamBase.h:30
SpatializationBehavior mSpatializationBehavior
Definition AudioStreamBase.h:296
InputPreset mInputPreset
Definition AudioStreamBase.h:278
int32_t mDeviceId
Definition AudioStreamBase.h:254
Direction mDirection
Definition AudioStreamBase.h:267
int32_t mFramesPerCallback
Definition AudioStreamBase.h:248
Usage mUsage
Definition AudioStreamBase.h:272
ContentType mContentType
Definition AudioStreamBase.h:274
int32_t mChannelCount
Definition AudioStreamBase.h:250
PrivacySensitiveMode mPrivacySensitiveMode
Definition AudioStreamBase.h:286
AudioStreamDataCallback * mDataCallback
Definition AudioStreamBase.h:240
AllowedCapturePolicy mAllowedCapturePolicy
Definition AudioStreamBase.h:283
AudioFormat mFormat
Definition AudioStreamBase.h:265
int32_t mSampleRate
Definition AudioStreamBase.h:252
bool mIsContentSpatialized
Definition AudioStreamBase.h:294
bool isContentSpatialized() const
Definition AudioStreamBase.h:163
ChannelMask mChannelMask
Definition AudioStreamBase.h:260
PerformanceMode mPerformanceMode
Definition AudioStreamBase.h:269
SessionId mSessionId
Definition AudioStreamBase.h:280
std::string mPackageName
Definition AudioStreamBase.h:289
int32_t mBufferCapacityInFrames
Definition AudioStreamBase.h:256
AudioStreamErrorCallback * mErrorCallback
Definition AudioStreamBase.h:244
std::string mAttributionTag
Definition AudioStreamBase.h:291
SharingMode mSharingMode
Definition AudioStreamBase.h:263
Definition AudioStreamBuilder.h:34
AudioStreamBuilder * setSampleRateConversionQuality(SampleRateConversionQuality quality)
Definition AudioStreamBuilder.h:565
AudioStreamBuilder * setChannelMask(ChannelMask channelMask)
Definition AudioStreamBuilder.h:70
static bool isAAudioSupported()
AudioStreamBuilder * setChannelCount(int channelCount)
Definition AudioStreamBuilder.h:51
AudioStreamBuilder * setFramesPerCallback(int framesPerCallback)
Definition AudioStreamBuilder.h:105
AudioStreamBuilder * setAudioApi(AudioApi audioApi)
Definition AudioStreamBuilder.h:189
AudioStreamBuilder * setErrorCallback(AudioStreamErrorCallback *errorCallback)
Definition AudioStreamBuilder.h:502
AudioStreamBuilder * setInputPreset(InputPreset inputPreset)
Definition AudioStreamBuilder.h:291
AudioStreamBuilder * setSessionId(SessionId sessionId)
Definition AudioStreamBuilder.h:320
AudioStreamBuilder * setSpatializationBehavior(SpatializationBehavior spatializationBehavior)
Definition AudioStreamBuilder.h:424
Result openStream(std::shared_ptr< oboe::AudioStream > &stream)
AudioStreamBuilder * setPrivacySensitiveMode(PrivacySensitiveMode privacySensitiveMode)
Definition AudioStreamBuilder.h:388
AudioStreamBuilder * setChannelConversionAllowed(bool allowed)
Definition AudioStreamBuilder.h:537
static bool isAAudioRecommended()
AudioStreamBuilder * setDeviceId(int32_t deviceId)
Definition AudioStreamBuilder.h:346
AudioStreamBuilder * setPackageName(std::string packageName)
Definition AudioStreamBuilder.h:586
AudioStreamBuilder * setSampleRate(int32_t sampleRate)
Definition AudioStreamBuilder.h:97
AudioStreamBuilder * setAllowedCapturePolicy(AllowedCapturePolicy allowedCapturePolicy)
Definition AudioStreamBuilder.h:364
Result openManagedStream(ManagedStream &stream)
AudioStreamBuilder * setDataCallback(std::shared_ptr< AudioStreamDataCallback > sharedDataCallback)
Definition AudioStreamBuilder.h:441
AudioStreamBuilder * setErrorCallback(std::shared_ptr< AudioStreamErrorCallback > sharedErrorCallback)
Definition AudioStreamBuilder.h:486
Result openStream(AudioStream **stream)
AudioStreamBuilder * setUsage(Usage usage)
Definition AudioStreamBuilder.h:253
AudioStreamBuilder * setAttributionTag(std::string attributionTag)
Definition AudioStreamBuilder.h:602
bool willUseAAudio() const
Definition AudioStreamBuilder.h:610
AudioStreamBuilder * setFormatConversionAllowed(bool allowed)
Definition AudioStreamBuilder.h:549
AudioStreamBuilder * setDirection(Direction direction)
Definition AudioStreamBuilder.h:81
AudioStreamBuilder * setSharingMode(SharingMode sharingMode)
Definition AudioStreamBuilder.h:221
AudioStreamBuilder * setFormat(AudioFormat format)
Definition AudioStreamBuilder.h:142
AudioApi getAudioApi() const
Definition AudioStreamBuilder.h:174
AudioStreamBuilder * setPerformanceMode(PerformanceMode performanceMode)
Definition AudioStreamBuilder.h:234
AudioStreamBuilder * setBufferCapacityInFrames(int32_t bufferCapacityInFrames)
Definition AudioStreamBuilder.h:159
AudioStreamBuilder * setContentType(ContentType contentType)
Definition AudioStreamBuilder.h:271
AudioStreamBuilder * setDataCallback(AudioStreamDataCallback *dataCallback)
Definition AudioStreamBuilder.h:457
AudioStreamBuilder * setFramesPerDataCallback(int framesPerCallback)
Definition AudioStreamBuilder.h:131
AudioStreamBuilder * setCallback(AudioStreamCallback *streamCallback)
Definition AudioStreamBuilder.h:521
AudioStreamBuilder * setIsContentSpatialized(bool isContentSpatialized)
Definition AudioStreamBuilder.h:406
Definition AudioStreamCallback.h:187
Definition AudioStreamCallback.h:34
Definition AudioStreamCallback.h:102
Definition AudioStream.h:44
Definition ResultWithValue.h:47
Definition AudioClock.h:24
Usage
Definition Definitions.h:316
PerformanceMode
Definition Definitions.h:233
ContentType
Definition Definitions.h:392
InputPreset
Definition Definitions.h:425
Result
Definition Definitions.h:172
PrivacySensitiveMode
Definition Definitions.h:775
SessionId
Definition Definitions.h:467
AllowedCapturePolicy
Definition Definitions.h:802
SampleRateConversionQuality
Definition Definitions.h:279
SharingMode
Definition Definitions.h:208
AudioApi
Definition Definitions.h:254
AudioFormat
Definition Definitions.h:93
ChannelMask
Definition Definitions.h:526
Direction
Definition Definitions.h:77
SpatializationBehavior
Definition Definitions.h:748