Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Dec 22, 2023
1 parent 172a7e0 commit 480b1ae
Show file tree
Hide file tree
Showing 34 changed files with 209 additions and 190 deletions.
4 changes: 1 addition & 3 deletions src/common/executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ class executor final
{
}

~executor() {
stop_and_wait();
}
~executor() { stop_and_wait(); }

template <typename Func>
auto begin_invoke(Func&& func)
Expand Down
18 changes: 9 additions & 9 deletions src/core/consumer/frame_consumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ class print_consumer_proxy : public frame_consumer
core::monitor::state state() const override { return consumer_->state(); }
};

spl::shared_ptr<core::frame_consumer>
frame_consumer_registry::create_consumer(const std::vector<std::wstring>& params,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels) const
spl::shared_ptr<core::frame_consumer> frame_consumer_registry::create_consumer(
const std::vector<std::wstring>& params,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels) const
{
if (params.empty())
CASPAR_THROW_EXCEPTION(invalid_argument() << msg_info("params cannot be empty"));
Expand All @@ -187,11 +187,11 @@ frame_consumer_registry::create_consumer(const std::vector<std::wstring>&
return spl::make_shared<destroy_consumer_proxy>(spl::make_shared<print_consumer_proxy>(std::move(consumer)));
}

spl::shared_ptr<frame_consumer>
frame_consumer_registry::create_consumer(const std::wstring& element_name,
const boost::property_tree::wptree& element,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels) const
spl::shared_ptr<frame_consumer> frame_consumer_registry::create_consumer(
const std::wstring& element_name,
const boost::property_tree::wptree& element,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels) const
{
auto& preconfigured_consumer_factories = impl_->preconfigured_consumer_factories;
auto found = preconfigured_consumer_factories.find(element_name);
Expand Down
34 changes: 18 additions & 16 deletions src/core/consumer/frame_consumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@

#include <functional>
#include <future>
#include <map>
#include <string>
#include <vector>
#include <map>

namespace caspar { namespace core {

Expand All @@ -60,14 +60,14 @@ class frame_consumer
virtual int index() const = 0;
};

using consumer_factory_t =
std::function<spl::shared_ptr<frame_consumer>(const std::vector<std::wstring>& params,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels)>;
using preconfigured_consumer_factory_t =
std::function<spl::shared_ptr<frame_consumer>(const boost::property_tree::wptree& element,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels)>;
using consumer_factory_t = std::function<spl::shared_ptr<frame_consumer>(
const std::vector<std::wstring>& params,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels)>;
using preconfigured_consumer_factory_t = std::function<spl::shared_ptr<frame_consumer>(
const boost::property_tree::wptree& element,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels)>;

class frame_consumer_registry
{
Expand All @@ -76,13 +76,15 @@ class frame_consumer_registry
void register_consumer_factory(const std::wstring& name, const consumer_factory_t& factory);
void register_preconfigured_consumer_factory(const std::wstring& element_name,
const preconfigured_consumer_factory_t& factory);
spl::shared_ptr<frame_consumer> create_consumer(const std::vector<std::wstring>& params,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels) const;
spl::shared_ptr<frame_consumer> create_consumer(const std::wstring& element_name,
const boost::property_tree::wptree& element,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels) const;
spl::shared_ptr<frame_consumer>
create_consumer(const std::vector<std::wstring>& params,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels) const;
spl::shared_ptr<frame_consumer>
create_consumer(const std::wstring& element_name,
const boost::property_tree::wptree& element,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels) const;

private:
struct impl;
Expand Down
10 changes: 5 additions & 5 deletions src/core/producer/frame_producer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ void frame_producer_registry::register_producer_factory(std::wstring name, const
}

frame_producer_dependencies::frame_producer_dependencies(
const spl::shared_ptr<core::frame_factory>& frame_factory,
const spl::shared_ptr<core::frame_factory>& frame_factory,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels,
const video_format_repository& format_repository,
const video_format_desc& format_desc,
const spl::shared_ptr<const frame_producer_registry>& producer_registry,
const spl::shared_ptr<const cg_producer_registry>& cg_registry)
const video_format_repository& format_repository,
const video_format_desc& format_desc,
const spl::shared_ptr<const frame_producer_registry>& producer_registry,
const spl::shared_ptr<const cg_producer_registry>& cg_registry)
: frame_factory(frame_factory)
, channels(channels)
, format_repository(format_repository)
Expand Down
14 changes: 7 additions & 7 deletions src/core/producer/frame_producer.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,15 @@ class frame_producer_registry;

struct frame_producer_dependencies
{
spl::shared_ptr<core::frame_factory> frame_factory;
spl::shared_ptr<core::frame_factory> frame_factory;
std::shared_ptr<std::map<int, protocol::amcp::channel_context>> channels;
video_format_repository format_repository;
video_format_desc format_desc;
spl::shared_ptr<const frame_producer_registry> producer_registry;
spl::shared_ptr<const cg_producer_registry> cg_registry;
video_format_repository format_repository;
video_format_desc format_desc;
spl::shared_ptr<const frame_producer_registry> producer_registry;
spl::shared_ptr<const cg_producer_registry> cg_registry;

frame_producer_dependencies(const spl::shared_ptr<core::frame_factory>& frame_factory,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels,
frame_producer_dependencies(const spl::shared_ptr<core::frame_factory>& frame_factory,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels,
const video_format_repository& format_repository,
const video_format_desc& format_desc,
const spl::shared_ptr<const frame_producer_registry>& producer_registry,
Expand Down
4 changes: 2 additions & 2 deletions src/modules/artnet/consumer/artnet_consumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ std::vector<fixture> get_fixtures_ptree(const boost::property_tree::wptree& ptre
}

spl::shared_ptr<core::frame_consumer>
create_preconfigured_consumer(const boost::property_tree::wptree& ptree,
const core::video_format_repository& format_repository,
create_preconfigured_consumer(const boost::property_tree::wptree& ptree,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels)
{
configuration config;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/artnet/consumer/artnet_consumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
namespace caspar { namespace artnet {

spl::shared_ptr<core::frame_consumer>
create_preconfigured_consumer(const boost::property_tree::wptree& ptree,
const core::video_format_repository& format_repository,
create_preconfigured_consumer(const boost::property_tree::wptree& ptree,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels);
}} // namespace caspar::artnet
11 changes: 6 additions & 5 deletions src/modules/bluefish/consumer/bluefish_consumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,9 +882,10 @@ struct bluefish_consumer_proxy : public core::frame_consumer
}
};

spl::shared_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels)
spl::shared_ptr<core::frame_consumer>
create_consumer(const std::vector<std::wstring>& params,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels)
{
if (params.size() < 1 || !boost::iequals(params.at(0), L"BLUEFISH")) {
return core::frame_consumer::empty();
Expand Down Expand Up @@ -937,8 +938,8 @@ spl::shared_ptr<core::frame_consumer> create_consumer(const std::vector<std::wst
}

spl::shared_ptr<core::frame_consumer>
create_preconfigured_consumer(const boost::property_tree::wptree& ptree,
const core::video_format_repository& format_repository,
create_preconfigured_consumer(const boost::property_tree::wptree& ptree,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels)
{
configuration config;
Expand Down
13 changes: 7 additions & 6 deletions src/modules/bluefish/consumer/bluefish_consumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,20 @@
#include <boost/property_tree/ptree_fwd.hpp>
#include <common/memory.h>
#include <core/fwd.h>
#include <map>
#include <string>
#include <vector>
#include <map>

namespace caspar { namespace bluefish {

spl::shared_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels);
spl::shared_ptr<core::frame_consumer>
create_consumer(const std::vector<std::wstring>& params,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels);

spl::shared_ptr<core::frame_consumer>
create_preconfigured_consumer(const boost::property_tree::wptree& ptree,
const core::video_format_repository& format_repository,
create_preconfigured_consumer(const boost::property_tree::wptree& ptree,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels);

}} // namespace caspar::bluefish
11 changes: 6 additions & 5 deletions src/modules/decklink/consumer/decklink_consumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -899,9 +899,10 @@ struct decklink_consumer_proxy : public core::frame_consumer
[[nodiscard]] core::monitor::state state() const override { return get_state_for_config(config_, format_desc_); }
};

spl::shared_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels)
spl::shared_ptr<core::frame_consumer>
create_consumer(const std::vector<std::wstring>& params,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels)
{
if (params.empty() || !boost::iequals(params.at(0), L"DECKLINK")) {
return core::frame_consumer::empty();
Expand All @@ -913,8 +914,8 @@ spl::shared_ptr<core::frame_consumer> create_consumer(const std::vector<std::wst
}

spl::shared_ptr<core::frame_consumer>
create_preconfigured_consumer(const boost::property_tree::wptree& ptree,
const core::video_format_repository& format_repository,
create_preconfigured_consumer(const boost::property_tree::wptree& ptree,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels)
{
configuration config = parse_xml_config(ptree, format_repository);
Expand Down
13 changes: 7 additions & 6 deletions src/modules/decklink/consumer/decklink_consumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,19 @@

#include <boost/property_tree/ptree_fwd.hpp>

#include <map>
#include <string>
#include <vector>
#include <map>

namespace caspar { namespace decklink {

spl::shared_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels);
spl::shared_ptr<core::frame_consumer>
create_preconfigured_consumer(const boost::property_tree::wptree& ptree,
const core::video_format_repository& format_repository,
create_consumer(const std::vector<std::wstring>& params,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels);
spl::shared_ptr<core::frame_consumer>
create_preconfigured_consumer(const boost::property_tree::wptree& ptree,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels);

}} // namespace caspar::decklink
11 changes: 6 additions & 5 deletions src/modules/ffmpeg/consumer/ffmpeg_consumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,9 +713,10 @@ struct ffmpeg_consumer : public core::frame_consumer
}
};

spl::shared_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels)
spl::shared_ptr<core::frame_consumer>
create_consumer(const std::vector<std::wstring>& params,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels)
{
if (params.size() < 2 || (!boost::iequals(params.at(0), L"STREAM") && !boost::iequals(params.at(0), L"FILE")))
return core::frame_consumer::empty();
Expand All @@ -729,8 +730,8 @@ spl::shared_ptr<core::frame_consumer> create_consumer(const std::vector<std::wst
}

spl::shared_ptr<core::frame_consumer>
create_preconfigured_consumer(const boost::property_tree::wptree& ptree,
const core::video_format_repository& format_repository,
create_preconfigured_consumer(const boost::property_tree::wptree& ptree,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels)
{
return spl::make_shared<ffmpeg_consumer>(u8(ptree.get<std::wstring>(L"path", L"")),
Expand Down
11 changes: 6 additions & 5 deletions src/modules/ffmpeg/consumer/ffmpeg_consumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,18 @@

#include <boost/property_tree/ptree_fwd.hpp>

#include <vector>
#include <map>
#include <vector>

namespace caspar { namespace ffmpeg {

spl::shared_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels);
spl::shared_ptr<core::frame_consumer>
create_consumer(const std::vector<std::wstring>& params,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels);
spl::shared_ptr<core::frame_consumer>
create_preconfigured_consumer(const boost::property_tree::wptree&,
const core::video_format_repository& format_repository,
const core::video_format_repository& format_repository,
const std::shared_ptr<std::map<int, protocol::amcp::channel_context>>& channels);

}} // namespace caspar::ffmpeg
2 changes: 1 addition & 1 deletion src/modules/html/html.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ void init(const core::module_dependencies& dependencies)

void uninit()
{
//std::cout << "SHUTDOWN" << std::endl;
// std::cout << "SHUTDOWN" << std::endl;
invoke([] { CefQuitMessageLoop(); });
g_cef_executor->begin_invoke([&] { CefShutdown(); });
g_cef_executor.reset();
Expand Down
Loading

0 comments on commit 480b1ae

Please sign in to comment.