FastLED 3.10.8
Loading...
Searching...
No Matches

◆ begin()

bool fl::third_party::Mp3StreamDecoderImpl::begin ( fl::filebuf_ptr stream)

Definition at line 329 of file mp3.cpp.hpp.

329 {
330 if (!stream) {
331 mErrorMsg = "Invalid stream provided";
332 mHasError = true;
333 return false;
334 }
335
336 mStream = stream;
338 if (!mDecoder->init()) {
339 mErrorMsg = "Failed to initialize MP3 decoder";
340 mHasError = true;
341 mDecoder.reset();
342 return false;
343 }
344
347 if (!mBuffer) {
348 mErrorMsg = "Failed to allocate MP3 stream buffer";
349 mHasError = true;
350 mDecoder.reset();
351 return false;
352 }
353 mBufferPos = 0;
354 mBufferFilled = 0;
355 mBytesProcessed = 0;
356 mHasError = false;
357 mEndOfStream = false;
358 mHasDecodedFirstFrame = false;
360
361 return true;
362}
fl::unique_ptr< fl::u8[], Mp3MemoryDeleter< fl::u8 > > mBuffer
Definition mp3.cpp.hpp:306
static constexpr fl::size BUFFER_SIZE
Definition mp3.cpp.hpp:282
fl::unique_ptr< Mp3SelectedDecoder > mDecoder
Definition mp3.cpp.hpp:305
fl::enable_if<!fl::is_array< T >::value, unique_ptr< T > >::type make_unique(Args &&... args) FL_NO_EXCEPT
Definition unique_ptr.h:263
T * Mp3MemoryAllocateArray(fl::size count, Mp3MemoryTag tag) FL_NO_EXCEPT
Definition mp3.cpp.hpp:16

References BUFFER_SIZE, fl::FL_NO_EXCEPT, fl::adl_barrier::make_unique(), mBuffer, mBufferFilled, mBufferPos, mBytesProcessed, mDecoder, mEndOfStream, mErrorMsg, mHasDecodedFirstFrame, mHasError, fl::third_party::Mp3MemoryAllocateArray(), mStream, resetVbrState(), and fl::third_party::StreamBuffer.

+ Here is the call graph for this function: