Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Mar 11, 2021
1 parent 420ca1f commit fbd55c2
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 25 deletions.
36 changes: 18 additions & 18 deletions src/modules/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
cmake_minimum_required(VERSION 2.6)
project("modules")

add_subdirectory(ffmpeg)
add_subdirectory(oal)
add_subdirectory(decklink)
add_subdirectory(screen)
add_subdirectory(newtek)
if (ENABLE_HTML)
add_subdirectory(html)
endif ()

if (MSVC)
add_subdirectory(flash)
add_subdirectory(bluefish)
endif()

add_subdirectory(image)
cmake_minimum_required(VERSION 2.6)
project("modules")

add_subdirectory(image)
add_subdirectory(ffmpeg)
add_subdirectory(oal)
add_subdirectory(decklink)
add_subdirectory(screen)
add_subdirectory(newtek)
if (ENABLE_HTML)
add_subdirectory(html)
endif ()

if (MSVC)
add_subdirectory(flash)
add_subdirectory(bluefish)
endif()

4 changes: 4 additions & 0 deletions src/modules/image/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ set(SOURCES

producer/image_producer.cpp

producer/image_scroll_producer.cpp

util/image_algorithms.cpp
util/image_loader.cpp

Expand All @@ -16,6 +18,8 @@ set(HEADERS

producer/image_producer.h

producer/image_scroll_producer.h

util/image_algorithms.h
util/image_loader.h
util/image_view.h
Expand Down
6 changes: 1 addition & 5 deletions src/modules/image/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,11 @@ std::wstring version() { return u16(FreeImage_GetVersion()); }
void init(core::module_dependencies dependencies)
{
FreeImage_Initialise();
dependencies.producer_registry->register_producer_factory(L"Image Scroll Producer", create_scroll_producer);
dependencies.producer_registry->register_producer_factory(L"Image Producer", create_producer);
dependencies.consumer_registry->register_consumer_factory(L"Image Consumer", create_consumer);
}

void init_scroll(core::module_dependencies dependencies)
{
dependencies.producer_registry->register_producer_factory(L"Image Scroll Producer", create_scroll_producer);
}

void uninit() { FreeImage_DeInitialise(); }

}} // namespace caspar::image
1 change: 0 additions & 1 deletion src/modules/image/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
namespace caspar { namespace image {

void init(core::module_dependencies dependencies);
void init_scroll(core::module_dependencies dependencies);
void uninit();

}} // namespace caspar::image
4 changes: 4 additions & 0 deletions src/modules/image/producer/image_producer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ class ieq
spl::shared_ptr<core::frame_producer> create_producer(const core::frame_producer_dependencies& dependencies,
const std::vector<std::wstring>& params)
{
if (boost::contains(params.at(0), L"://")) {
return core::frame_producer::empty();
}

auto length = get_param(L"LENGTH", params, std::numeric_limits<uint32_t>::max());

// if (boost::iequals(params.at(0), L"[IMG_SEQUENCE]"))
Expand Down
7 changes: 6 additions & 1 deletion src/modules/image/producer/image_scroll_producer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include <common/os/filesystem.h>
#include <common/future.h>

#include <boost/algorithm/string.hpp>
#include <boost/filesystem.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/property_tree/ptree.hpp>
Expand Down Expand Up @@ -385,7 +386,7 @@ struct image_scroll_producer : public core::frame_producer
{
speed_ = speed_tweener(speed, speed, 0, tweener(L"linear"));
}

core::draw_frame receive_impl(int nb_samples) override
{
frame_ = render_frame(true, true);
Expand Down Expand Up @@ -421,6 +422,10 @@ struct image_scroll_producer : public core::frame_producer

spl::shared_ptr<core::frame_producer> create_scroll_producer(const core::frame_producer_dependencies& dependencies, const std::vector<std::wstring>& params)
{
if (boost::contains(params.at(0), L"://")) {
return core::frame_producer::empty();
}

std::wstring filename = env::media_folder() + params.at(0);

auto ext = std::find_if(supported_extensions().begin(), supported_extensions().end(), [&](const std::wstring& ex) -> bool {
Expand Down

0 comments on commit fbd55c2

Please sign in to comment.