]> git.sesse.net Git - nageru/blobdiff - nageru/mixer.cpp
Allow dynamic frame sizes for FFmpeg inputs.
[nageru] / nageru / mixer.cpp
index 78f9ebfcb497d52486db9a7c4430515ce653642c..e766d8864d89023d2d451bc75107ef1d5630c340 100644 (file)
@@ -409,7 +409,7 @@ Mixer::Mixer(const QSurfaceFormat &format)
        }
 
        // Must be instantiated after VideoEncoder has initialized global_flags.use_zerocopy.
-       theme.reset(new Theme(global_flags.theme_filename, global_flags.theme_dirs, resource_pool.get()));
+       theme.reset(new Theme(global_flags.theme_filename, global_flags.theme_dirs, resource_pool.get(), create_surface(format)));
 
        // Must be instantiated after the theme, as the theme decides the number of FFmpeg inputs.
        std::vector<FFmpegCapture *> video_inputs = theme->get_video_inputs();
@@ -1610,7 +1610,7 @@ void Mixer::handle_hotplugged_cards()
                                fprintf(stderr, "New SRT stream connected (%s), choosing slot %d.\n", stream_id.c_str(), free_card_index);
                        }
                        CaptureCard *card = &cards[free_card_index];
-                       FFmpegCapture *capture = new FFmpegCapture(sock, stream_id);
+                       FFmpegCapture *capture = new FFmpegCapture(sock, stream_id, create_surface_with_same_format(mixer_surface));
                        capture->set_card_index(free_card_index);
                        configure_card(free_card_index, capture, CardType::FFMPEG_INPUT, /*output=*/nullptr, /*is_srt_card=*/true);
                        card->srt_metrics.update_srt_stats(sock);  // Initial zero stats.