From 594ce12813bb48a329420264294ef666de048fd7 Mon Sep 17 00:00:00 2001 From: Julian Waller Date: Thu, 19 Oct 2023 13:45:18 +0100 Subject: [PATCH] feat: remove ivga consumer the ndi consumer has been available for a couple of releases now, and the needed ivga dll files are not available officially anymore --- README.md | 2 - src/modules/newtek/CMakeLists.txt | 5 - .../newtek/consumer/newtek_ivga_consumer.cpp | 152 ------------------ .../newtek/consumer/newtek_ivga_consumer.h | 41 ----- src/modules/newtek/newtek.cpp | 10 -- src/modules/newtek/util/air_send.cpp | 91 ----------- src/modules/newtek/util/air_send.h | 43 ----- src/shell/casparcg.config | 1 - 8 files changed, 345 deletions(-) delete mode 100644 src/modules/newtek/consumer/newtek_ivga_consumer.cpp delete mode 100644 src/modules/newtek/consumer/newtek_ivga_consumer.h delete mode 100644 src/modules/newtek/util/air_send.cpp delete mode 100644 src/modules/newtek/util/air_send.h diff --git a/README.md b/README.md index ae66c12476..61b387c2e6 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,6 @@ Getting Started 3. Install Adobe Flash Player 11.8.800.94 from the unpacked archive: fp_11.8.800.94_archive\11_8_r800_94\flashplayer11_8r800_94_winax.exe - - For NewTek iVGA support (Windows only), please download and install the iVGA driver from (http://new.tk/NetworkSendRedist) - 3. Configure the server by editing the self-documented "casparcg.config" file in a text editor. diff --git a/src/modules/newtek/CMakeLists.txt b/src/modules/newtek/CMakeLists.txt index de2965b7f7..5c2deeae53 100644 --- a/src/modules/newtek/CMakeLists.txt +++ b/src/modules/newtek/CMakeLists.txt @@ -37,11 +37,6 @@ set(HEADERS StdAfx.h ) -if (MSVC) - list(APPEND SOURCES util/air_send.cpp consumer/newtek_ivga_consumer.cpp) - list(APPEND HEADERS util/air_send.h consumer/newtek_ivga_consumer.h) -endif() - add_library(newtek ${SOURCES} ${HEADERS}) target_compile_features(newtek PRIVATE cxx_std_17) target_include_directories(newtek PRIVATE diff --git a/src/modules/newtek/consumer/newtek_ivga_consumer.cpp b/src/modules/newtek/consumer/newtek_ivga_consumer.cpp deleted file mode 100644 index 7af38e5dd3..0000000000 --- a/src/modules/newtek/consumer/newtek_ivga_consumer.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright 2013 NewTek - * - * This file is part of CasparCG (www.casparcg.com). - * - * CasparCG is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CasparCG is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CasparCG. If not, see . - * - * Author: Robert Nagy, ronag@live.com - */ - -#include "../StdAfx.h" - -#include "newtek_ivga_consumer.h" - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include - -#include "../util/air_send.h" - -namespace caspar { namespace newtek { - -struct newtek_ivga_consumer : public core::frame_consumer -{ - core::video_format_desc format_desc_; - std::shared_ptr air_send_; - std::atomic connected_ = false; - spl::shared_ptr graph_; - timer tick_timer_; - - public: - newtek_ivga_consumer() - { - if (!airsend::is_available()) { - CASPAR_THROW_EXCEPTION(not_supported() << msg_info(airsend::dll_name() + L" not available")); - } - - graph_->set_text(print()); - graph_->set_color("frame-time", diagnostics::color(0.5f, 1.0f, 0.2f)); - graph_->set_color("tick-time", diagnostics::color(0.0f, 0.6f, 0.9f)); - graph_->set_color("dropped-frame", diagnostics::color(0.3f, 0.6f, 0.3f)); - diagnostics::register_graph(graph_); - } - - ~newtek_ivga_consumer() {} - - // frame_consumer - - void initialize(const core::video_format_desc& format_desc, int channel_index) override - { - format_desc_ = format_desc; - - air_send_.reset(airsend::create(format_desc.width, - format_desc.height, - format_desc.time_scale * format_desc.field_count, - format_desc.duration, - true, - static_cast(format_desc.square_width) / - static_cast(format_desc.square_height), - true, - format_desc.audio_channels, - format_desc.audio_sample_rate), - airsend::destroy); - - CASPAR_VERIFY(air_send_); - } - - std::future send(core::video_field field, core::const_frame frame) override - { - CASPAR_VERIFY(format_desc_.height * format_desc_.width * 4 == frame.image_data(0).size()); - - graph_->set_value("tick-time", tick_timer_.elapsed() * format_desc_.fps * 0.5); - tick_timer_.restart(); - - caspar::timer frame_timer; - - { - auto audio_buffer = core::audio_32_to_16(frame.audio_data()); - airsend::add_audio(air_send_.get(), - audio_buffer.data(), - static_cast(audio_buffer.size()) / format_desc_.audio_channels); - } - - { - connected_ = airsend::add_frame_bgra(air_send_.get(), frame.image_data(0).begin()); - } - - graph_->set_text(print()); - graph_->set_value("frame-time", frame_timer.elapsed() * format_desc_.fps * 0.5); - - return make_ready_future(true); - } - - std::wstring print() const override - { - return connected_ ? L"newtek-ivga[connected]" : L"newtek-ivga[not connected]"; - } - - std::wstring name() const override { return L"newtek-ivga"; } - - int index() const override { return 900; } - - bool has_synchronization_clock() const override { return false; } - - core::monitor::state state() const override - { - static const core::monitor::state empty; - return empty; - } -}; - -spl::shared_ptr create_ivga_consumer(const std::vector& params, - const core::video_format_repository& format_repository, - std::vector> channels) -{ - if (params.size() < 1 || !boost::iequals(params.at(0), L"NEWTEK_IVGA")) - return core::frame_consumer::empty(); - - return spl::make_shared(); -} - -spl::shared_ptr -create_preconfigured_ivga_consumer(const boost::property_tree::wptree& ptree, - const core::video_format_repository& format_repository, - std::vector> channels) -{ - return spl::make_shared(); -} - -}} // namespace caspar::newtek diff --git a/src/modules/newtek/consumer/newtek_ivga_consumer.h b/src/modules/newtek/consumer/newtek_ivga_consumer.h deleted file mode 100644 index a54cd0801a..0000000000 --- a/src/modules/newtek/consumer/newtek_ivga_consumer.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2013 Sveriges Television AB http://casparcg.com/ - * - * This file is part of CasparCG (www.casparcg.com). - * - * CasparCG is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CasparCG is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CasparCG. If not, see . - * - * Author: Robert Nagy, ronag89@gmail.com - */ - -#pragma once - -#include - -#include - -#include - -#include - -namespace caspar { namespace newtek { - -spl::shared_ptr create_ivga_consumer(const std::vector& params, - const core::video_format_repository& format_repository, - std::vector> channels); -spl::shared_ptr -create_preconfigured_ivga_consumer(const boost::property_tree::wptree& ptree, - const core::video_format_repository& format_repository, - std::vector> channels); -}} // namespace caspar::newtek diff --git a/src/modules/newtek/newtek.cpp b/src/modules/newtek/newtek.cpp index 52ac71c779..c8ab6ec82e 100644 --- a/src/modules/newtek/newtek.cpp +++ b/src/modules/newtek/newtek.cpp @@ -21,10 +21,6 @@ #include "newtek.h" -#ifdef _WIN32 -#include "consumer/newtek_ivga_consumer.h" -#endif - #include "consumer/newtek_ndi_consumer.h" #include "producer/newtek_ndi_producer.h" @@ -40,12 +36,6 @@ namespace caspar { namespace newtek { void init(const core::module_dependencies& dependencies) { try { -#ifdef _WIN32 - dependencies.consumer_registry->register_consumer_factory(L"iVGA Consumer", create_ivga_consumer); - dependencies.consumer_registry->register_preconfigured_consumer_factory(L"newtek-ivga", - create_preconfigured_ivga_consumer); -#endif - dependencies.consumer_registry->register_consumer_factory(L"NDI Consumer", create_ndi_consumer); dependencies.consumer_registry->register_preconfigured_consumer_factory(L"ndi", create_preconfigured_ndi_consumer); diff --git a/src/modules/newtek/util/air_send.cpp b/src/modules/newtek/util/air_send.cpp deleted file mode 100644 index 25aa1139f8..0000000000 --- a/src/modules/newtek/util/air_send.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2013 Sveriges Television AB http://casparcg.com/ - * - * This file is part of CasparCG (www.casparcg.com). - * - * CasparCG is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CasparCG is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CasparCG. If not, see . - * - * Author: Helge Norberg, helge.norberg@svt.se - */ - -#include "../StdAfx.h" - -#include "air_send.h" - -#include - -#include - -namespace caspar { namespace newtek { namespace airsend { - -void* (*create)(const int width, - const int height, - const int timescale, - const int duration, - const bool progressive, - const float aspect_ratio, - const bool audio_enabled, - const int num_channels, - const int sample_rate) = nullptr; -void (*destroy)(void* instance) = nullptr; -bool (*add_audio)(void* instance, const short* samples, const int num_samples) = nullptr; -bool (*add_frame_bgra)(void* instance, const unsigned char* data) = nullptr; - -const std::wstring& dll_name() -{ - static std::wstring name = L"Processing.AirSend.x64.dll"; - - return name; -} - -std::shared_ptr load_library() -{ - auto module = LoadLibrary(dll_name().c_str()); - - if (!module) - return nullptr; - - std::shared_ptr lib(module, FreeLibrary); - - wchar_t actualFilename[256]; - - GetModuleFileNameW(module, actualFilename, sizeof(actualFilename)); - - CASPAR_LOG(info) << L"Loaded " << actualFilename; - - create = reinterpret_cast(GetProcAddress(module, "AirSend_Create")); - destroy = reinterpret_cast(GetProcAddress(module, "AirSend_Destroy")); - add_audio = reinterpret_cast(GetProcAddress(module, "AirSend_add_audio")); - add_frame_bgra = reinterpret_cast(GetProcAddress(module, "AirSend_add_frame_bgra")); - - if (create == nullptr || destroy == nullptr || add_audio == nullptr || add_frame_bgra == nullptr) { - create = nullptr; - destroy = nullptr; - add_audio = nullptr; - add_frame_bgra = nullptr; - - return nullptr; - } - - return lib; -} - -bool is_available() -{ - static std::shared_ptr lib = load_library(); - - return static_cast(lib); -} - -}}} // namespace caspar::newtek::airsend diff --git a/src/modules/newtek/util/air_send.h b/src/modules/newtek/util/air_send.h deleted file mode 100644 index 6075393c71..0000000000 --- a/src/modules/newtek/util/air_send.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2013 Sveriges Television AB http://casparcg.com/ - * - * This file is part of CasparCG (www.casparcg.com). - * - * CasparCG is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CasparCG is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CasparCG. If not, see . - * - * Author: Helge Norberg, helge.norberg@svt.se - */ -#pragma once - -#include - -namespace caspar { namespace newtek { namespace airsend { - -const std::wstring& dll_name(); -bool is_available(); - -extern void* (*create)(const int width, - const int height, - const int timescale, - const int duration, - const bool progressive, - const float aspect_ratio, - const bool audio_enabled, - const int num_channels, - const int sample_rate); -extern void (*destroy)(void* instance); -extern bool (*add_audio)(void* instance, const short* samples, const int num_samples); -extern bool (*add_frame_bgra)(void* instance, const unsigned char* data); - -}}} // namespace caspar::newtek::airsend diff --git a/src/shell/casparcg.config b/src/shell/casparcg.config index de4b203ac2..bcee8fe592 100644 --- a/src/shell/casparcg.config +++ b/src/shell/casparcg.config @@ -146,7 +146,6 @@ false [true|false] RGB [RGB|datavideo-full|datavideo-limited] (Enables colour space convertion for DataVideo TC-100 / TC-200) - [custom name] false [true|false]