summaryrefslogtreecommitdiff
path: root/src/codecs/include/ogg.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/codecs/include/ogg.hpp')
-rw-r--r--src/codecs/include/ogg.hpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/codecs/include/ogg.hpp b/src/codecs/include/ogg.hpp
new file mode 100644
index 00000000..2d6ea8c5
--- /dev/null
+++ b/src/codecs/include/ogg.hpp
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2023 jacqueline <me@jacqueline.id.au>
+ *
+ * SPDX-License-Identifier: GPL-3.0-only
+ */
+
+#pragma once
+
+#include <sys/_stdint.h>
+#include <cstddef>
+#include <cstdint>
+#include <optional>
+
+#include "ogg/ogg.h"
+#include "span.hpp"
+
+namespace codecs {
+
+class OggContainer {
+ public:
+ OggContainer();
+ ~OggContainer();
+
+ auto AddBytes(cpp::span<const std::byte>) -> void;
+ auto HasNextPacket() -> bool;
+ auto NextPacket() -> cpp::span<uint8_t>;
+ auto PeekPacket() -> cpp::span<uint8_t>;
+
+ private:
+ ogg_sync_state sync_;
+ ogg_stream_state stream_;
+ ogg_page page_;
+ ogg_packet packet_;
+};
+
+} // namespace codecs \ No newline at end of file