]> git.sesse.net Git - nageru/commitdiff
Unify all the FRAME_SIZE #defines.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 17 Apr 2023 16:16:05 +0000 (18:16 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 17 Apr 2023 16:24:07 +0000 (18:24 +0200)
nageru/cef_capture.cpp
nageru/decklink_capture.cpp
nageru/defs.h
nageru/ffmpeg_capture.cpp
nageru/mixer.cpp

index 8837488f5795b4605ac028d32db295ba7d1b0817..95d997c07850b462e8c5a2b8524decf8be89d53a 100644 (file)
@@ -165,8 +165,6 @@ void CEFCapture::OnLoadEnd()
        });
 }
 
-#define FRAME_SIZE (8 << 20)  // 8 MB.
-
 void CEFCapture::configure_card()
 {
        if (video_frame_allocator == nullptr) {
index 722221ea21f3f68a2e1179c958a093188e94cd18..9bf1a0e1a8f66b1889b279c0c075093ad364a065 100644 (file)
@@ -24,8 +24,6 @@
 #include "shared/memcpy_interleaved.h"
 #include "v210_converter.h"
 
-#define FRAME_SIZE (8 << 20)  // 8 MB.
-
 using namespace std;
 using namespace std::chrono;
 using namespace std::placeholders;
index c34c2acab2ce8ecbfa73b0377c17030da97ea6c3..a8817f637ebb550c90521626b612e450f1f06c5e 100644 (file)
@@ -8,6 +8,7 @@
 // #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!)
 
 // For deinterlacing. See also comments on InputState.
 #define FRAME_HISTORY_LENGTH 5
index 5cf1d8c9ec75f35a6932a6bd7a282914c3017d92..96449214a59c8db7d9955918785276133e7e7838 100644 (file)
@@ -44,8 +44,6 @@ extern "C" {
 #include <srt/srt.h>
 #endif
 
-#define FRAME_SIZE (8 << 20)  // 8 MB.
-
 using namespace std;
 using namespace std::chrono;
 using namespace bmusb;
index 9978906a26b6f7d85a540a6ce612371a218248db..d9088fda0d83fdd703f7415dee88f38236b09ca5 100644 (file)
@@ -618,7 +618,7 @@ void Mixer::configure_card(unsigned card_index, CaptureInterface *capture, CardT
        if (is_active) {
                card->capture->set_frame_callback(bind(&Mixer::bm_frame, this, card_index, _1, _2, _3, _4, _5, _6, _7));
                if (card->frame_allocator == nullptr) {
-                       card->frame_allocator.reset(new PBOFrameAllocator(pixel_format, 8 << 20, global_flags.width, global_flags.height, card_index, mjpeg_encoder.get()));  // 8 MB.
+                       card->frame_allocator.reset(new PBOFrameAllocator(pixel_format, FRAME_SIZE, global_flags.width, global_flags.height, card_index, mjpeg_encoder.get()));
                } else {
                        // The format could have changed, but we cannot reset the allocator
                        // and create a new one from scratch, since there may be allocated
@@ -627,7 +627,7 @@ void Mixer::configure_card(unsigned card_index, CaptureInterface *capture, CardT
                        // any old ones as they come back. This takes the mutex while
                        // allocating, but nothing should really be sending frames in there
                        // right now anyway (start_bm_capture() has not been called yet).
-                       card->frame_allocator->reconfigure(pixel_format, 8 << 20, global_flags.width, global_flags.height, card_index, mjpeg_encoder.get());
+                       card->frame_allocator->reconfigure(pixel_format, FRAME_SIZE, global_flags.width, global_flags.height, card_index, mjpeg_encoder.get());
                }
                card->capture->set_video_frame_allocator(card->frame_allocator.get());
                if (card->surface == nullptr) {