]> git.sesse.net Git - nageru/blobdiff - nageru/mixer.h
Support SRT inputs.
[nageru] / nageru / mixer.h
index 61db4a5c30857b06728d8dee0810a6caf3a06df1..ff8a197bccdd61c6af9de3598f6239e6645553d5 100644 (file)
@@ -331,6 +331,12 @@ public:
 
        bool card_is_ffmpeg(unsigned card_index) const {
                assert(card_index < num_cards + num_video_inputs);
+               if (card_index < num_cards) {
+                       // SRT inputs are more like regular inputs than FFmpeg inputs,
+                       // so show them as such. (This allows the user to right-click
+                       // to select a different input.)
+                       return false;
+               }
                return cards[card_index].type == CardType::FFMPEG_INPUT;
        }
 
@@ -439,7 +445,7 @@ private:
                FFMPEG_INPUT,
                CEF_INPUT,
        };
-       void configure_card(unsigned card_index, bmusb::CaptureInterface *capture, CardType card_type, DeckLinkOutput *output);
+       void configure_card(unsigned card_index, bmusb::CaptureInterface *capture, CardType card_type, DeckLinkOutput *output, bool override_ffmpeg_to_live = false);
        void set_output_card_internal(int card_index);  // Should only be called from the mixer thread.
        void bm_frame(unsigned card_index, uint16_t timecode,
                bmusb::FrameAllocator::Frame video_frame, size_t video_offset, bmusb::VideoFormat video_format,
@@ -454,6 +460,9 @@ private:
        void render_one_frame(int64_t duration);
        void audio_thread_func();
        void release_display_frame(DisplayFrame *frame);
+#ifdef HAVE_SRT
+       void start_srt();
+#endif
        double pts() { return double(pts_int) / TIMEBASE; }
        void trim_queue(CaptureCard *card, size_t safe_queue_length);
        std::pair<std::string, std::string> get_channels_json();
@@ -595,6 +604,9 @@ private:
        // Protected by its own mutex.
        std::mutex hotplug_mutex;
        std::vector<libusb_device *> hotplugged_cards;
+#ifdef HAVE_SRT
+       std::vector<int> hotplugged_srt_cards;
+#endif
 
        class OutputChannel {
        public:
@@ -627,6 +639,9 @@ private:
 
        std::thread mixer_thread;
        std::thread audio_thread;
+#ifdef HAVE_SRT
+       std::thread srt_thread;
+#endif
        std::atomic<bool> should_quit{false};
        std::atomic<bool> should_cut{false};