FastLED 3.9.15
Loading...
Searching...
No Matches

◆ decodeFrame()

int fl::third_party::Mp3HelixDecoder::decodeFrame ( const fl::u8 ** inbuf,
fl::size * bytes_left )

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

65 {
66 if (!mDecoder || !mPcmBuffer) {
68 }
69
70 // Decode one frame
71 int result = MP3Decode(
72 static_cast<HMP3Decoder>(mDecoder),
73 inbuf,
74 bytes_left,
76 0 // useSize = 0 (use default)
77 );
78
79 if (result == ERR_MP3_NONE) {
80 // Get frame info
81 MP3FrameInfo helix_info;
82 MP3GetLastFrameInfo(static_cast<HMP3Decoder>(mDecoder), &helix_info);
83
84 mFrameInfo.bitrate = helix_info.bitrate;
85 mFrameInfo.nChans = helix_info.nChans;
86 mFrameInfo.samprate = helix_info.samprate;
87 mFrameInfo.bitsPerSample = helix_info.bitsPerSample;
88 mFrameInfo.outputSamps = helix_info.outputSamps;
89 mFrameInfo.layer = helix_info.layer;
90 mFrameInfo.version = helix_info.version;
91 }
92
93 return result;
94}
fl::unique_ptr< fl::i16[]> mPcmBuffer
Definition mp3.h:117
@ ERR_MP3_NONE
Definition mp3dec.h:91
@ ERR_MP3_NULL_POINTER
Definition mp3dec.h:96
void * HMP3Decoder
Definition mp3dec.h:88
struct _MP3FrameInfo MP3FrameInfo
int outputSamps
Definition mp3dec.h:113
int bitsPerSample
Definition mp3dec.h:112
int MP3Decode(HMP3Decoder hMP3Decoder, const unsigned char **inbuf, size_t *bytesLeft, short *outbuf, int useSize) FL_NOEXCEPT
Definition mp3dec.hpp:292
void MP3GetLastFrameInfo(HMP3Decoder hMP3Decoder, MP3FrameInfo *mp3FrameInfo) FL_NOEXCEPT
Definition mp3dec.hpp:196
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31
To bit_cast(const From &from) FL_NOEXCEPT
Definition bit_cast.h:48

References fl::bit_cast(), _MP3FrameInfo::bitrate, _MP3FrameInfo::bitsPerSample, ERR_MP3_NONE, ERR_MP3_NULL_POINTER, _MP3FrameInfo::layer, mDecoder, mFrameInfo, fl::third_party::MP3Decode(), fl::third_party::MP3GetLastFrameInfo(), mPcmBuffer, _MP3FrameInfo::nChans, _MP3FrameInfo::outputSamps, _MP3FrameInfo::samprate, and _MP3FrameInfo::version.

Referenced by decode(), and fl::Mp3::parseMp3Info().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: