new cspot/bell

This commit is contained in:
philippe44
2023-05-06 23:50:26 +02:00
parent e0e7e718ba
commit 8bad480112
163 changed files with 6611 additions and 6739 deletions

View File

@@ -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