]> git.sesse.net Git - nageru/blobdiff - nageru/defs.h
Fix a Clang 19 warning.
[nageru] / nageru / defs.h
index 8f320e154f8ad243e595cc0e8e765b04d91b965e..369c9b8ba504845a6930738846289bc491a0e52c 100644 (file)
@@ -1,14 +1,23 @@
 #ifndef _DEFS_H
 #define _DEFS_H
 
-#include <libavformat/version.h>
-
 #define TYPICAL_FPS 60
 #define FAKE_FPS 25  // Must be an integer.
 // #define MAX_VIDEO_CARDS 16  // defined in shared_defs.h.
 #define MAX_ALSA_CARDS 16
 #define MAX_BUSES 256  // Audio buses.
-#define FRAME_SIZE (8 << 20)  // 8 MB. (FIXME: Not enough for a 2160p frame!)
+
+// FRAME_SIZE is the default frame size, in bytes. FFmpeg inputs (video files and SRT streams)
+// can allocate larger frames as needed; USB and DeckLink outputs always use FRAME_SIZE.
+// We should eventually add support for at least DeckLink outputs, allowing us to capture
+// 2160p frames. Also, it would allow us to lower the default frame size to the maximum
+// bmusb supports (2 MB just about covers 1080i 4:2:2, then add some for 10-bit?) to waste
+// less memory.
+//
+// As a general sanity check, we also have a MAX_FRAME_SIZE that even dynamic allocation
+// will not go past.
+#define FRAME_SIZE (8 << 20)  // 8 MB (just enough for 1080p RGBA).
+#define MAX_FRAME_SIZE (140 << 20)  // 140 MB; enough for 8192*4320 RGBA and then some.
 
 // For deinterlacing. See also comments on InputState.
 #define FRAME_HISTORY_LENGTH 5
@@ -25,8 +34,6 @@
 #define DEFAULT_SRT_PORT 9710
 #define DEFAULT_SRT_OUTPUT_LATENCY_MS 2000
 
-#include "shared/shared_defs.h"
-
 // In number of frames. Comes in addition to any internal queues in x264
 // (frame threading, lookahead, etc.).
 #define X264_QUEUE_LENGTH 50