]> git.sesse.net Git - nageru/commitdiff
Consistently use “video card” instead of “card”.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 11 Aug 2016 17:48:12 +0000 (19:48 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 19 Oct 2016 22:55:44 +0000 (00:55 +0200)
audio_mixer.cpp
audio_mixer.h
defs.h
input_state.h
mixer.cpp
mixer.h
theme.cpp

index b61a3c300009eda219179863617914325517ba1e..c4f6f0b52c9f055414f5d06542502727aeec2de1 100644 (file)
@@ -195,8 +195,7 @@ AudioMixer::AudioDevice *AudioMixer::find_audio_device(DeviceSpec device)
 {
        switch (device.type) {
        case InputSourceType::CAPTURE_CARD:
-               return &cards[device.index];
-               break;
+               return &video_cards[device.index];
        case InputSourceType::SILENCE:
        default:
                assert(false);
@@ -246,7 +245,7 @@ void AudioMixer::fill_audio_bus(const vector<float> *samples_card, const InputMa
 
 vector<float> AudioMixer::get_output(double pts, unsigned num_samples, ResamplingQueue::RateAdjustmentPolicy rate_adjustment_policy)
 {
-       vector<float> samples_card[MAX_CARDS];  // TODO: Needs room for other kinds of capture cards.
+       vector<float> samples_card[MAX_VIDEO_CARDS];  // TODO: Needs room for other kinds of capture cards.
        vector<float> samples_bus;
 
        lock_guard<mutex> lock(audio_mutex);
@@ -256,7 +255,7 @@ vector<float> AudioMixer::get_output(double pts, unsigned num_samples, Resamplin
        // might have changed; if so, we need to do some sort of remapping
        // to silence.
        for (unsigned card_index = 0; card_index < num_cards; ++card_index) {
-               AudioDevice *device = &cards[card_index];
+               AudioDevice *device = &video_cards[card_index];
                if (!device->interesting_channels.empty()) {
                        samples_card[card_index].resize(num_samples * device->interesting_channels.size());
                        device->resampling_queue->get_output_samples(
@@ -405,7 +404,7 @@ map<DeviceSpec, DeviceInfo> AudioMixer::get_devices() const
        map<DeviceSpec, DeviceInfo> devices;
        for (unsigned card_index = 0; card_index < num_cards; ++card_index) {
                const DeviceSpec spec{ InputSourceType::CAPTURE_CARD, card_index };
-               const AudioDevice *device = &cards[card_index];
+               const AudioDevice *device = &video_cards[card_index];
                DeviceInfo info;
                info.name = device->name;
                info.num_channels = 8;  // FIXME: This is wrong for fake cards.
@@ -440,7 +439,7 @@ void AudioMixer::set_input_mapping(const InputMapping &new_input_mapping)
        // Reset resamplers for all cards that don't have the exact same state as before.
        for (unsigned card_index = 0; card_index < num_cards; ++card_index) {
                DeviceSpec device_spec{InputSourceType::CAPTURE_CARD, card_index};
-               AudioDevice *device = &cards[card_index];
+               AudioDevice *device = &video_cards[card_index];
                if (device->interesting_channels != interesting_channels[device_spec]) {
                        device->interesting_channels = interesting_channels[device_spec];
                        reset_device_mutex_held(DeviceSpec{InputSourceType::CAPTURE_CARD, card_index});
index f2c77b91c8130cfba4a4edd3aa5200df87178b94..0fe34185ca68b0f334a8a84703bf3fe4b44551a7 100644 (file)
@@ -215,7 +215,7 @@ private:
 
        mutable std::mutex audio_mutex;
 
-       AudioDevice cards[MAX_CARDS];  // Under audio_mutex.
+       AudioDevice video_cards[MAX_VIDEO_CARDS];  // Under audio_mutex.
 
        StereoFilter locut;  // Default cutoff 120 Hz, 24 dB/oct.
        std::atomic<float> locut_cutoff_hz;
diff --git a/defs.h b/defs.h
index b64aeef8e26a7e23e423d4516aeda7a530c546bd..15e6f3cf6f12e83aaa868b89f227502bd8776aba 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -6,7 +6,7 @@
 #define WIDTH 1280
 #define HEIGHT 720
 #define FAKE_FPS 25  // Must be an integer.
-#define MAX_CARDS 16
+#define MAX_VIDEO_CARDS 16
 #define MAX_BUSES 256  // Audio buses.
 
 // For deinterlacing. See also comments on InputState.
index 70b4436ec147f4972caa2c9d854a4ba6107a7ff2..ca14739a1813727b3400da73abdd4ab4b3cab925 100644 (file)
@@ -18,7 +18,7 @@ struct InputState {
        // interlaced output (for deinterlacing), so if we detect progressive input,
        // we immediately clear out all history and all entries will point to the same
        // frame.
-       BufferedFrame buffered_frames[MAX_CARDS][FRAME_HISTORY_LENGTH];
+       BufferedFrame buffered_frames[MAX_VIDEO_CARDS][FRAME_HISTORY_LENGTH];
 };
 
 #endif  // !defined(_INPUT_STATE_H)
index 7624c8013823ca5c67e119503cb306a449438eda..e0371429bc9dc3f678ffb80d0dfb37bf6c3bfdd6 100644 (file)
--- a/mixer.cpp
+++ b/mixer.cpp
@@ -569,9 +569,9 @@ void Mixer::thread_func()
        int stats_dropped_frames = 0;
 
        while (!should_quit) {
-               CaptureCard::NewFrame new_frames[MAX_CARDS];
-               bool has_new_frame[MAX_CARDS] = { false };
-               int num_samples[MAX_CARDS] = { 0 };
+               CaptureCard::NewFrame new_frames[MAX_VIDEO_CARDS];
+               bool has_new_frame[MAX_VIDEO_CARDS] = { false };
+               int num_samples[MAX_VIDEO_CARDS] = { 0 };
 
                unsigned master_card_index = theme->map_signal(master_clock_channel);
                assert(master_card_index < num_cards);
@@ -681,7 +681,7 @@ void Mixer::thread_func()
        resource_pool->clean_context();
 }
 
-void Mixer::get_one_frame_from_each_card(unsigned master_card_index, CaptureCard::NewFrame new_frames[MAX_CARDS], bool has_new_frame[MAX_CARDS], int num_samples[MAX_CARDS])
+void Mixer::get_one_frame_from_each_card(unsigned master_card_index, CaptureCard::NewFrame new_frames[MAX_VIDEO_CARDS], bool has_new_frame[MAX_VIDEO_CARDS], int num_samples[MAX_VIDEO_CARDS])
 {
 start:
        // The first card is the master timer, so wait for it to have a new frame.
diff --git a/mixer.h b/mixer.h
index 31ae7ae907f79fc1c2ef8f875fb2f9f89a940ed8..354735da57d9e7a6880a18a6bab5f7cc3350ccbb 100644 (file)
--- a/mixer.h
+++ b/mixer.h
@@ -382,9 +382,9 @@ private:
 
                int last_timecode = -1;  // Unwrapped.
        };
-       CaptureCard cards[MAX_CARDS];  // protected by <bmusb_mutex>
+       CaptureCard cards[MAX_VIDEO_CARDS];  // protected by <bmusb_mutex>
        AudioMixer audio_mixer;
-       void get_one_frame_from_each_card(unsigned master_card_index, CaptureCard::NewFrame new_frames[MAX_CARDS], bool has_new_frame[MAX_CARDS], int num_samples[MAX_CARDS]);
+       void get_one_frame_from_each_card(unsigned master_card_index, CaptureCard::NewFrame new_frames[MAX_VIDEO_CARDS], bool has_new_frame[MAX_VIDEO_CARDS], int num_samples[MAX_VIDEO_CARDS]);
 
        InputState input_state;
 
@@ -445,10 +445,10 @@ private:
        std::queue<AudioTask> audio_task_queue;  // Under audio_mutex.
 
        // For mode scanning.
-       bool is_mode_scanning[MAX_CARDS]{ false };
-       std::vector<uint32_t> mode_scanlist[MAX_CARDS];
-       unsigned mode_scanlist_index[MAX_CARDS]{ 0 };
-       std::chrono::steady_clock::time_point last_mode_scan_change[MAX_CARDS];
+       bool is_mode_scanning[MAX_VIDEO_CARDS]{ false };
+       std::vector<uint32_t> mode_scanlist[MAX_VIDEO_CARDS];
+       unsigned mode_scanlist_index[MAX_VIDEO_CARDS]{ 0 };
+       std::chrono::steady_clock::time_point last_mode_scan_change[MAX_VIDEO_CARDS];
 };
 
 extern Mixer *global_mixer;
index 1434d9854998ba43da510540dde286bf65cdd1b8..d6c9a239b219556ce8fb2d9d2b7222b538e4ce6e 100644 (file)
--- a/theme.cpp
+++ b/theme.cpp
@@ -45,14 +45,14 @@ namespace {
 struct InputStateInfo {
        InputStateInfo(const InputState& input_state);
 
-       unsigned last_width[MAX_CARDS], last_height[MAX_CARDS];
-       bool last_interlaced[MAX_CARDS], last_has_signal[MAX_CARDS], last_is_connected[MAX_CARDS];
-       unsigned last_frame_rate_nom[MAX_CARDS], last_frame_rate_den[MAX_CARDS];
+       unsigned last_width[MAX_VIDEO_CARDS], last_height[MAX_VIDEO_CARDS];
+       bool last_interlaced[MAX_VIDEO_CARDS], last_has_signal[MAX_VIDEO_CARDS], last_is_connected[MAX_VIDEO_CARDS];
+       unsigned last_frame_rate_nom[MAX_VIDEO_CARDS], last_frame_rate_den[MAX_VIDEO_CARDS];
 };
 
 InputStateInfo::InputStateInfo(const InputState &input_state)
 {
-       for (unsigned signal_num = 0; signal_num < MAX_CARDS; ++signal_num) {
+       for (unsigned signal_num = 0; signal_num < MAX_VIDEO_CARDS; ++signal_num) {
                BufferedFrame frame = input_state.buffered_frames[signal_num][0];
                if (frame.frame == nullptr) {
                        last_width[signal_num] = last_height[signal_num] = 0;