8#ifndef META_OCEAN_MEDIA_ANDROID_A_LIVE_AUDIO_H
9#define META_OCEAN_MEDIA_ANDROID_A_LIVE_AUDIO_H
18#include <SLES/OpenSLES.h>
19#include <SLES/OpenSLES_Android.h>
41 friend class ALiveVideoManager;
46 static constexpr SLuint32 numberBuffers_ = 2u;
66 static constexpr size_t stereoChunkElements();
93 inline bool isFull()
const;
99 inline const void* data()
const;
105 inline size_t size()
const;
118 size_t position_ = 0;
150 bool addSamples(
const SampleType sampleType,
const void* data,
const size_t size, SLAndroidSimpleBufferQueueItf bufferQueueInterface);
156 inline bool needNewSamples()
const;
188 size_t positionInFillingChunk_ =
size_t(0);
287 explicit ALiveAudio(
const SLEngineItf& slEngineInterface,
const std::string& url);
338 SLObjectItf slPlayer_ =
nullptr;
341 SLPlayItf slPlayInterface_ =
nullptr;
344 SLAndroidSimpleBufferQueueItf slBufferQueueInterface_ =
nullptr;
347 SLObjectItf slOutputMix_ =
nullptr;
350 SLVolumeItf slVolumeInterface_ =
nullptr;
356 size_t remainingManuallyEnqueuedChunks_ = numberBuffers_;
359 std::atomic<bool> hasBeenStopped_ =
true;
364 constexpr size_t samplesPerSecondMono = 48000;
365 constexpr size_t samplesPerSecondStereo = samplesPerSecondMono * 2;
367 return samplesPerSecondStereo / 50;
372 buffer_.resize(stereoChunkElements());
377 return position_ == stereoChunkElements();
382 return buffer_.data();
This class implements a recursive lock object.
Definition Lock.h:31
This class implements a scoped lock object for recursive lock objects.
Definition Lock.h:135
This class implements a timestamp.
Definition Timestamp.h:36
The namespace covering the entire Ocean framework.
Definition Accessor.h:15