4#include "AudioTools/AudioCodecs/AudioCodecsBase.h"
5#include "AudioTools/CoreAudio/AudioBasic/StrView.h"
6#include "AudioTools/CoreAudio/AudioHttp/AbstractURLStream.h"
7#include "AudioTools/CoreAudio/AudioMetaData/MimeDetector.h"
8#include "AudioTools/AudioCodecs/StreamingDecoder.h"
60 #ifdef USE_EXPERIMENTAL
68 for (
auto* adapter : adapters) {
86 if (p_print ==
nullptr) {
87 LOGE(
"No output defined");
138 bool (*check)(uint8_t* data,
size_t len)) {
152 p_print = &out_stream;
185 if (mime ==
nullptr)
return false;
196 for (
int j = 0; j <
decoders.size(); j++) {
199 LOGI(
"Using decoder for %s (%s)", info.
mime, mime);
241 size_t write(
const uint8_t* data,
size_t len)
override {
243 const char* mime =
nullptr;
247 if (mime) LOGI(
"mime from http request: %s", mime);
249 if (mime ==
nullptr) {
253 if (mime) LOGI(
"mime from mime_detector: %s", mime);
255 if (mime !=
nullptr) {
258 LOGE(
"The decoder could not be found for %s", mime);
277 virtual operator bool()
override {
294 LOGE(
"No decoder defined, cannot set codec config");
311#ifdef USE_EXPERIMENTAL
326 int bufferSize = 1024) {
327 if (mime !=
nullptr) {
331 adapters.push_back(adapter);
336 LOGE(
"MIME type is nullptr - cannot add StreamingDecoder");
368#ifdef USE_EXPERIMENTAL