summaryrefslogtreecommitdiff
path: root/src/codecs
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2024-02-14 12:21:33 +1100
committerjacqueline <me@jacqueline.id.au>2024-02-14 12:21:33 +1100
commit7ec0ff2589ffd5774e78f9e6b436ea55be45deb1 (patch)
tree4bc335bf6474bff2babbcbd4690231320b52520f /src/codecs
parentb31bc07555fdd862181d8d6ed551163cea89bc62 (diff)
downloadtangara-fw-7ec0ff2589ffd5774e78f9e6b436ea55be45deb1.tar.gz
Switch to the lowmem tremor branch
in addition to using slightly less memory, this branch also doesn't seem to have the same issues with `-O2` builds that the main branch has.
Diffstat (limited to 'src/codecs')
-rw-r--r--src/codecs/include/vorbis.hpp4
-rw-r--r--src/codecs/vorbis.cpp25
2 files changed, 8 insertions, 21 deletions
diff --git a/src/codecs/include/vorbis.hpp b/src/codecs/include/vorbis.hpp
index 673b67a0..b96a0407 100644
--- a/src/codecs/include/vorbis.hpp
+++ b/src/codecs/include/vorbis.hpp
@@ -14,8 +14,6 @@
#include <utility>
#include "ivorbisfile.h"
-#include "ogg/ogg.h"
-#include "opus.h"
#include "sample.hpp"
#include "span.hpp"
@@ -41,7 +39,7 @@ class TremorVorbisDecoder : public ICodec {
private:
std::shared_ptr<IStream> input_;
- std::unique_ptr<OggVorbis_File> vorbis_;
+ std::unique_ptr<TremorOggVorbis_File> vorbis_;
};
} // namespace codecs
diff --git a/src/codecs/vorbis.cpp b/src/codecs/vorbis.cpp
index c373ebf5..7fb53f1b 100644
--- a/src/codecs/vorbis.cpp
+++ b/src/codecs/vorbis.cpp
@@ -4,31 +4,20 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
-#include "ivorbiscodec.h"
-#include "ivorbisfile.h"
-#include "ogg/config_types.h"
-#include "opus.hpp"
-
-#include <stdint.h>
-#include <sys/_stdint.h>
+#include "vorbis.hpp"
#include <cstdint>
#include <cstring>
#include <optional>
#include "esp_heap_caps.h"
-#include "mad.h"
+#include "esp_log.h"
+#include "ivorbiscodec.h"
+#include "ivorbisfile.h"
#include "codec.hpp"
-#include "esp_log.h"
-#include "ogg/ogg.h"
-#include "opus.h"
-#include "opus_defines.h"
-#include "opus_types.h"
-#include "result.hpp"
#include "sample.hpp"
#include "types.hpp"
-#include "vorbis.hpp"
namespace codecs {
@@ -39,7 +28,7 @@ static size_t read_cb(void* ptr, size_t size, size_t nmemb, void* instance) {
return source->Read({reinterpret_cast<std::byte*>(ptr), size * nmemb});
}
-static int seek_cb(void* instance, ogg_int64_t offset, int whence) {
+static int seek_cb(void* instance, tremor_ogg_int64_t offset, int whence) {
IStream* source = reinterpret_cast<IStream*>(instance);
if (!source->CanSeek()) {
return -1;
@@ -80,8 +69,8 @@ static const ov_callbacks kCallbacks{
TremorVorbisDecoder::TremorVorbisDecoder()
: input_(),
- vorbis_(reinterpret_cast<OggVorbis_File*>(
- heap_caps_malloc(sizeof(OggVorbis_File),
+ vorbis_(reinterpret_cast<TremorOggVorbis_File*>(
+ heap_caps_malloc(sizeof(TremorOggVorbis_File),
MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT))) {}
TremorVorbisDecoder::~TremorVorbisDecoder() {