mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-11 14:07:11 +03:00
new cspot/bell
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "BaseCodec.h"
|
||||
#include "aacdec.h"
|
||||
#include <stdint.h> // for uint8_t, uint32_t, int16_t
|
||||
|
||||
#include "BaseCodec.h" // for BaseCodec
|
||||
#include "aacdec.h" // for AACFrameInfo, HAACDecoder
|
||||
|
||||
namespace bell {
|
||||
class AudioContainer;
|
||||
|
||||
class AACDecoder : public BaseCodec {
|
||||
private:
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include "BaseCodec.h"
|
||||
#include "AudioContainer.h"
|
||||
#include <memory> // for shared_ptr
|
||||
|
||||
#include "AudioContainer.h" // for AudioContainer
|
||||
#include "BaseCodec.h" // for BaseCodec
|
||||
#include "CodecType.h" // for AudioCodec
|
||||
|
||||
namespace bell {
|
||||
|
||||
class AudioCodecs {
|
||||
public:
|
||||
static std::shared_ptr<BaseCodec> getCodec(AudioCodec type);
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "AudioContainer.h"
|
||||
#include <stdint.h> // for uint32_t, uint8_t
|
||||
|
||||
namespace bell {
|
||||
class AudioContainer;
|
||||
|
||||
class BaseCodec {
|
||||
private:
|
||||
|
||||
@@ -5,48 +5,40 @@
|
||||
#define AAC_READBUF_SIZE (4 * AAC_MAINBUF_SIZE * AAC_MAX_NCHANS)
|
||||
#define MP3_READBUF_SIZE (2 * 1024);
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <memory>
|
||||
#include "aacdec.h"
|
||||
#include "mp3dec.h"
|
||||
#include <stdio.h> // for NULL
|
||||
|
||||
namespace bell
|
||||
{
|
||||
class DecodersInstance
|
||||
{
|
||||
public:
|
||||
DecodersInstance(){};
|
||||
~DecodersInstance()
|
||||
{
|
||||
MP3FreeDecoder(mp3Decoder);
|
||||
AACFreeDecoder(aacDecoder);
|
||||
};
|
||||
#include "aacdec.h" // for AACFreeDecoder, AACInitDecoder, HAACDecoder
|
||||
#include "mp3dec.h" // for MP3FreeDecoder, MP3InitDecoder, HMP3Decoder
|
||||
|
||||
HAACDecoder aacDecoder = NULL;
|
||||
HMP3Decoder mp3Decoder = NULL;
|
||||
namespace bell {
|
||||
class DecodersInstance {
|
||||
public:
|
||||
DecodersInstance(){};
|
||||
~DecodersInstance() {
|
||||
MP3FreeDecoder(mp3Decoder);
|
||||
AACFreeDecoder(aacDecoder);
|
||||
};
|
||||
|
||||
void ensureAAC()
|
||||
{
|
||||
if (aacDecoder == NULL)
|
||||
{
|
||||
aacDecoder = AACInitDecoder();
|
||||
}
|
||||
}
|
||||
HAACDecoder aacDecoder = NULL;
|
||||
HMP3Decoder mp3Decoder = NULL;
|
||||
|
||||
void ensureMP3()
|
||||
{
|
||||
if (mp3Decoder == NULL)
|
||||
{
|
||||
mp3Decoder = MP3InitDecoder();
|
||||
}
|
||||
}
|
||||
};
|
||||
void ensureAAC() {
|
||||
if (aacDecoder == NULL) {
|
||||
aacDecoder = AACInitDecoder();
|
||||
}
|
||||
}
|
||||
|
||||
extern bell::DecodersInstance* decodersInstance;
|
||||
void ensureMP3() {
|
||||
if (mp3Decoder == NULL) {
|
||||
mp3Decoder = MP3InitDecoder();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void createDecoders();
|
||||
}
|
||||
extern bell::DecodersInstance* decodersInstance;
|
||||
|
||||
void createDecoders();
|
||||
} // namespace bell
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "BaseCodec.h"
|
||||
#include "mp3dec.h"
|
||||
#include <stdint.h> // for uint8_t, uint32_t, int16_t
|
||||
|
||||
#include "BaseCodec.h" // for BaseCodec
|
||||
#include "mp3dec.h" // for HMP3Decoder, MP3FrameInfo
|
||||
|
||||
namespace bell {
|
||||
class AudioContainer;
|
||||
|
||||
class MP3Decoder : public BaseCodec {
|
||||
private:
|
||||
HMP3Decoder mp3;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "BaseCodec.h"
|
||||
#include <stdint.h> // for uint8_t, uint32_t, int16_t
|
||||
|
||||
#include "BaseCodec.h" // for BaseCodec
|
||||
|
||||
struct OpusDecoder;
|
||||
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include "BaseCodec.h"
|
||||
#include "ivorbiscodec.h"
|
||||
#include <stdint.h> // for uint8_t, uint32_t, int16_t
|
||||
|
||||
#include "BaseCodec.h" // for BaseCodec
|
||||
#include "ivorbiscodec.h" // for vorbis_comment, vorbis_dsp_state, vorbis_info
|
||||
#include "ogg.h" // for ogg_packet
|
||||
|
||||
namespace bell {
|
||||
class AudioContainer;
|
||||
|
||||
class VorbisDecoder : public BaseCodec {
|
||||
private:
|
||||
vorbis_info* vi = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user