]> git.sesse.net Git - nageru/blobdiff - nageru/mixer.cpp
Fix a Clang 19 warning.
[nageru] / nageru / mixer.cpp
index ca16dab1b54f72f8d475016578bf35d5c198c593..b986ed5fd8c28698346c279d6ebd1108c40539cf 100644 (file)
@@ -1,9 +1,16 @@
-#undef Success
-
 #include "mixer.h"
 
+#include <X11/Xlib.h>
+#include <algorithm>
 #include <assert.h>
+#include <chrono>
+#include <condition_variable>
 #include <epoxy/egl.h>
+#include <functional>
+#include <iterator>
+#include <map>
+#include <math.h>
+#include <memory>
 #include <movit/effect.h>
 #include <movit/effect_chain.h>
 #include <movit/effect_util.h>
 #include <movit/image_format.h>
 #include <movit/init.h>
 #include <movit/resource_pool.h>
+#include <movit/util.h>
+#include <movit/ycbcr.h>
+#include <movit/ycbcr_input.h>
+#include <mutex>
+#include <netinet/in.h>
 #include <pthread.h>
+#include <stddef.h>
+#include <stdint.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <algorithm>
-#include <chrono>
-#include <condition_variable>
-#include <cstddef>
-#include <cstdint>
-#include <memory>
-#include <mutex>
-#include <ratio>
+#include <string.h>
 #include <string>
+#include <sys/socket.h>
+#include <sys/syslog.h>
 #include <thread>
 #include <utility>
 #include <vector>
 #include "DeckLinkAPI.h"
 #include "LinuxCOM.h"
 #include "alsa_output.h"
+#include "audio_mixer.h"
 #include "basic_stats.h"
 #include "bmusb/bmusb.h"
 #include "bmusb/fake_capture.h"
 #ifdef HAVE_CEF
+#undef LOG_INFO
+#undef LOG_WARNING
 #include "cef_capture.h"
 #endif
+#include "card_type.h"
 #include "chroma_subsampler.h"
-#include "shared/context.h"
 #include "decklink_capture.h"
 #include "decklink_output.h"
 #include "decklink_util.h"
 #include "defs.h"
-#include "shared/disk_space_estimator.h"
 #include "ffmpeg_capture.h"
 #include "flags.h"
 #include "image_input.h"
 #include "input_mapping.h"
-#include "shared/metrics.h"
-#include "shared/va_display.h"
+#include "input_state.h"
+#include "libusb.h"
 #include "mjpeg_encoder.h"
 #include "pbo_frame_allocator.h"
-#include "shared/ref_counted_gl_sync.h"
+#include "queue_length_policy.h"
 #include "resampling_queue.h"
+#include "shared/context.h"
+#include "shared/disk_space_estimator.h"
+#include "shared/metrics.h"
+#include "shared/ref_counted_gl_sync.h"
+#include "shared/shared_defs.h"
 #include "shared/timebase.h"
+#include "theme.h"
 #include "timecode_renderer.h"
 #include "v210_converter.h"
 #include "video_encoder.h"
+#include "ycbcr_interpretation.h"
 
 #undef Status
 #include <google/protobuf/util/json_util.h>
@@ -391,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();
@@ -628,9 +646,6 @@ void Mixer::configure_card(unsigned card_index, CaptureInterface *capture, CardT
                        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) {
-                       card->surface = create_surface_with_same_format(mixer_surface);
-               }
                while (!card->new_frames.empty()) card->new_frames.pop_front();
                card->last_timecode = -1;
                card->capture->set_pixel_format(pixel_format);
@@ -794,7 +809,7 @@ int unwrap_timecode(uint16_t current_wrapped, int last)
 
 void Mixer::bm_frame(unsigned card_index, uint16_t timecode,
                      FrameAllocator::Frame video_frame, size_t video_offset, VideoFormat video_format,
-                    FrameAllocator::Frame audio_frame, size_t audio_offset, AudioFormat audio_format)
+                     FrameAllocator::Frame audio_frame, size_t audio_offset, AudioFormat audio_format)
 {
        DeviceSpec device{InputSourceType::CAPTURE_CARD, card_index};
        CaptureCard *card = &cards[card_index];
@@ -1595,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.