summaryrefslogtreecommitdiff
path: root/src/codecs/include
diff options
context:
space:
mode:
authorailurux <ailuruxx@gmail.com>2023-07-08 12:58:07 +1000
committerailurux <ailuruxx@gmail.com>2023-07-08 12:58:07 +1000
commit3de310f6e4c170c4c4bfb789cb07ca10e5ab17b8 (patch)
tree0d13d6efa758b8c029a35c73405529dcadde3788 /src/codecs/include
parentdaa3013836d619d920db3a9dc1f9cc988047a4b4 (diff)
parent8f8bc1f088b389a683735d626cbce9adb1f6dc17 (diff)
downloadtangara-fw-3de310f6e4c170c4c4bfb789cb07ca10e5ab17b8.tar.gz
Merge branch 'main' of git.sr.ht:~jacqueline/tangara-fw
Diffstat (limited to 'src/codecs/include')
-rw-r--r--src/codecs/include/codec.hpp4
-rw-r--r--src/codecs/include/mad.hpp2
2 files changed, 6 insertions, 0 deletions
diff --git a/src/codecs/include/codec.hpp b/src/codecs/include/codec.hpp
index 4b5ab47f..299b16e4 100644
--- a/src/codecs/include/codec.hpp
+++ b/src/codecs/include/codec.hpp
@@ -7,6 +7,7 @@
#pragma once
#include <stdint.h>
+#include <sys/_stdint.h>
#include <cstddef>
#include <cstdint>
@@ -50,6 +51,9 @@ class ICodec {
uint8_t num_channels;
uint8_t bits_per_sample;
uint32_t sample_rate_hz;
+
+ std::optional<uint32_t> duration_seconds;
+ std::optional<uint32_t> bits_per_second;
};
/*
diff --git a/src/codecs/include/mad.hpp b/src/codecs/include/mad.hpp
index d2643230..fbae560c 100644
--- a/src/codecs/include/mad.hpp
+++ b/src/codecs/include/mad.hpp
@@ -42,6 +42,8 @@ class MadMp3Decoder : public ICodec {
-> Result<void> override;
private:
+ auto GetVbrLength(const mad_header& header) -> std::optional<uint32_t>;
+
mad_stream stream_;
mad_frame frame_;
mad_synth synth_;