summaryrefslogtreecommitdiff
path: root/src/fmt/nut.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/fmt/nut.h')
-rw-r--r--src/fmt/nut.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/fmt/nut.h b/src/fmt/nut.h
new file mode 100644
index 0000000..383eaad
--- /dev/null
+++ b/src/fmt/nut.h
@@ -0,0 +1,46 @@
+#ifndef ANIMTOOL_NUT_H_
+#define ANIMTOOL_NUT_H_
+
+#include <stdio.h>
+#include "util/str.h"
+#include "util/container.h"
+
+enum nut_output_type : uint8_t {
+ NUT_OUT_FILE,
+ NUT_OUT_STATIC,
+ NUT_OUT_HEAP,
+};
+
+struct nut_output
+{
+ enum nut_output_type type;
+ size_t len;
+ union {
+ FILE *file;
+ struct {
+ size_t cap;
+ char *ptr;
+ };
+ };
+};
+
+struct nut_syncp_off
+{
+ size_t off;
+ size_t num;
+};
+
+struct nut_writer
+{
+ struct nut_output out;
+ size_t frame_size;
+ size_t last_syncpoint;
+ size_t n_frame;
+ arraybuf(struct nut_syncp_off) syncp_offs;
+};
+
+void nut_write_start(struct nut_writer *wr, FILE *f, unsigned int fps, unsigned int size[2]);
+void nut_write_frame(struct nut_writer *wr, void *data);
+void nut_write_end(struct nut_writer *wr);
+
+#endif